ConfirmDialog focused Cancel on the next tick, but RDialog's own initial focus
ran after it and landed on the header's close button. Mark Cancel autofocus,
which RDialog already prefers, so a stray A or Enter cancels as intended.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Addresses Greptile's review on #4971: rounding reported 100 at 99.6%.
Flooring keeps the value a whole number.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Home and End go to the ends of the row, and with Ctrl to the first and
last item of the grid. A row of one cell (list view) has nowhere to go
inside it, so there Home and End move through the grid too. PageUp and
PageDown move about one viewport of rows, keeping the column. The
gallery and Missing games scroll the virtualised list to the edge row
and wait for it to load before focusing it.
The list row's click, Space and context-menu handlers move onto its
name link, which already takes every click on the row, so the row
element carries no handlers of its own.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pico8, Ruffle, JsDos and EmulatorJS each set and cleared the flag by hand next
to gameRunning, with their own unmount resets. Each now mirrors gameRunning
through usePlayingWhile, which clears the flag on dispose. JsDos hands input
back at unmount rather than in teardown; every exit from a running JsDos
replaces the document, so the difference is not observable.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Spatial nav used to bail whenever an overlay was open, and no dialog moves
focus on arrows, so a pad could only reach a dialog's first control:
ConfirmDialog's Confirm was unreachable app-wide. It now moves focus among the
controls of the topmost overlay's panel, including a dialog over a running
game, which replaces Stream's own exit-dialog arrow handler.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The gallery's rows now form a role="grid" with aria-multiselectable,
aria-rowcount and aria-rowindex. Each card sits in a gridcell carrying
aria-selected; in list view each row is a role="row" of gridcells
with aria-selected, under a header row of columnheaders that carry
aria-sort. Letter headings are rowheaders and skeleton rows are hidden.
RVirtualScroller gains bodyAttrs and a #head slot so the grid can own
the list header row without the toolbar above it. The list row's root
is now a div, and its name is the link, stretched over the row so a
click anywhere still opens the game.
useGridNav gains a roving mode that keeps a single tab stop in the
grid, including for rows mounted while scrolling. Space selects the
focused card or row and Shift+Space selects a range. This replaces the
Selected/Not selected description, whose strings are removed.
The Missing games list gets the same grid semantics and arrow keys.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Share one flag-mirror helper between useStageActive and usePlayingWhile, add a
deferred() test helper for Desktop's hand-answered calls, and note that players
opt into the pad exit by listening for gamepad:exitchord.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Release a desktop claim still held at unmount, mark an unstarted chord hold
with null rather than 0, and cover the Stream listener, the held-through-close
latch, and escape-stack cleanup in tests.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Drops the separate 100ms useExitChord poller. useGamepad already reads every
pad each frame and knows when the game owns input, so it now fires a
gamepad:exitchord window event after a 1.5s Select+Start hold, only while
playing with no overlay open. Stream and Desktop listen for it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The card and list row stay links. While the gallery is selecting they
describe their state (Selected / Not selected), Space toggles them, and
aria-keyshortcuts names the Ctrl/Cmd+Enter gesture that starts selecting.
The checkbox drawn on each item is now decorative: RCheckbox gains a
decorative mode that renders the box without an input or label, so it
is no longer a hidden tab stop or interactive content inside a link.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collapse the pair shells' footer into one flex row like AuthLayout's,
and name the list row's title and checkbox label once.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Keep the pair shells' footer out of the grid flow, label the bottom nav
landmark, name list-row checkboxes, reveal a keyboard-focused card
checkbox, drop aria-pressed from static cards that are not toggles, and
round the circular progressbar's aria-valuenow.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Require a release before a held Select+Start can fire again, so cancelling
the exit dialog with the chord still held no longer reopens it. Guard the
late desktop claim with useIsAlive instead of a local unmount flag.
Add usePlayingWhile next to useStageActive so both stream views mirror
their session into the playing flag, and clear it on dispose, through one
helper instead of a hand-wired watch and unmount reset each.
useExitChord reads the shared PAD_BUTTON names and skips disconnected
phantom pads via isUsablePad. A late desktop claim goes back through
release() rather than a second hand-written release call, and the desktop
tests share one claim fixture and release assertion.
With useGamepad muted for the whole desktop session, B no longer reached
the exit confirmation, leaving a pad-only admin with no way out. Move the
player's Select+Start hold into a useExitChord composable and use it in
both views, including while the claim is loading.
A claim that answers after the view has gone is now released straight
away instead of standing unrenewed until it goes stale. Tests cover the
flag while loading, the drop on exit, the exit hold and the late claim.
The desktop view never set the global playing flag, so useGamepad kept
translating pad presses into RomM navigation behind the stream: B popped
history (prompting to end the session), the D-pad moved focus and Start
opened the user menu while an admin configured the emulator. Hold the flag
while the desktop is opening or open, as the game player does.
Adds ENABLE_SCHEDULED_CLEANUP_ZIP_CACHE, SCHEDULED_CLEANUP_ZIP_CACHE_CRON,
ENABLE_SCHEDULED_CLEANUP_SYNC_SESSIONS and SCHEDULED_CLEANUP_SYNC_SESSIONS_CRON,
defaulting to the previous hardcoded behavior.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
rq only parses the cron when the scheduler loads it, then logs and drops
the job while cron_config had already logged it as scheduled. Validate it
up front and log an error instead. croniter was a transitive rq dependency
and is now declared directly, with its typeshed stubs for mypy.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
GET /api/play-sessions no longer narrows to the token's device when
device_id is omitted, so the all_devices flag is dropped. Reading anything
beyond the token's own device now requires devices.read, matching the
saves and device endpoints. GET /api/sync/sessions takes the shared
PageParams and gains offset paging.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reuse the shared PageParams for limit/offset, build device tokens through
tests.factories.make_device_token (the add_device_token fixture is gone on
master), and flatten the effective device_id expression.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Bound limit/offset at 0 so negative paging returns 422 instead of a 500,
use the Annotated Query style for all_devices, clarify that the flag only
affects device-bound tokens, and cover the omitted-flag default.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(backend): build test ROMs through one make_rom factory
Tests created Rom rows by hand in dozens of places, each spelling out the
same slug and filename fields and deriving the slug inline. Production never
computes a slug from a name, so this was test-only filler duplicated across
files.
tests/factories.py adds make_rom(platform, name, *, fs_stem, fs_extension,
**overrides), which fills the slug and filename columns and persists through
db_rom_handler.add_rom. The shared conftest fixtures, scan_stubs.add_rom and
the local helpers and inline constructors across 35 test files now use it.
Each test keeps its filename shape (underscored stems in the FULLTEXT search
tests, spaced "Name (USA)" stems in the sibling tests), and fixtures shared
across files keep their exact slugs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend): keep extensionless filenames intact in scan_stubs.add_rom
rpartition(".") on a name with no dot returned an empty stem and the whole
name as the extension, so make_rom stored ".README" for "README".
os.path.splitext leaves such names whole.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend): build test saves, states and screenshots through factories
Tests built Save, State and Screenshot rows by hand across about 20 files,
each spelling out file_name_no_tags, file_name_no_ext and file_extension
although BaseAsset already derives them from file_name.
tests/factories.py adds make_save, make_state and make_screenshot. Each sets
the rom and user ids, the file name, and a default file_path under the rom's
platform, applies overrides last, and persists through the matching db
handler. The conftest asset fixtures and the persisted constructors and local
helpers now use them. Rows a test observes keep their file_path, emulator,
slot, size and hash, and a filename part stays an override wherever it
differs from what the model derives.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend): ban direct add_* persistence in tests via ruff TID251
The factories only stay the one home for test rows if nothing routes
around them. Ruff's banned-api rule now flags db_rom_handler.add_rom,
db_save_handler.add_save, db_state_handler.add_state and
db_screenshot_handler.add_screenshot anywhere under tests/ except
tests/factories.py. Production code is unaffected.
The remaining add_rom calls move onto make_rom: the unique-path, soundtrack
and id-index tests in test_roms_handler.py, the scan tests in
test_fastapi.py, physical and missing rows in the feed, download and model
tests, and the name=None exporter rows. Scan tests keep a filename-derived
placeholder as the name, which scan_rom treats the same as no name. Three
calls keep a noqa: the tests of how add_rom merges a partial scanned row,
and the rescan test that persists scan_rom's output as a scan does.
The backend skill and the architecture doc now point at tests/factories.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(backend): move the firmware and client-token factories into tests/factories.py
The add_firmware and add_device_token conftest fixtures returned a builder,
unlike the importable make_* functions. They become make_firmware and
make_device_token alongside them, with the same defaults, and their callers
import them rather than requesting a fixture. make_device_token now draws the
raw credential from auth_handler.generate_client_token, so it carries the
real rmm_ prefix instead of restating it, and the hand-built client tokens in
the auth tests use it too.
The ruff TID251 ban now also covers db_firmware_handler.add_firmware and
db_client_token_handler.add_token under tests/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs: point at every test factory, not just the ROM and asset ones
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Search the gallery by providers' alternative titles
A search for "FF9" or "Final Fantasy 9" did not find "Final Fantasy IX":
the gallery search only matched roms.name and roms.fs_name, while the
alternative titles IGDB, MobyGames and ScreenScraper report lived in the
raw metadata blobs where no index reaches.
Add generated_search_aliases, a STORED generated column the engine fills
from those blobs, so every write path (scans, metadata refreshes, the
bulk update_rom, raw metadata edits) keeps it current with no backfill.
Migration 0145 rebuilds the MariaDB/MySQL FULLTEXT index over
(name, fs_name, aliases) and adds a pg_trgm GIN index on PostgreSQL, and
the search matches the column on both paths.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A62FTdVyav4wK5Nkj55MGy
* Compare the alias JSON type under the table's collation
On a utf8mb3_unicode_ci table, JSON_TYPE's result and the 'ARRAY'
literal carry different collations, so creating the generated column
failed with an illegal mix. CAST re-derives it, as _maria_text does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A62FTdVyav4wK5Nkj55MGy
* pr-ready step 2 (code-review): defer the alias column, share search columns
Loading a ROM no longer fetches generated_search_aliases, which only the
gallery search reads. The FULLTEXT match and the ILIKE fallback both take
their columns from one ROM_SEARCH_COLUMNS tuple.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A62FTdVyav4wK5Nkj55MGy
* pr-ready step 3 (simplify): register the search indexes, share the CAST
Both search indexes join the generated-column index registry, so any
later rebuild of the alias column puts them back instead of leaving
MariaDB's FULLTEXT index narrowed (and every MATCH failing) or the
PostgreSQL trgm index gone. 0145 shrinks to ensure_roms_columns plus
retiring 0084's index, and its downgrade guards DROP COLUMN with
has_column, since MySQL has no DROP COLUMN IF EXISTS.
_maria_char carries the collation CAST that _maria_text and the alias
expression share, the alias expression extracts each array twice
instead of three times, and the dialect test runs the handler's own
_fulltext_match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A62FTdVyav4wK5Nkj55MGy
* Store the search aliases as plain titles
The alias column held each provider's array as JSON text, so a short
ILIKE search for '"', ',' or '[' matched every ROM with any alias. Both
engines print an array as ["a", "b"] however it was stored, so the
expression strips the brackets and quotes and keeps the titles
separated by spaces, which search terms can never match on their own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A62FTdVyav4wK5Nkj55MGy
* Shorten the alias-search docstrings to one sentence
The migration and test-module docstrings explained the design in
several paragraphs; AGENTS.md asks for one sentence. The design notes
live in the PR description.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A62FTdVyav4wK5Nkj55MGy
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
The language selector and version tag sat outside the page's <main>
with no landmark around them (axe region). A plain <footer> gives them
one; both stay absolutely positioned against the shell, so the layout
is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the browse view, this view renders inside the app layout's
<main>, so its own <main> duplicated the main landmark on /music. A div
keeps the same layout without it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The view renders inside the app layout's <main>, so its own <main>
nested one main landmark in another (axe landmark-main-is-top-level
and landmark-no-duplicate-main on /music). A div keeps the same layout
without the duplicate landmark.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>