A modified click on the launch anchor skipped play(), which is where the
protected-launch confirmation lives, so a retired or never-playing game
could reach its player page without the prompt. useGameActions now
exposes needsLaunchConfirm and GameActionBtn renders a button instead of
an anchor while it holds, so every launch of a shelved game confirms.
The anchor also leaves non-primary clicks to the browser, matching the
other v2 link handlers.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
The pre-play view's "Back to game details" and "Back to gallery" buttons
and the Play / Stream CTAs in the game details header were JS-only
buttons, so they could not be middle-clicked or opened in a new tab.
usePlayerNav now hands out route locations that RBtn renders as
RouterLinks, and GameActionBtn renders the launch actions as anchors to
the player document when the surface is not itself a link. A plain click
still runs through play(), keeping the protected-launch confirmation and
the full-document load EmulatorJS and js-dos need.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
Quit cleared the sync sentinel before routing away, so the route guard
that flushes a pending save found nothing to own and skipped it; Quit
now flushes first. A close cancelled at the prompt kept the bytes it
captured, which a later close could upload over newer progress; each
beforeunload starts clean. The unload upload also stands down while
the same bytes are already on the wire, beforeunload sets returnValue
for older browsers, and a boot that lands after unmount installs
nothing. The poll moves to pollSaveFiles in utils, covered with fake
timers.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
The launch screen armed the newest compatible state whenever one
existed, even when a save was newer. It now picks whichever of the
newest save and the newest compatible state is later, with a state
winning a tie since it restores the SRAM too. The newer-progress
warning shares that choice.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
EmulatorJS' message element takes the v2 toast's glass panel (tokens
with v1 theme fallbacks), a tone-tinted icon instead of a solid colored
bar, sentence case, and a short fade in and out. The "synced with
server" messages read as successes.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
The browser cancels requests in flight on unload, so a save the tick has
not uploaded goes out on pagehide through fetch with keepalive, which
outlives the document but is capped at 64 KB. While a save is pending,
beforeunload shows the leave prompt, the only way to keep a save above
that cap, and runs ahead of EmulatorJS' own unload handler so a
cancelled close keeps the game running.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
The core has no write hook for its SRAM, so the sync polls it every
second (scaled up past 1 MB to bound the copy-and-compare cost) instead
of every five. Leaving the player through Quit or a back navigation
uploads a save the tick has not caught up with yet, through a route
guard that waits for the upload.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
The periodic save upload only ran on EmulatorJS' "System Save interval"
tick (5 minutes by default, never when the player disabled it), and was
off unless emulatorjs.auto_save_sync was set. The player now flushes the
SRAM itself every 5 seconds while the game runs, so the existing tracker
sees a new in-game save on the next two agreeing ticks and uploads it,
and the config flag defaults to on.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
Extract AssetGroupHead, used by AssetList (slots) and AssetStrip
(cores), so the Save data subtabs line up: same icon, title, count and
band, with the fold chevron's space reserved on the static saves head.
The list's 4px vertical gutter now applies only to its scroll variant,
which is where the hover lift could clip.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
Add the Jukebox entry to the settings sidebar's Tools group, above
Controller debug, so the in-page navigator mirrors the user menu.
Keep the "All saves" / "All states" title rendered when the list is
empty. In the split states layout both columns subgrid their title and
content rows, so a missing title dropped the empty box into the title
row and pushed the resume preview far down the panel.
Anchor the match dialog's saving overlay to the dialog body instead of
an inner wrapper, so the blur reaches the body's padding edges, and
lighten its tint from 65% to 30% of the background color.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Treat every disc descriptor as a disc, not just .cue
playlist_files keyed on .cue alone, so a Dreamcast .gdi set, a CloneCD
.ccd set and an Alcohol .mds set all fell through to "every file is a
disc" -- the descriptor and the raw tracks it cannot boot without were
listed side by side.
The three readers of the rule each got that wrong in their own way: the
playlist shipped inside the download zip named non-bootable tracks, and
the in-browser disc swapper offered them as discs.
Key on a set of descriptor extensions instead, so no one sheet format is
privileged over the others. The shape is unchanged -- descriptors if any,
else everything -- and so is the download zip, which lists every file
regardless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Keep a disc that stands on its own beside a descriptor
Selecting descriptors and discarding everything else assumed a multi-file
ROM is all one format. It is not: a .chd sitting beside a .gdi boots on
its own, and returning only the .gdi dropped it from the playlist and
from the swapper's targets.
Exclude the raw tracks a sheet points at instead of keeping only sheets.
The tracks are still not discs, so every case the previous commit fixed
stays fixed, and a disc no sheet describes now survives.
This also settles the same bug on the .cue path, which predates this
branch: disc1.cue + disc1.bin + disc2.chd used to list the cue alone.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Count a sheet's audio tracks as tracks
A .cue names its CDDA tracks the same way it names its data track, so a
.wav or .flac beside one is data, not a disc. The playlist listed them.
Brings the list in step with the shell's own in src/main/discs/m3u.ts,
which has carried the audio formats since it was written.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
ruff ASYNC110 flags a while loop whose body is only an await sleep. The
wait is now a bounded poll that gives up with a TimeoutError once the
lock expiry has elapsed, so a stuck holder cannot hang the upload.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
redis-py releases its Lock through a Lua script, which the fakeredis CI
runs without, so every registration failed there with an unknown evalsha
command. The lock is now a SET NX EX with an owner token, released only
by its owner, the same shape the log forwarder already uses.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A folder the scanner maps to a media category now refuses files that
category cannot hold inside resolve_upload_destination, so the chunked
flow the v2 tabs use gets the same allowlist the media routes had, and
those routes drop their own copies. commit_upload records an upload
provenance for walkthrough files that arrive without one and returns the
registered row, which the walkthrough route uses for author and title.
The refresh lock moves to Redis so uploads landing on different gunicorn
workers cannot drop each other rows. An empty body filename is rejected
instead of falling back to the header.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`has_live_worker` asks RQ for the worker count and the suspension flag,
two constant-cost reads, instead of hydrating every registered worker.
The cleanup stats serialize through `dataclasses.asdict`, so a new
counter is declared in two places rather than three. The task endpoint
test takes the shared task fixture, the legacy-stats shim says when it
can go, and the two Settings specs share one axios-error helper under
`src/test-utils` while the games spec starts from a non-empty list.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9ta8rXUTP9aMdatPYKX4K
A name the folder already has is refused by /roms/upload/start with a 409,
and the tabs used to surface that as a plain error. useRomFileUpload now
collects the refused files, asks once in a danger-toned confirm dialog and
retries them with the new optional overwrite body field, which lets the
chunked flow replace the file instead of claiming the name exclusively. A
declined file is dropped without a toast. The strings ship in all locales.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Follow-up to #4548 from the code-review pass. Stats a 5.2.0 release
stored under `platform_id` are widened to `platform_ids` when a job is
reported, so listing old finished cleanups validates again. The live
worker check moves next to the queues as `has_live_worker`, with its
own tests, and the endpoint names the queue it enqueues on so the check
and the enqueue cannot drift apart. The cleanup tasks return the typed
stats the response schemas declare. The developer setup points the RQ
commands at the backend's own Redis settings through `-c config`, and
the architecture doc mentions the 503.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9ta8rXUTP9aMdatPYKX4K
The Files tab streamed chunks through /roms/upload/* and registered the
result with the scanner listing, while each Media route (soundtracks,
screenshots, manual files, walkthrough files) carried its own copy of the
sanitize, promote, mkdir, stream, stat and DB upsert sequence. Those copies
crashed with FileNotFoundError on a file name outside Latin-1: the browser
sends the header as Latin-1 and the multipart field name as UTF-8, so the
parser target registered under the header name never received the part
and os.stat failed after the folder had been created.
handler/rom_upload.py now owns the shared ingestion (resolve and prepare
the destination, stage next to the target, move into place, refresh the
ROM's file rows through the scanner) and both the chunked completion and a
new receive_rom_file sit on it. The media routes only check the extension
and delegate; a body naming the part differently is a 400. /start gains an
optional body filename that wins over the header, so names outside Latin-1
arrive intact, and rom_id becomes optional in that body.
On the v2 frontend a single useRomFileUpload composable wraps the chunked
upload, the single-file conversion prompt, the toasts and the refetch; the
Files tab, Soundtrack panel, Screenshots subtab, Walkthrough subtab and the
manual "add to ROM folder" target all call it with their folder. The
service sends the real name in the body and a percent-encoded one in the
header. The v2-only uploadScreenshots/uploadWalkthroughFiles service
functions and the soundtrack-only toasts are gone. Media subtabs now
refuse an existing file name (409) like the Files tab, instead of
overwriting it silently.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X1FgnCzXjM3rzkxggi7g6C
The worker guard now ignores workers that announced their death or are
suspended, and the tests run with a live worker on the task queue by
default, so the other successful-run tests pass again; a scan-only,
dead or suspended worker is checked to be refused. The developer setup
runs each worker in its own terminal, adds the RQ cron process that
registers the schedule, and ties the Redis URL to the `.env` defaults.
The Japanese, Korean and Chinese cleanup messages use their own
punctuation, and both Settings sections have a test that the server's
reason reaches the error snackbar.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9ta8rXUTP9aMdatPYKX4K
A reviewer who can't see a UI change reviews the diff instead of the
result, and a boundary change described in prose takes several reads.
Ask for both in the PR body: enough screenshots to convey what changed,
and a mermaid block when the change moves a boundary.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`GET /tasks/status` failed response validation once a missing-ROMs
cleanup had run: the task reports `platform_ids` while the schema
still declared `platform_id`, and the missing-firmware cleanup had no
schema at all. Both shapes are declared now, the generated types follow,
and the task-by-id test checks a finished job of each kind.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9ta8rXUTP9aMdatPYKX4K
Review follow-ups on #4527. `settings.cleanup-all` is shared with the
missing-firmware controls, so the "Delete all missing games" wording moves
to its own key and the shared one goes back to "Clean up all". The rows on
this tab point at files that are gone, so the bar's download can only 404:
hide it behind a `hideDownload` prop.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The player and console callbacks now share `resolveStateScreenshot`
(live canvas first, EmulatorJS's picture as the fallback) and the
console builds its multipart body through `buildStateFormData`, so the
utils spec can check what reaches the upload: the screenshot named
after the state, no screenshot part without a picture, and the
fallback order.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Resolves the conflicts with the save-slot work: `buildSaveName` is gone
(the backend tags slotted uploads), `captureStateScreenshot` stays next
to `buildStateName`, and the utils spec keeps both the saveSave cases
from master and the capture cases from this branch.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A task run with no RQ worker sat queued forever while the UI reported
it queued and later refreshed as if it had run. The endpoint now
answers 503 with the reason, the Settings sections show that reason
instead of the axios wrapper, and the developer setup documents how to
start the workers. The delete-ROM dialog's filesystem warning gets its
bottom padding above the footer, and the cleanup-queued message loses
its em dash in every locale.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
One "Latest" tile per core even when timestamps tie, tracked by the
first asset holding the newest timestamp; the list layout keeps the
timestamp last on a fixed width so its right edge lines up whatever the
owner chip's width; AssetActions forwards attributes through a contents
wrapper; the stale list-layout comment describes the current pieces.
AssetChips, AssetTimestamp, the grouped strip and AssetActions get
their own specs.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The selected-state box-shadow stacked a flush 0 0 0 2px ring on top of
the outline, both drawing a border. Hovering happened to hide the
extra ring (the hover rule replaces box-shadow wholesale), so the
double border only appeared once hover ended while still selected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
State tiles now lift and highlight on hover like the save rows, and
neither does so in the Save data tab: the entrance animation released
its transform so the lift shows, and static tiles keep a flat hover.
Clearing a picked state leaves nothing picked again; the save it
displaced no longer comes back. The Save data tab's four copies of the
per-item buttons collapse into one AssetActions composite.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
State cards take the save rows' 1px border tokens: the plain border at
rest, the strong one on hover and the brand one with a tinted fill when
selected, in place of the invisible-until-hovered ring and its shadow.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The hover and selection ring moves from the screenshot to the tile, so
a picked state is outlined as one card, body included. The thumbnail
and the body round their outer corners inside the ring, and list rows
stay flat.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The screenshot and the tinted body no longer have a gap between them:
the thumbnail rounds only its top corners, the body only its bottom
ones, and the tile stacks them edge to edge.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The facts and the action buttons under a state's screenshot sat on a
fully transparent area and read as loose text. They now share a soft
translucent panel with the card's radius, so the card reads as one
piece. The list layout keeps its flat rows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Saves and states now describe themselves the same way: an AssetChips
row (newest-in-group tag, emulator tag, file size chip with its icon)
and an AssetTimestamp block (relative time over the exact moment). The
save rows keep their columns and the state tiles keep their stack; the
tiles gain the Latest tag within a core group and hide the emulator tag
there, since the group already names it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>