selectionState keyed off the global count, so picks kept from another
filter left the header checkbox indeterminate over a result with
nothing selected; both branches now require a selected rom inside the
current result before reporting "some".
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L
A CRC renders in full, so the reveal-mode chip announced a disclosure
whose activation had nothing to show: short values now carry no
aria-expanded, no action label, no eye icon, and a click on them is a
no-op instead of a state flip nothing reflects.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L
Drop the console.warn for an unsupported configured core: it re-derived
the check the resolver already makes, and fired on the player's device
rather than where the admin would see it. The example config now points
at the exact core name instead.
Hoist the platform slug in onMounted, name the comment's dependency
rather than its placement, drop a redundant optional chain, and put the
new config tests on a helper matching their neighbours.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Pass the netplay flag to getSupportedEJSCores so a configured core that
only the nightly build offers is not dropped, resolve the core before the
save and state defaults so opening the player no longer clears a
remembered state id, warn when a configured core is unsupported, and
guard the store getter against a payload without the field.
Drop the write-back suppression: it left a game played with an inherited
core unpinned, so a later platform-level pick silently switched it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Simplify pass: the store's supersede-abort becomes the only
cancellation policy, so a re-trigger restarts the fetch instead of
re-arming it and the composable loses its module-level mutables (the
in-flight flag moves into the store next to the controller, epoch and
snapshot become per-invocation). The gallery-context guard moves into
fetchAllFilteredRoms, a filteredRomIds getter answers "is the result
known" once for the three gates, NO_SIDECARS gets one exported typed
home shared by the three fetch sites, selectMany clones lazily, and
the tests move to a setupGallery helper with a typed deferred.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L
Add an `emulatorjs.default_cores` block mapping a platform slug to the
core the player preselects for it, so an instance can run DS software on
DeSmuME and DSi software on melonDS without every user picking a core on
every device.
The player resolves its core from the game's remembered core, then the
platform's, then the configured default, then the platform's first
supported core. Each candidate is checked against the cores the platform
actually supports, so an unknown platform or core falls through.
Playing no longer writes the resolved core back to local storage unless
the user picked a different one, so changing the configured default
reaches devices that never made a choice.
Closes#4434
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code-review pass fixes: a re-triggered select-all re-arms the pending
epoch instead of no-opping; the loaded-only fallback waits for the
metadata bootstrap; deselections made during the fetch survive the
merge; fetches are refused off the gallery view and on empty results;
the Missing tab clears the selection on unmount; Esc cancels an
in-flight select-all even before anything is selected; hot-path scans
short-circuit on count and read through toRaw; the sidecar-skip flags
and page size get one home; failures reach the console. Six new tests
pin the races.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L
Simplify pass: aria-expanded now exists exactly when the chip is a real
toggle (a copy chip stays a plain button even after a failed copy left
the value revealed, since nothing can collapse it), and the revealed
disclosure drops its aria-label so the content, label plus full value,
becomes the accessible name. The hide-full-hash key that decision
orphans is removed from every locale, and the ARIA tests consolidate
to three cases decoupled from the i18n mock's serialization.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L
Code-review pass fixes: cs/pl/ru copy-hash now use the imperfective
form their sibling copy actions use, hu drops the definite article the
other action labels omit, and a test pins that a click after a failed
copy keeps copying while the chip stays disclosed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L
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
Hash chips read as plain buttons to screen readers: no aria-expanded,
and the accessible name was the abbreviated hash text. The button now
carries aria-expanded whenever it actually behaves as a disclosure
(reveal mode, or a copy whose failure disclosed the value) and an
aria-label that names the action and the hash kind, translated in
every locale.
Fixes#4105
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L
Covers the useStageActive watcher and installStageActiveClass directly:
running transitions mirror into the store and onto <html>, both reset
when the owning scope is disposed, and the playing flag alone never
hides the chrome (Stream's loading phase relies on that).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ND1wfNV3vKwu8Mfinn4WkA
A set with no .cue files listed every rom file as a swap target, so an
uploaded manual could be offered as a disc, and the manual-swap hint
counted media toward the multi-disc check.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Trim the category comments to the one fact the code cannot carry, keep
isBootableFile module-private now that bootableFiles is its only caller,
and build the disc stubs from a typed factory instead of inline literals
with per-field casts.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Since 5.0.0 the fixed v2 nav chrome (logo, user menu, tab bar) painted
over the EmulatorJS UI on phones: the running stage's z-index traps the
emulator's own layers below the nav, the iOS fullscreen shim's
nav-hiding selectors only matched v1 classes, and EmulatorJS's corner
menu button sat flush against rounded screen corners while overlapping
the virtual R shoulder button. Touches on the virtual gamepad's empty
zones also synthesized mouse events that ghost-opened the emulator
menu between the A and B buttons (EmulatorJS/EmulatorJS#1221).
Players now mirror their running stage into a stageActive store flag
(PlayerShell owns it for Ruffle/JsDos/Pico8; EmulatorJS and Stream
wire their own): AppLayout unmounts AppNav/BottomNav while it is set
and mirrors it onto <html>, where global.css zeroes --r-nav-h and
--r-bottom-nav-h so stages, dialogs, menus, and toasts reclaim the
space through the tokens they already consume. The flag is deliberately
separate from `playing`, which also spans Stream's loading phase while
the config screen still needs the nav, and stays unset in the admin
Desktop view. A stage-scoped touchstart guard cancels empty-zone
touches, and the menu button gets corner margin plus a 44px target.
Fixes#4081
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ND1wfNV3vKwu8Mfinn4WkA
The capture handler consumes every modifier click on the card, so the
shift branch in onCheckboxClick could no longer run.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The selector hid a rom's media, but the remembered choice was still
validated against the full file list, so an id stored before the filter
existed was restored and booted.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`path_cover_large` and friends arrive as `.../cover/big.png?ts=<updated_at>`,
so the end-anchored `/\.(png|jpe?g)$/` never matched one and no v2 surface
rewrote a real cover URL even with the flag read correctly. v1's regex is
unanchored by accident, which is why it worked there.
Give the rewrite one home in `useWebpSupport`, matching the extension at the
end of the path rather than of the URL, and have the three copies use it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A folder rom's uploaded manual, screenshot, soundtrack, patch or cheat is
one of `rom.files`, so a file sorting before the game file was what Play
defaulted to and what the file selector offered first. None of them is
something a core can boot.
Filter them out of both the default and the selector, falling back to the
full list so a rom that is nothing but media still has something to offer.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The card's root is a `router-link`, and vue-router's own click handler
runs before a parent-supplied one, bailing only on an event that is
already prevented. So while the gallery was in selection mode, clicking
a card toggled it and then navigated to the game page anyway, dropping
the selection built up so far.
Move the selection gesture into the capture phase, which already ran
there for modifier clicks.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`useWebpSupport` looked for `FRONTEND.IMAGES_WEBP`, which the backend
never emits, so `supportsWebp` was always false and every v2 surface
requested the original PNG while v1 served the converted webp. v1 reads
`TASKS.ENABLE_SCHEDULED_CONVERT_IMAGES_TO_WEBP`, the flag for the task
that writes those files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
HowLongToBeat times were only readable one game at a time, on a game's
detail page. This makes main-story length a property of the library:
* `generated_hltb_main_story` (migration 0128) is a STORED generated
column over `hltb_metadata`, indexed, so the sort walks an index and
the range filter composes into SQL.
* `GET /roms` takes `hltb_main_story_min` / `hltb_main_story_max` in
seconds, either side optional, and `order_by=hltb_main_story`.
* The v2 gallery gets a sortable Length column in list mode and a
game-length range (in hours) in the filter drawer, both surviving a
bookmark via `?lengthMin` / `?lengthMax` and savable as a smart
collection.
A rom HowLongToBeat has no time for derives NULL, so either comparison
drops it; the drawer says so rather than letting it read as a bug.
Closes#4232
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KAn4d3drsdnEKeVuvkMNpU
Comment and docstring pass over the `released_days` change: cut the copies of
rationale that already live next to the thing they describe, and drop the
sentences defending obvious choices.
`RELEASED_DAY_REGEX` now carries the calendar ranges, so a match is a valid day
and `parse_released_days` needs no sentinel pair and no second range check.
`release_day_ranges` stops re-sorting what `epoch_ms_in_ranges` already sorts.
`anniversaryQuery`'s return type is a named export, so the widget imports it
instead of unwrapping a `ReturnType`, and the widget's two reset paths share
`showEmptyDay`.
`loadMore` is `loadNextPage`, since it appends one page rather than the rest.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`GET /api/roms` already does what `/roms/anniversaries` hand-rolled: it selects
ordered ids over the filtered set, takes the total from that index, hydrates
only the page asked for, and re-projects the rows into id order. So the widget
now asks it for a page rather than owning an endpoint that pulls the whole day.
`released_days` on the list endpoint takes days as "M-D", matching any year, and
`released_before_year` bounds them. Both go through `filter_roms`, so the same
day-of-year match is available to the gallery filters and to smart-collection
criteria, and the range union stays where it was: still sargable, still a
covering index range scan on `idx_roms_generated_first_release_date`, no SQL
date function and no dialect branching. Verified on a 73k-rom database that the
plan through the list endpoint's join is unchanged: `type=range`,
`Using where; Using index`, no filesort.
The filter means exactly what it says, so the calendar policy moved to the
client, where the clock it depends on already lived. `anniversaryQuery` picks
the days and the year bound off the viewer's own date: it skips 1 January,
where several providers park year-only metadata, rolls 29 February onto 28
February in a non-leap year, and bounds the years at the viewer's own. The
server no longer has to second-guess a timezone offset, so the 31 December
asked for on 1 January UTC correction is gone rather than fixed.
Consequences for the widget: the counter is the day's real total instead of one
clipped at a 500-row ceiling that no longer exists, and a card costs one page
of 24 rather than up to 4 MB up front. Paging backwards stays in memory;
only moving past the loaded pages fetches, with the spinner on the arrow so
focus is never yanked mid-page. A failed page keeps the card on screen.
`released_days` is added to the list endpoint's unscoped-cache gate: the
sidecar keys encode no filters, so a narrowed page must not be served under the
shared "all" key. Covered by a test that primes the unscoped key first.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The day's ordering breaks ties on the rom id. Every rom released on the
same calendar day carries the same timestamp, so without it the paging
order, and which rows the 500 ceiling keeps, varied between requests.
MariaDB plans it the same way: still a covering index range scan, no
filesort.
The widget clears the loaded day when a request fails, so the rollover
check retries it. Claiming the day up front held the error copy until
local midnight, and the card offers no way to ask again.
Also pins the clock in `test_defaults_to_todays_utc_date`, which failed
on 1 January and raised on 29 February; corrects the Czech 2-4 plural
form, which the locale's own rule reaches; and drops "scope" from the
endpoint docstring, where it read as a claim about the auth scope
declared right above it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The PICO-8 modules sat beside the view they serve, while every other v2
helper lives in v2/utils, player ones included (playerBezel, playerDisc,
playerFirmware).
scriptLoader moves with them: pico8Runtime imports it, and nothing in
v2/utils reaches into v2/views, so leaving it behind would have been the
first exception. EmulatorJS and JsDos pick it up from the new path.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The player gathered keyboard, gamepad, on-screen and mouse state inline, so
the bit tables, the btnp edge detection and the pad polling all sat in the
SFC with no way to test them. pico8Input owns that state and hands back the
per-frame snapshot; the view keeps only DOM plumbing, which drops its script
block by 92 lines.
The mouse scaling takes an offset and the canvas size rather than an event,
so the clamping is exercised without a DOM. 23 tests cover the edge
detection, the dead zone, the #3851 phantom-pad guard, the pointer-button
masks and the reset a replay depends on.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Audio ran on the main thread and rebuilt the graph every frame: an AudioBuffer
and a one-shot AudioBufferSourceNode per frame, roughly 18k nodes and 80MB of
garbage per ten minutes of play. A single AudioWorkletNode now drains a ring
buffer on the audio thread, so playback survives a stalled main thread. The
route gets no COOP/COEP, so samples cross by transfer rather than through a
SharedArrayBuffer, and the worklet hands each buffer straight back for the
player to refill: 231 posts and 231 recycles over a four-second cart, so
steady-state playback allocates nothing. The runtime fills a caller-owned
buffer instead of returning a fresh slice, which drops the last copy.
Frame pacing moves to pico8Pacer, and audio scheduling to pico8Audio, so the
two pieces most likely to be wrong are unit-testable without a component. Both
had no coverage while the wasm bindings did; they now have 19 tests between
them, including the catch-up cap and the buffer recycling.
useGamepad keeps the knowledge about raw pad state, so export isUsablePad,
PAD_BUTTON and AXIS_THRESHOLD rather than restating them here. The button
index map is now keyed by name, with the event-detail lookup derived from it.
Vite inlines assets under 4KB as data: URIs, which addModule cannot be relied
on to accept, so the worklet is pinned to a real file.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Another element taking pointer capture mid-press left the cartridge with a
stuck mouse button, and a FAKE-08 build with ABORTING_MALLOC disabled would
hand back a null pointer we wrote through.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
isPico8Rom read fs_extension, which holds only "png" for a .p8.png cart:
the backend builds multi-part extensions from letter-only segments and "p8"
has a digit. So no cartridge stored that way offered a play action. Read the
file name instead, and assert against the values the scanner really writes.
Size the screen from the row it sits in rather than from vmin, so the square
plus the on-screen controls always fit: the stage overflowed on shorter
viewports and centred overflow clipped it at the top and the bottom at once.
Keep the controls clear of the bottom tab bar, which overlays that corner on
sm-and-down.
Move the stage chrome into a bottom-right stack of icon-only buttons, a
fullscreen toggle over exit, via a new PlayerShell `stage-actions` slot. The
other players keep the shell's own quit button.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fetch EmulatorJS, Ruffle, js-dos and FAKE-08 in the dev Dockerfile, on the
same pins and checksums as the emulator stage of docker/Dockerfile, into
/opt/romm/emulators. The ./frontend bind mount hides anything the build
writes under /app/frontend, so entrypoint.sh links each runtime into the
assets tree the dev server serves, leaving names held by checked-in art
alone. The runtime directories join the dev watcher's ignore list so
chokidar does not crawl them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cut the comment that compared the pixel loop to the byte-store version it
replaced, and the two three-line notes on the runtime fetch and the script
loader, keeping only what a reader cannot recover from the code.
Rename padButtonMap, padAxisMap and mouseButtonMap to *Bits: they are pair
lists of masks, not records like keyboardMap next to them.
Give the test's fake canvas context a real ImageData return so it fails if
the runtime starts reading width or height, and drop the imports that
change orphaned.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The canvas, the control group and the four d-pad buttons shipped English
aria-labels and tooltips. The parity check cannot see a key that was never
added, so nothing caught them.
The face buttons keep A and B as their own accessible name: those are the
canonical PICO-8 button names and are not translated.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>