Commit Graph

5157 Commits

Author SHA1 Message Date
Georges-Antoine Assi
cd32850da7 Merge pull request #4579 from rommapp/claude/v2-launch-path-followup
fix(v2): close the launch-path gaps found by the pr-ready gauntlet
2026-09-17 08:43:08 -04:00
Zurdi
fb7c36015f Merge pull request #4578 from rommapp/claude/v2-mobile-detail-subtabs
feat(v2): phone-friendly tabs, subtabs and patch picker in game details
2026-09-17 14:41:16 +02:00
Georges-Antoine Assi
a3b534a1c3 chore(v2): address the review comments on the launch path
Condense the comments that ran past two lines, and build the launch
intent fixtures from typed factories again rather than bare literals.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 08:36:53 -04:00
zurdi
64ce5f7a30 fix(v2): address Greptile and Copilot review on the mobile subtabs
Reveal the selected tab whenever RTabNav's strip resizes, not only when it first appears, so a narrower strip can't leave it under the fade. Move the "or" divider label to common.or (every locale, with a real Japanese translation) for the patcher and the v2 login; v1 keeps login.or. Fold SubtabNav's header comment into a one-line doc on its variant prop.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 14:34:15 +02:00
zurdi
67103cc306 chore(v2): review-polish pass on the mobile subtabs
pr-ready step 4 (review-polish): give RDropzone's optional props explicit defaults so Trunk's require-default-prop stays quiet on the touched file, and drop an em-dash from the SaveDataTab header.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 14:18:51 +02:00
Georges-Antoine Assi
fdb4cb5e82 chore(v2): trim the launch-path comments and mount the nginx map in dev
The dev container mounts frontend/ alone, so the vite plugin that now
reads the nginx template could not find it and the dev server refused to
start. Mount the template directory read-only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 08:18:21 -04:00
Georges-Antoine Assi
8ecb4dd0c5 refactor(v2): fold the cleanup pass findings into the launch path
The dev server now parses the isolated URLs out of the nginx template
instead of restating them, and refuses a template that yields none.

js-dos skips the runtime preload on the leg it is about to reload away,
records its play session on pagehide, and takes the relaunch marker from
the composable that defines it.

Also drops a redundant parameter and a duplicated derivation from
applyLaunchIntent, collapses the repeated id checks in isLaunchIntent,
gives the js-dos asset bases one home, and trims the comments.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 08:18:20 -04:00
Georges-Antoine Assi
0ccda23164 fix(v2): keep the save flush and the js-dos isolation on the launch path
A full navigation out of the player aborts the route change, so the leave
guards below the view never run and the v1 player's pending save was lost.
`usePlayerExit` now settles the departing document first, and EmulatorJS
asks the v1 `Player` for its flush there.

js-dos reached its view by SPA navigation without cross-origin isolation,
although the DOSBox-X backend is a threaded build and nginx has always
isolated its URL. It now relaunches into an isolated document the way
EmulatorJS does, so the view still opens without a page load.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 08:18:20 -04:00
Georges-Antoine Assi
3eadc4c33c fix(v2): apply the code review fixes to the launch path
Replace the player entry when leaving by SPA navigation, keep a failed
js-dos runtime load from stacking a second stylesheet, and answer the
player URLs from `vite preview` as well as the dev server.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 08:18:20 -04:00
zurdi
f4de539045 refactor(v2): simplify the mobile subtab plumbing
pr-ready step 3 (simplify): SubtabNav takes the caller's item type so notes ride on their picker items, groups and item-append stay menu-only, MediaTab derives its panel ref types and switches on the subtab, RTabNav merges its re-measure watchers, the patch either-or clears from the select's own event, and the "or" divider style moves into RDivider.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 14:09:33 +02:00
zurdi
fb02ca3836 fix(v2): address code-review findings on the mobile subtabs
pr-ready step 2 (code-review xhigh --fix): restore the pill gap and a zero min-width on RTabNav, keep chevron clicks from stealing focus, scroll a keyboard-focused tab clear of the fade, paint the subtab focus ring inside the button, and cover SubtabNav and the patch either-or rule with tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 14:00:03 +02:00
Zurdi
8bcf72df7d Merge pull request #4567 from rommapp/claude/v2-spa-launch-view
feat(v2): open the EmulatorJS and js-dos launch views without a page load
2026-09-17 13:49:01 +02:00
zurdi
a94367ac5d feat(v2): move the Patcher tab next to Metadata
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 13:45:03 +02:00
zurdi
9421d78d5b feat(v2): pick a patch from the ROM or the device without a mode toggle
The Library/Upload switch is gone: the bundled-patch select sits above a compact dropzone, picking either clears the other, and the uploaded file stacks over the hidden dropzone so the panel never changes size. RDropzone gains a single-row compact variant.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 13:45:01 +02:00
zurdi
d634695e97 fix(v2): align the Screenshots upload with the other media subtabs
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 13:44:59 +02:00
zurdi
d71654cc5f feat(v2): collapse detail subtabs and notes into a picker on phones
Media, Files, Save data and Notes share SubtabNav: the side rail on wide layouts, and on phones a single trigger row opening a bottom sheet (grouped for notes, searchable past eight entries). A subtab's single Upload joins that row, and the walkthrough URL form wraps instead of overflowing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 13:44:56 +02:00
zurdi
3590bc2de8 feat(v2): fade and chevron the overflowing edges of RTabNav
A horizontal strip that scrolls now fades whichever edge clips tabs and shows a chevron there, and scrolls the active tab into view, so a phone-width tab bar no longer looks like it ends at the screen edge.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 13:44:54 +02:00
zurdi
c1e6ce5424 fix(v2): describe RSelect info from a node outside aria-hidden
The field's aria-describedby pointed at the info well, which was marked
aria-hidden, so assistive technology could drop the description. The info
text now lives in its own hidden node that the field references, and the
well is no longer aria-hidden since its default content is decorative
already.

Also cover the info tooltip reveal: keyboard and pad focus open it, mouse
focus does not, and blur or opening the menu closes it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 12:37:05 +02:00
zurdi
4101aba964 fix(v2): fold select notes into info wells and unwrap scan settings copy
The memory card and scan media notes sat as loose hints under their
select; both now live in the select's info well. Scan settings section
descriptions were capped at 680px and wrapped early on wide screens; they
now take the section width and only wrap when it runs out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 11:48:35 +02:00
zurdi
393e8bd08c feat(v2): lead slot pickers with a new slot and default uploads to autosave
Both slot pickers, in the save upload dialog and the EmulatorJS player,
list "+ New slot" first behind a divider. A save upload now starts on
autosave, with No slot moved to the end, matching the slot grouping in the
save list. The player's slot info moves from a loose button into the
select's info well.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 11:48:35 +02:00
zurdi
0d738e3435 feat(v2): upload into a folder from All files through a grouped picker
All files has no destination of its own, so its header now offers only
"Upload to folder", styled like Upload, and folder subtabs keep only
Upload. The destination picker leads with "New folder" set apart by a
divider, defaults to Root, and shows each folder with its subtab icon.

RSelect gains `dividerAfter` for grouped menus, plus an `#append-label`
well mirroring the inline prefix label, which `info` fills with an info
icon and tooltip read as the field's description.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 11:48:35 +02:00
zurdi
5849a27786 fix(v2): move the soundtrack and manual upload into a section header
The Soundtrack and Manual subtabs put Upload in a full-width button under
their viewer, unlike the Files, Screenshots and Save data tabs, which host
it in a header above the content. Both now use that header, with Upload
pushed to the right next to the manual entry selector when there is one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZ7NE6z9cJ8zsT3TsCtQds
2026-09-17 11:48:34 +02:00
zurdi
5497ee9edb chore(v2): trim the launch-path comments and factor the test fixtures
Comments down to the fact a reader cannot recover from the code, and the save,
state and firmware fixtures behind one factory each rather than a cast per
literal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1VFUvsR5wYK3axxR1gebc
2026-09-17 05:53:30 +02:00
zurdi
6bf6ed25d2 refactor(v2): fold the cleanup pass findings into the launch path
- The stream player restated the stop pair `useActivityPresence.stop()` now
  owns, so it calls it.
- The dev server's isolation list and the nginx map it mirrors are checked
  against each other by a test, rather than by a comment asking whoever edits
  one to remember the other.
- One case covers the js-dos runtime being injected once, whichever side of the
  first load a second view mounts on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1VFUvsR5wYK3axxR1gebc
2026-09-17 05:44:52 +02:00
zurdi
8d4e856360 fix(v2): close the gaps the code review found in the player launch path
Findings from the review pass over the SPA launch change, plus the two bot
reviews on the PR.

Correctness:
- Presence stops were addressed to the device, not to a rom, so a view that
  never announced anything could clear what another tab was playing. A stop now
  needs a started session, and happens once; `useActivityPresence` grows the
  `stop()` the two call sites were spelling out by hand.
- The EmulatorJS exit read `window.EJS_emulator`, which a departure taken while
  the loader was still injecting would not see yet, so the runtime could be left
  in a document a later launch then failed to load into. It tracks the injection
  itself.
- js-dos resolved its asset base per view: a second launch in a document whose
  runtime came from the CDN looked for the payloads locally. Two views mounting
  at once could also both inject the runtime. Both now go through one
  document-level loader, which resolves with the base it served from and lets a
  later mount retry a failed load.
- A blocked sessionStorage threw while every EmulatorJS view was initialising.
  Storage that cannot be read is an absent intent, and one that cannot be
  written cancels the relaunch rather than losing the selection to it.
- Outside a secure context the headers cannot expose SharedArrayBuffer, so the
  reload only delayed the same error by a round trip. It is refused up front.
- The dev server mirrored one of the two nginx isolation entries, leaving the
  console player unisolated there.

Reuse and cover:
- `usePlayerExit` owns the whole rule again: `departing` moved in, so both views
  use `guard` rather than one of them restating it, and the `leaving` flag it
  never needed is gone.
- Resolving an intent back into a selection is a pure pair in `launchIntent.ts`
  with its own tests, rather than closures the view kept to itself.
- The Vite plugin is a script beside `precompress`, so the regexes that have to
  track nginx are tested.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1VFUvsR5wYK3axxR1gebc
2026-09-17 05:33:30 +02:00
Sam Dornan
c9d0b0da12 fix(v2): stop the unhandled rejection when a view transition is preempted (#4570)
* fix(v2): absorb the skipped transition preemption rejects

Activating a game card starts a shared-element morph, and navigating
inside it starts the router's own view transition. The browser skips the
older of two overlapping transitions, rejecting its `ready` promise with
an AbortError that nothing consumed, so it surfaced as an unhandled
rejection on every forward card activation. Back navigation preempts the
same way in the other order: the router's transition starts first and the
back-morph skips it.

Absorb the skip at both leaking sites, in the transition plugin wrapper
(only `captured` is awaited) and in `morphTransition` (only `finished` is
consumed). Both transitions are still created and one still animates, so
the morph behaviour is unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(v2): absorb the preemption skip at every transition site

The router's wrapper absorbed the AbortError a preempted transition
rejects `ready` with, but the two transitions the v2 morph code starts
directly did not. Move the handling into one exported helper used at all
three sites, so the back-morph preempted by a navigation during its
capture phase no longer leaks an unhandled rejection.

The helper rethrows any reason that is not an AbortError, so a genuine
transition failure stays visible instead of being swallowed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(v2): share the view transition test fixtures

Both transition test files carried their own copy of the
startViewTransition stub, and the unhandled-rejection probe was inlined
in one and rebuilt in the other. Move them to src/test-utils, next to
serverError, so there is one stub to keep in step with the API.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(v2): drive the back-morph guard through a real router

The fake router and route fixtures needed `as unknown as` casts, which
the v2 component rules prohibit. A memory-history router gives the guard
real route objects instead, so the test drops the casts and exercises the
registration it actually ships with.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 22:27:06 -05:00
Sam Dornan
3efe5a1758 fix(v2): stop probing platform icon variants that cannot exist (#4573)
* fix(v2): stop probing platform icon variants that cannot exist

The /assets/platforms catalogue is keyed by RomM's canonical platform
slug, and two probes worked against that:

- prefetchPlatformIcons fetched only `<slug>.svg`, but 114 of the 199
  catalogue entries ship `.ico` with no `.svg`, so every ico-only
  platform in the library 404'd on every app load, on every page, since
  AppLayout prefetches the whole platform store.
- RPlatformIcon tried `fsSlug` before `slug`. The filesystem slug is the
  on-disk folder name, which for Batocera/ES-DE libraries is an alias
  (`dreamcast`, `megadrive`, `pcengine`) with no asset, so each of those
  burned two 404s per icon render before the canonical slug resolved.

Neither broke rendering, since both chains terminate at default.ico, so
this removes wasted requests only: 94 of the 138 folders in
PLATFORM_FS_ALIASES have an asset under the canonical slug alone and
none have one under the folder name alone.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(v2): tighten platform icon test typing and trim comments

The prefetch tests faked `blob()` with `{ type } as Blob`; a real `Blob`
carries the same `type` and drops the cast. The chain helper took a
`Record<string, unknown>` prop bag, which could not catch a mistyped prop
name.

Comment blocks over two lines carry the same fact in one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(v2): keep probing candidates when a prefetch fetch fails

A rejected fetch threw past the candidate loop to the outer catch, so a
transport failure on `.svg` abandoned the `.ico` that would have warmed
the cache. Each candidate now fails on its own.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 22:22:09 -05:00
Sam Dornan
f77ef4c40e fix(v2): invoke the view transition callback once (#4574)
`startViewTransition` ran its callback twice whenever
`document.startViewTransition` exists: once eagerly at the top of the
function, to build the fallback promises, and again inside the native
update callback. The only caller today is the router's `beforeResolve`
guard, which passes no callback, so the double run was dormant.

The eager call is gone from the native path. The fallback path still
invokes the callback itself, and still resolves `captured` immediately:
nothing is snapshotted without the API, and the guard awaits that promise
to know navigation may proceed, so making it wait would buy nothing. On
the native path `captured` still resolves from inside the update
callback, so a caller awaiting it still learns the old state was
captured.

Tests cover the callback running once on the native path, once when a
native transition is preempted, and once on the no-API path with all four
promises resolving.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 22:13:21 -05:00
Sam Dornan
70c9b9f364 fix(v2): line the placeholder rows up with the rows they stand in for (#4561)
* fix(v2): line the placeholder rows up with the rows they stand in for

The Home card rows painted a fixed number of skeletons (6, 6 and 4) while
their requests ask for up to 15, so the loading row was shorter than the
row it turned into. They now size themselves from RECOMMENDED_ROMS_LIMIT,
RECENT_ROMS_LIMIT and RECENT_PLAYED_ROMS_LIMIT, the way v1's
RecentAddedSkeleton already did.

List mode has two placeholder rows: the bootstrap GameListSkeletonRow, and
GameListRow's own skeleton path for a row that mounts before its position
resolves. The second painted the 48x64 cover placeholder inside the title
cell and a thin bar in the cover column, so for the second before
hydration a cover-shaped block sat where the title text starts. It now
paints the same per-column shapes as the bootstrap row.

The list header's select-all checkbox is a stretched grid child carrying a
4px margin, which put its tick 6px left of the body rows' ticks, centred
in the same column.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(v2): cover all three Home loading rows and read the real limits

The mock listed the three ROM limits by hand, so the assertion compared
the view against a second copy of those numbers instead of the numbers
themselves. It keeps the real module's exports now and stubs only the
feed request. Only the recommendation row was asserted, though the other
two changed the same way, so the count check is a table over all three.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(v2): stop the loading rows lying about their height and their count

Three placeholder defects, all only visible while a row is loading.

The recommended row's cards carry a caption under the title, and the
placeholder skipped it, so the row sat 24px shorter until the data landed.
Its placeholder now reserves that line.

Nineteen of those 24 were the caption. The other five were the label: its
reserved height was a class rule, which loses to the inline height the
skeleton bar has to carry, so the reservation never applied and every
skeleton card stood 5px short of the card replacing it. The reservation
moves to a wrapper that has no inline height of its own, and the bar keeps
its own thickness.

Rows also showed a count of 0 for as long as their list was in flight and
then jumped to the real number. The count chip now stays off until the
count means something.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* style(v2): trim the placeholder-row comments to their invariants

Each of these ran to three lines or more, and spent them on the approach not
taken. What is left is the fact a reader cannot get from the code: the two
placeholder rows share a column grid, the label wrapper owns the line box its
bar cannot, the count stays off until its list lands, and sizing goes through
props (and the default `inheritAttrs`) so a skeleton can swap for a real card
without moving anything.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* style(v2): finish the comment pass on the placeholder rows

Drop the skeleton comment's third line in GameListRow, and take the em-dash out
of GameCardSkeleton's header.

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

* style(v2): name both rows in the parity comment

"Both" only resolves if the reader already has the two mounts below it in view;
the comment now says which two rows share the column grid.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 21:23:33 -05:00
Georges-Antoine Assi
d13fca5ea3 Merge pull request #4563 from rommapp/claude/loving-golick-0d269c
fix(v2): stop the layout's min-height leaking into the gallery shell
2026-09-16 21:36:39 -04:00
Georges-Antoine Assi
d16aa85968 Merge branch 'master' into streaming-patches-3
AssetList moved its timestamp into <AssetTimestamp> and gained
groupBySlot on master, so the picker's `timestamp` prop now feeds the
component's date and both props coexist. The "updated" | "created" type
and its accessor join Asset's other shared helpers in v2/utils/assets,
where AssetPreview takes them too, since the old local name collided
with the AssetTimestamp component.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 19:12:34 -04:00
zurdi
3f67e0b74a feat(v2): open the EmulatorJS and js-dos launch views without a page load
Play navigated to the EmulatorJS and js-dos launch views with a full document
load, because only a directly loaded player URL carries the COOP/COEP headers
nginx attaches to it, and only a cross-origin isolated document exposes the
SharedArrayBuffer that threaded cores need. Every launch paid that reload,
while only three cores (dosbox_pure, ppsspp, azahar) need threads, and js-dos
8.4.1 does not reference SharedArrayBuffer at all.

Both views are now reached by SPA navigation with the cover morph, like the
PICO-8 and Ruffle views. When a threaded core is booted without
SharedArrayBuffer, useIsolatedLaunch keeps the pre-play selection in
sessionStorage and reloads the view into the isolated document, where it
boots straight away; a second miss reports the insecure context instead of
looping. Adding a threaded core is one entry in areThreadsRequiredForEJSCore;
another player that needs isolation uses the same composable.

Leaving a player view is a full navigation whenever the document is isolated,
since the rest of the app cannot embed third-party images under that policy
(provider covers in Match ROM, see #4522), and whenever the EmulatorJS runtime
was injected, which declares globals a second injection would clash with.
usePlayerExit holds that rule for both views; js-dos also injects its runtime
once per document. EmulatorJS closes the play session on pagehide as well,
since the full navigation unmounts nothing.

The Vite dev server mirrors the nginx header map for the player URLs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1VFUvsR5wYK3axxR1gebc
2026-09-17 00:03:48 +02:00
Sam Dornan
b661e76d67 fix(v2): stop the layout's min-height leaking into the gallery shell
AppLayout and GalleryShell both used `.r-v2-shell`. Vue copies a parent
scope id onto a child component's root element, so AppLayout's
`min-height: 100dvh` matched the gallery `<section>` and beat its
`height: calc(100dvh - var(--r-nav-h))`, leaving the section a full
viewport tall. Since `<main>` already reserves `--r-nav-h`, every gallery
route overflowed the document by 58px, with the bottom of the virtual
scroller below the fold.

Rename the layout block to `r-v2-app-shell` so the two cannot collide,
matching the unique blocks already used by SettingsLayout and IndexShell.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 16:38:19 -05:00
zurdi
b6d5cfcb40 fix(v2): keep a shelved game's Play a button and pass non-primary clicks through
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
2026-09-16 23:19:50 +02:00
zurdi
d0be75b841 feat(v2): make the player back links and the details Play button real links
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
2026-09-16 22:37:16 +02:00
Zurdi
fdeff24f2d Merge pull request #4558 from rommapp/claude/ejs-auto-save-sync
feat(player): sync in-game saves seconds after the game writes them
2026-09-16 22:14:04 +02:00
zurdi
0d73d2ff30 chore(v2): drop em dashes from two comments and unstale the resume story
The ResumePanel story mirrored the launch view's label with the
condition the view no longer has, so its empty-state cases showed the
layout this branch fixes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
2026-09-16 21:14:56 +02:00
zurdi
e5e5f00b77 fix(player): flush on Quit, drop stale unload bytes, test the SRAM poll
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
2026-09-16 21:09:21 +02:00
zurdi
2d374990f4 feat(player): boot from the latest progress of either kind
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
2026-09-16 20:52:50 +02:00
zurdi
21185aab22 style(player): dress the in-game sync toasts like the v2 toast
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
2026-09-16 20:40:41 +02:00
zurdi
efccb6743b feat(player): keep a pending save when the tab closes
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
2026-09-16 20:33:53 +02:00
zurdi
0019750559 feat(player): poll the SRAM every second and flush a pending save on exit
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
2026-09-16 20:15:56 +02:00
zurdi
24cd55abe5 feat(player): sync in-game saves seconds after the game writes them
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
2026-09-16 19:34:39 +02:00
zurdi
6a95b0c285 fix(v2): share the group head between the saves and states lists
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
2026-09-16 19:20:37 +02:00
zurdi
42f27f1b86 fix(v2): jukebox in the settings sidebar, launch-view titles, match overlay
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>
2026-09-16 19:02:34 +02:00
Zurdi
1444b0454a Merge pull request #4550 from rommapp/claude/unify-rom-file-uploads
chore(uploads): manual file uploads into a ROM across the Files and Media tabs
2026-09-16 17:18:37 +02:00
zurdi
e869ecb6b6 Enforce media allowlists and walkthrough provenance in the shared upload path
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>
2026-09-16 16:27:38 +02:00
zurdi
be81b1c89b refactor(tasks): apply the simplify pass
`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
2026-09-16 16:16:00 +02:00
zurdi
dafccf55fd Ask before replacing a file the ROM folder already holds
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>
2026-09-16 16:13:34 +02:00
zurdi
83569d6678 fix(tasks): read older cleanup stats, and check the worker where it enqueues
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
2026-09-16 15:57:59 +02:00