Commit Graph

12037 Commits

Author SHA1 Message Date
zurdi
fc10db47cb fix(v2): give the gallery a real Select all in both layouts
Grid view had no select-all at all, and list view's header checkbox
only selected the 72 loaded items per window. A shared composable now
selects the entire filtered result: loaded roms merge instantly, the
remainder is fetched at the backend's page cap with the sidecar
aggregations off, and an epoch guard discards a fetch that resolves
after the user already cleared the selection. The selection bar gains
a select-all button (the only affordance grid has), the list header
checkbox derives its tri-state from the whole result, and Ctrl/Cmd+A
runs the same path. The Missing games tab keeps loaded-only semantics
since it opts out of the rom id index.

Fixes #4335

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L
2026-09-11 13:04:57 +02:00
renovate[bot]
eccacaabc9 chore(deps): update github actions (#4445) 2026-09-10 21:49:58 -05:00
renovate[bot]
df8429a7d6 chore(deps): update postgres docker tag to v18 (#4444) 2026-09-10 21:27:17 -05:00
renovate[bot]
6d914f6d0e chore(deps): update astral-sh/setup-uv action to v10.1.0 (#4440) 2026-09-10 21:26:40 -05:00
Sam Dornan
1608a8964b ci: build each arch on a native runner and cache layers (#4437) 2026-09-10 20:41:56 -05:00
Georges-Antoine Assi
0fadc67030 Merge pull request #4438 from rommapp/docs/readme-copy-tweaks
docs: tighten the README copy
2026-09-10 21:19:55 -04:00
Georges-Antoine Assi
5098b7d913 docs: move the preview above the features and link it to the demo
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 21:18:15 -04:00
Georges-Antoine Assi
fcedf64008 docs: delete the leftover v1 preview screenshots
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 21:15:16 -04:00
Georges-Antoine Assi
985c0437ab docs: replace the preview section with a demo tour gif
Recorded against demo.romm.app: home, the NES library, a game page,
its achievements, and a game running in the browser.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 21:11:40 -04:00
Sam Dornan
7b72b4d130 ci: align and manage the Docker service image pins (#4433) 2026-09-10 19:53:23 -05:00
Georges-Antoine Assi
297ab12b96 docs: shorten the hosted deploy line
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:45:30 -04:00
Georges-Antoine Assi
591470466a docs: drop the filename tags bullet
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:44:52 -04:00
Georges-Antoine Assi
4a901f413b docs: trim the exports and API mention from the features list
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:44:39 -04:00
Georges-Antoine Assi
3ce7fd6e11 docs: fold the one-click deploy into the install section
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:43:05 -04:00
Georges-Antoine Assi
1aa18ca150 docs: drop the contributing section and reword the install intro
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:42:33 -04:00
Georges-Antoine Assi
942a6ae4f5 docs: align the friends list with the discord roles
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:41:56 -04:00
Georges-Antoine Assi
0c8e4da5b7 docs: refresh the features list
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:39:49 -04:00
Georges-Antoine Assi
a4e66b9f2f docs: rewrite the overview blurb
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:37:33 -04:00
Georges-Antoine Assi
d9eeee601c docs: tighten the README copy
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 20:37:00 -04:00
Sam Dornan
d6f0046d1d fix(tasks): refill the Switch TitleDB store a schema bump drops (#4432) 2026-09-10 19:36:26 -05:00
Sam Dornan
c9935140a7 fix(tasks): match a running task by its registry key (#4430) 2026-09-10 19:35:56 -05:00
Sam Dornan
3491bc8f46 chore(deps): upgrade rq to 2.12 (#4428)
RomM runs `rq cron` as a long-lived process, and 2.12 fixes the case
that process is most exposed to: CronScheduler.heartbeat() now re-creates
its Redis hash when the key has expired, so a scheduler whose host slept
past the 120s TTL comes back registered instead of running unlisted. The
TTL itself moves to DEFAULT_CRON_SCHEDULER_TTL, shared with the registry
cleanup threshold that prunes it, so the two can no longer drift apart.

2.12 also adds a CronJobRegistry, which makes a cron job's history
readable without an active scheduler. Nothing reads it yet; the task
endpoints report queue and job state, not cron history.

The one API removed, CronScheduler.save_jobs_data(), is internal to the
scheduler loop and is not called here. cron_config.py only calls
cron.register().

The constraint stays under 3.0 for the reasons the 2.11 bump recorded:
that release moves get_current_job() to contextvars, reworks dependency
handling behind a ReadyJobRegistry, and changes the
Worker.handle_job_success() signature, which RomMWorker subclasses around.


Claude-Session: https://claude.ai/code/session_01EXV6RTfrRjgH88P9CrtYPQ

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 18:03:19 -05:00
Georges-Antoine Assi
9edd7abecb Merge pull request #4427 from rommapp/docs/one-click-deploys
docs: add a one-click deploys section to the README
2026-09-10 18:49:32 -04:00
Georges-Antoine Assi
75d1b76186 docs: align the app screenshots with their headings
Floating the shot from inside the heading drops the 24px heading margin
that used to sit between the image top and the first line of copy.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 18:38:35 -04:00
Georges-Antoine Assi
9c256de04f docs: space the attribution off the app buttons
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 18:33:01 -04:00
Georges-Antoine Assi
34eed2cb1c docs: enlarge the app buttons and split the platform chips
Also drops the trailing clear after Grout, whose copy already runs past
its screenshot.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 18:32:34 -04:00
Georges-Antoine Assi
4dddbbdd60 docs: tighten the gap between the official app rows
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 18:30:29 -04:00
Georges-Antoine Assi
a9f39e4010 docs: drop the Hostinger box for a centered badge and detail line
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 18:29:58 -04:00
Georges-Antoine Assi
3d71536d05 docs: center the Hostinger badge with its details alongside
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 18:26:32 -04:00
Georges-Antoine Assi
88b2cc2c7d docs: tighten the app rows and the Hostinger block
Smaller CTA buttons, larger app logos, the firmware list moves under the
Grout row it belongs to, and Hostinger drops the logo and name so the
price and setup guide stack on the badge's left edge.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 18:17:43 -04:00
Zurdi
3b2df6006a Merge pull request #4425 from rommapp/fix/emulatorjs-mobile-controls-4081
fix(player): keep RomM chrome off the emulator on mobile
2026-09-11 00:00:12 +02:00
Zurdi
f559962ff0 Merge pull request #4424 from rommapp/fix/rom-user-sort-4100
fix(roms): keep unplayed games when sorting by a rom_user column
2026-09-10 23:59:23 +02:00
Georges-Antoine Assi
ba31b27e91 docs: turn the official app links into buttons
Each app gets a badge-style button in its own brand color, and the
attribution sits middle-aligned next to it instead of dropping below the
link baseline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 17:56:14 -04:00
Georges-Antoine Assi
e0ac2f7dc4 docs: stack the official apps and let Hostinger stand alone
The three app cards become full-width rows with the screenshot floated
beside the copy, and the deploy section drops Cloudzy and Railway since
neither install works.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 17:46:15 -04:00
Georges-Antoine Assi
55cff29326 docs: trim the official apps cards to logo, shot and link
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 17:40:05 -04:00
Georges-Antoine Assi
9158d12509 docs: give the official apps a three-column layout
Reuse the app copy, logos and screenshots from the marketing site so the
README shows what Playnite, Argosy and Grout look like instead of listing
one line each.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 17:29:29 -04:00
Georges-Antoine Assi
9843f9154d docs: use first person in the one-click deploy note
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 17:18:46 -04:00
Georges-Antoine Assi
c8fd8b84bf docs: tighten one-click deploy logo spacing
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 17:17:23 -04:00
Georges-Antoine Assi
e3c2151147 docs: drop the deploy badges and soften the one-click note
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 17:13:13 -04:00
Sam Dornan
130ea73c23 perf(metadata): compress the cache-only metadata dump records (#4426)
* perf(metadata): compress the cache-only metadata dump records

The LaunchBox and Switch TitleDB stores are read by exact key and never
scanned, so each value can be compressed on its own. On a full import of
both real dumps into the bundled valkey, `used_memory` drops from 539.1MB
to 335.9MB and RSS from 553.3MB to 350.2MB, a 38% saving.

Values are zstd level 3, which costs 3-6us per record read, less than the
`json.loads` that follows it. A payload under 256 bytes is stored as plain
JSON: below that a frame header and a poor ratio on a short payload cost
more than they save, which is what leaves the id-valued title and product
id indexes untouched. `tools/measure_dump_cache.py --sweep` finds the real
records flat between 64 and 256 bytes.

Reads detect the zstd frame rather than trusting the key, so a store
written by an earlier import keeps answering until the next update
rewrites it. No re-import is required to upgrade.

A zstd frame is not UTF-8, so the dump keys move to a cache client that
leaves values as bytes. `async_cache` still serves everything else,
including the existence checks on these keys.

The new tool measures per-store size with `MEMORY USAGE ... SAMPLES 0`,
which walks every field. The default of five samples extrapolates, and on
a hash of this size it is wrong by enough that per-key figures stop
adding up to `used_memory`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* test(metadata): assert the writer stores through the dump codec

`test_values_are_json_encoded` pinned the exact string `json.dumps`
produced with default separators. The writer now hands the pipeline
compact bytes from `encode`, so the test asserts the contract that
matters instead: the value is bytes, and it decodes back to the record.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* fix(tools): stop the dump measurement wiping the whole cache server

`flushall` between passes would erase every database on whatever
`--redis-url` names, and RomM's sessions and RQ queues share that
database with the dump stores, so pointing the tool at a live instance
cost far more than the stores it meant to reset.

It now deletes only the ten keys it writes, and refuses a server holding
anything else unless forced, since a running RomM would have to
re-import what it drops. Each pass records what the server uses without
those stores and reports figures net of it, so a non-empty server still
measures what the dumps themselves cost.

Reported by Greptile on #4426.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* fix(tools): report field counts and bytes off the stores, not the writes

Two accounting errors in the measurement tool, both reported by Copilot
on #4426.

Field counts and byte totals were tallied while writing, so they counted
write attempts. `HSET` overwrites, and the dump repeats a title on one
platform and an alternate name across platforms, so 8,997 of the writes
landed on a field another record already held: the alternate name store
reported 70,297 fields against 62,384 actually stored. Both figures now
come from `HLEN` and a scan of each hash, which cannot drift from what
the store holds.

`used_memory_rss` was offset by a `used_memory` baseline, mixing two
metrics. Netting RSS turns out to be wrong however the baseline is
captured, because the pages a delete frees stay resident, which made the
encoded pass report -56.1MB. RSS is now reported absolute, and `--only`
loads a single encoding so it can be read off a server started fresh for
that pass: 555.8MB plain against 348.9MB encoded, measured that way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* style(tools): cut the measurement tool's docstrings to the repo's limit

CLAUDE.md allows a docstring one sentence plus `Args:`/`Returns:`, and the
module docstring ran to four paragraphs. The non-obvious reasons move to
one-line comments at the code they explain, which is where a reader needs
them, and the operational detail was already carried by `--force` and
`--only`'s help text and by the refusal message itself.

Reported by Copilot on #4426.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* fix(tools): fold titles the way production does, and stop echoing the URL

Four more Copilot findings on #4426, three of them in the measurement tool
and one in the codec module.

The folded-title stand-in kept only ASCII alphanumerics, the exact thing
`fold_title`'s docstring warns against: it reduced `Astérix` to `astrix`
and `三國立志傳2` to `2`, and dropped titles that fold to nothing, so the
folded index measured smaller than it is. The tool now mirrors
`fold_title` character for character, verified against the real function
extracted from its module over 40,000 dump titles with no mismatch. The
store grows by 244 fields and 0.1MB, so the totals barely move.

The refusal path printed the target URL, which RomM builds with the
password inline, so it could have carried a credential into a CI log. It
now names the server generically and keeps the key count and the remedy.

`dump_cache`'s module docstring and its threshold comment both ran past
the one-to-two-line limit in CLAUDE.md. The benchmark numbers behind the
threshold live in the PR description, not the source.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* refactor(cache): give the dump store keys one home

The measurement tool carried its own copies of the ten store key strings,
against the single-source rule in CLAUDE.md. That matters more now the
tool deletes those keys: a production rename would have left it deleting
stale hashes, missing the new ones, and counting the real stores as
foreign data in its own safety guard.

The keys move to `handler/dump_cache.py`, which already holds the codec
that reads and writes them and depends on nothing but the cache client,
so the importers, the lookups and the tool all take them from there.
`DUMP_STORE_KEYS` is the list the tool measures and clears.

`base_handler` was reaching into `tasks/scheduled/update_switch_titledb`
for two constants, so a handler depended on a task module; that import is
gone. `launchbox_handler/types.py` keeps the initial-import flag, which
marks an import in progress rather than naming a store.

Measurement is unchanged: 538.0MB to 334.8MB, per-store figures identical.

Reported by Copilot on #4426.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* fix(tests): import the store keys from where the merge left them

Two test modules still took the keys from `handler.dump_cache`, which the
merge emptied of them, so collection failed with an ImportError on both
databases and mypy flagged nine missing attributes. They read them from
`launchbox_handler/types.py` and the TitleDB task now, as the code does.

Also reverts formatting the merge dragged into four files this change has
no business touching: running isort over everything the merge listed
reclassified `tests.*` and `startup` out of the block master keeps them
in, and black rewrote two `except (A, B)` clauses into the unparenthesized
form. Those files go back to master's copy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* style(tests): restore both metadata test files to master's formatting

Running the formatters over everything the merge touched had reordered
imports trunk keeps in another block. Both files go back to master's copy,
with the compressed-store read test re-added by hand and its import placed
in the first-party block where the other `handler.*` imports sit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* fix(tools): report bad input rather than dividing by zero

A zip with none of the four XML files loads no records, and every ratio
the report prints then divides by a zero total.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* refactor(tools): match the yields to their siblings, type the serializer

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

* style: trim the comments and tighten the names review-polish flags

Cut the version notes to what version 2 is, drop the two comments that
repeated a neighbour, rename the tool's `measure` to `store_memory` beside
`store_stats`, and annotate the codec tests' parametrized arguments.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQNNQHk7uyS3eoB9yAxoM9

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 16:09:32 -05:00
Georges-Antoine Assi
e1b6f63f66 style(player): trim the stage-flag comments to one home
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 16:38:30 -04:00
Georges-Antoine Assi
da3c5b773c refactor(roms): simplify the rom_user sort and its cache keys
Fold the three sidecar key builders into one `_sidecar_redis_key`, so the
key shape lives in one place and no sidecar can omit the schema version.

Carry the RomUser branch forward as a flag instead of re-deriving it from
the resolved column's `class_`, and state the char index guard positively
now that the fallback it described is gone (`Enum` subclasses `String`).

Collapse the two near-identical sort fixtures into one library, and assert
the user restriction is absent from the WHERE clause rather than counting
substring occurrences.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 16:29:52 -04:00
Georges-Antoine Assi
9217f1f9c7 Merge branch 'master' into fix/rom-user-sort-4100 2026-09-10 16:14:52 -04:00
Georges-Antoine Assi
44f7e5d51d Merge pull request #4416 from rommapp/fix/launchbox-cache-duplication
perf(metadata): stop storing the metadata dumps twice over in the cache
2026-09-10 16:13:55 -04:00
Georges-Antoine Assi
decd5c61c4 refactor(cache): make the versioned store a type rather than three constants
The schema key, its version and the keys they cover were three constants per
store, retyped at each of the six places that used them and interchangeable
enough that one store's version could be checked against another's keys. They
are a `VersionedCacheStore` now, so a store is declared once and the startup
drop is a loop over a table.

The two reader gates were the same four lines, and a third read path was
still checking the data key without the stamp, so the LaunchBox entry points
disagreed about what populated meant. All three call one helper.

The drop probed each key before deleting it, spending a round trip per key to
learn what `unlink` reports anyway, and `delete` freed the store on the main
thread. Both imports also merge into their hashes, so each now drops a stale
store itself rather than trusting the drop to have happened at startup.

The alternate name index holds the bare id its reader wants, like the two
title indexes beside it, and follows through the same helper.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 16:10:09 -04:00
Georges-Antoine Assi
721197476a perf(metadata): rebuild a metadata store an older release wrote
The readers tolerated both the old and the new shape of every index this
branch changed, which left two shapes supported forever and, on an install
whose scheduled update is off, meant the old store answered every lookup
and the saving never landed at all.

Each store now carries a schema stamp. A store whose stamp is missing or
stale reads as unpopulated, is dropped at startup, and has its import
queued the way the WebP backfill is, so the shape change causes the
rebuild instead of being worked around. The readers know one shape again.

The projection each store is written with moves next to its key, and the
three stores that had none get one: Mame.xml kept 24 fields per record to
serve `Name`, Files.xml kept the platform and filename its cache key
already carries, and an alternate name entry kept the name it is stored
under. Together with the image list that is ~135MB.

Measured against the real dump: the eight LaunchBox hashes hold 385MB, and
a store stamped by an earlier release is dropped at startup for 386MB of
`used_memory` reclaimed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 15:45:32 -04:00
Georges-Antoine Assi
13aaf54921 docs(metadata): trim the cache index comments to the fact each carries
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 13:19:30 -04:00
Georges-Antoine Assi
ea44dfd9cf refactor(metadata): fold the index follows into one lookup each
The title index reader now takes the key and field it reads, so the two
call sites lose their intermediate hit variable, and the alternate name
path follows its id through `get_by_id` like the other two. The Switch
titleID read is shared between the two lookups that do it.

The LaunchBox import reads the `Game` fields with `findtext`, and the
Switch import queues both indexes from one pass over the batches. The
image projection moves next to the `LaunchboxImage` type it fills.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 13:17:44 -04:00
zurdi
516b2cd188 test(roms): seed sidecar cache entries through the shared key builders
The sidecar gating tests built their redis keys inline, so the
schema-versioned key format left the positive memoisation case reading
nothing and the negative cases passing vacuously (an unseedable key can
never be read, gate or no gate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ND1wfNV3vKwu8Mfinn4WkA
2026-09-10 18:49:21 +02:00
zurdi
33c73a3fbe fix(roms): serve the char index only for lexically ordered sorts
The alpha strip's offsets only mean anything when the rows are ordered
by the letters being counted. Sorts that fell back to the name column
(dates, ratings) and native enum sorts (the database orders those by
declaration order) produced name-based offsets into a differently
ordered result, so strip jumps landed on the wrong rows. Skip the
sidecar for those sorts before touching the cache; the strip renders
its letters disabled. This also retires the letter walk's NULL bucket
and enum cast, which no such sort can reach any more.

Version the char_index and rom_id_index cache keys with the release
schema marker, like filter_values already does, so sidecars cached
before an ordering-semantics change stop being served after a deploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ND1wfNV3vKwu8Mfinn4WkA
2026-09-10 18:39:29 +02:00