* feat(player): play RPG Maker 2000/2003 games in the browser with EasyRPG
Embed the EasyRPG web player for extracted game folders on the rpg-maker
platform. The backend generates the player's index.json from the scanned
files and merges in the free EasyRPG RTP under every name the official
and fan RTPs give its assets, so games that lean on the RTP find them.
In-game saves sync with the user's RomM saves through the player's
IndexedDB storage.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(easyrpg): read the free RTP from a fixed path instead of an env var
The full image always keeps the RTP at /var/www/html/assets/easyrpg/rtp,
so the path is a constant beside the web path nginx serves it under. The
dev container links its copy there at startup.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(easyrpg): code-review fixes for the save sync and asset endpoint
- Wait for an in-flight push before the quit push, so the newest save uploads
- Keep Play disabled until the fresh rom (and its saves) is fetched
- Stop onPlay and the rom fetch from acting after the view unmounts
- Leave through usePlayerExit like the other players
- Handle a rejected IDB commit when the run itself fails
- Track uploads by the browser's file name
- Load only visibility and files per asset request, not the full rom
- Serve DEV_MODE files as octet-stream, matching nginx
- Make the traversal test actually reach the endpoint
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(easyrpg): simplify pass over the player and asset endpoint
- Load only file paths per asset request, and look up RTP folders in O(1)
- Reuse RomFile.file_name_for_download and usePlayerFullscreen
- Share one dev/prod serve helper for game and RTP files
- Derive the save sync's game key from the rom
- Have the RTP table tool reuse normalize_name
- Make save-module internals private and tidy the prepare/read loops
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(easyrpg): flag RPG Maker game folders on the rom schemas
Gallery lists carry no files, so the frontend guessed that every multi-file
rom on the rpg-maker platform was playable, including RPG Maker XP/VX/MV
folders. Rom now has a deferred `is_easyrpg_game` subquery (an RPG_RT.ldb at
the folder root), loaded with the other gallery file stats and derived from
loaded files on the with_files path, and the frontend reads it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(easyrpg): drop server save sync, keep saves per user in the browser
Server sync moves to a follow-up that puts the web players on device sync.
Saves now stay in the player's IndexedDB, as js-dos does, with the same note
on the start page. The player is launched as `<rom id>-<user id>` so each
RomM account sharing a browser profile keeps its own saves; nginx and Vite
drop the user id when routing to the backend.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(easyrpg): address Greptile review
- Start timing the play session once the player page loads
- Use object-form props in the view test's button mock
- Keep the RTP table tool's docstring to one sentence
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(easyrpg): keep the RTP table in a fixtures folder
Matches handler/metadata/fixtures, where the other bundled data files live.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Use VueUse for v2's rAF loops, listener pairs and grid observers
Hand-managed requestAnimationFrame loops in useGamepad, usePlaybackTime,
useRightStickScroll, ControllerDebug and RBox3D move to useRafFn, and
the listener pairs and MutationObservers in useGridNav, useWrapGridNav,
RBox3D and useGamepad's connect listener move to useEventListener and
useMutationObserver. Each stops with its scope, so the matching cancel,
remove and disconnect calls in unmount hooks go. The grid composables
still register from onMounted, keeping listener order unchanged.
ControllerDebug pauses its loop before leaving on hold-B. RBox3D's root
listeners now bind once its template ref settles, a microtask after
mount, instead of synchronously in onMounted.
Adds tests for usePlaybackTime, useRightStickScroll, ControllerDebug and
RBox3D, the late-cell autofocus of both grid composables, and
useGamepad's unmount. They also pass against the previous versions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep ControllerDebug polling past a back that goes nowhere
Hold-to-exit paused the frame loop before calling router.back(), so in a
tab opened straight onto /controller-debug the back did nothing and the
inspector froze. The loop now keeps running and fires once per hold, and
with no history entry to return to it goes home instead.
The useGamepad, useRightStickScroll and ControllerDebug tests build pads
from a shared, fully typed gamepad fixture rather than casting partial
objects to Gamepad.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Copy over plain HTTP and skip task polling in hidden tabs
useClipboard now falls back to execCommand("copy") when the Clipboard
API is missing (any insecure origin, such as a LAN install served over
HTTP) or its write rejects. The fallback checks execCommand's result, so
a copy that fails still shows the error toast, and it hands focus back
to the trigger for spatial and grid nav. VueUse's useClipboard legacy
mode was considered and rejected because it reports success even when
execCommand fails.
TasksSection skips its 5s status poll while the tab is hidden and
fetches once when it becomes visible, matching Home and Activity.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy
* Keep only the newest task status and tidy clipboard fallback
The tasks store now applies a status response only if no newer request
started after it, so an older poll can't overwrite the result of a
visibility refetch or a run-button refresh that finished first.
The clipboard fallback focuses its textarea before selecting it, which
some engines need for execCommand("copy"), and the useClipboard and
HashChip docs now describe the fallback. Drops a comment that compared
the fallback with VueUse's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy
* Keep an older task status when a newer request fails
The status guard now tracks successes and failures separately: a
success applies unless a newer success already has, and a failure
clears the list only when no newer request has started. An older
success that settles after a newer failure is applied instead of
dropped.
Moves the typed task status builder to utils/tasks.fixtures.ts so the
store and TasksSection tests share it instead of casting literals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy
* Keep the last known task status when the newest request fails
Only the newest status request may write the list, and a failure no
longer clears it. Clearing showed nothing running and re-enabled run
buttons, and applying an older success after a newer failure showed a
pre-run snapshot as current. Keeping the last known statuses avoids
both, since the newest request has no state to offer when it fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy
* Shorten the clipboard and task status comments
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(converto): integrate rom-converto for title id extraction and download conversion
* feat(converto): add conversion settings UI with per-platform format policies
* fix(converto): read conversion targets from the backend and translate the settings page
* fix(docker): ship rom-converto in the production image
Only the dev Dockerfile installed the binary, so the integration could
never enable on a released image. Fetch the same pinned, checksummed
musl build in a dedicated stage and copy it next to RAHasher.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(converto): skip the update check and batch info calls
The CLI asks api.github.com for a newer release on every run unless
told not to, so pass --no-update-check on each invocation. Inspect a
rom's files in one `info --paths-file` run instead of one subprocess
per file, and read the inspectable extensions from the capabilities
manifest so scans skip files info cannot recognize.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(scan): keep sigil authoritative for title ids
rom-converto ran first and overrode the ids sigil read. Sigil now runs
first and records its per-file ids; rom-converto only fills files sigil
left unset, on new or changed files, in one batch. Restore the base-id
selection for sigil extractions on every platform, as on master.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(downloads): make conversion opt-in and bound the cache
The download endpoint returned a converted file to every client once a
platform had a target, including the browser player and apps that check
hashes against RomFile. Conversion now needs ?converted=true.
A pre-warmed copy is served whatever its size; the in-request size cap
only gates starting a conversion. ROM_CONVERTO_CACHE_MAX_SIZE_GB
(default 20, 0 unbounded) caps the cache: conversions and the pre-warm
task stop when it is full, and cleanup evicts the least recently served
copies.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(types): regenerate frontend types for the converto schema
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(converto): address code-review findings (pr-ready step 2)
- Fall back to rom-converto's stored ids only when it ran this pass, in
disc order, so a rescan that skipped extraction keeps sigil's save target
- Persist per-file title ids that extraction writes onto reused rows
- Only authenticated callers may start an in-request conversion; past a
240s deadline serve the original and let the conversion finish into the
cache instead of nginx returning 504
- Treat a probe OSError or timeout as a failed probe; kill the subprocess
when the caller is cancelled
- Give the pre-warm task the scan timeout and report progress in the
ConversionStats shape the task UI reads
- Reuse zip_cache constants, walk the cache off the event loop, tolerate
files vanishing mid-cleanup, and trim long comments
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): simplify conversion code (pr-ready step 3)
- Move the converted-download policy (target lookup, cached-first, sync
size cap, deadline) from the endpoint into utils/conversion_cache and
share conversion_target with the pre-warm task
- Share one path lookup between get_cached_converted and get_or_convert;
the pre-warm walks the cache once and tracks a running byte budget
instead of walking it twice per rom
- One normalize_platform_formats beside TARGETS_BY_PLATFORM for the
config loader (via _validated_platform_map) and the settings endpoint;
update_converto_settings takes a ConvertoConfig and is written back
with dataclasses.asdict
- read_infos owns its never-raise contract, so the scan drops its blanket
except; drop the unused RomConvertoInfo.kind and error attributes
- Sort files for the rom-converto identity only when it is used; stat
each cached file once during cleanup
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(converto): trim comments (pr-ready step 4)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): convert on first download instead of pre-warming
A library pre-warm fought the TTL: cleanup dropped every copy nobody
downloaded within a day. Remove the Convert library task and convert on
demand only. Files over ROM_CONVERTO_MAX_SYNC_SIZE_MB now start their
conversion in the background while the original is served, so the next
download within the TTL gets the converted copy at any size.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): drop decrypt and encrypt download targets
Downloads now only change a rom's container or compression (CHD, RVZ,
CSO, NSZ, ...); serving decrypted files is left for a separate decision.
NDS and PS3 have no remaining targets. Also note that the conversion
concurrency limit applies per process.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): move the cache limits into converto.*
cache_max_size_gb and max_sync_size_mb join cache_ttl_hours in
config.yml and PUT /api/config/converto_settings, replacing the
ROM_CONVERTO_CACHE_MAX_SIZE_GB and ROM_CONVERTO_MAX_SYNC_SIZE_MB env
vars, so every eviction knob is edited in one place at runtime. The
loader takes its defaults from ConvertoConfig and one table holds each
integer's minimum for both the loader and the payload.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): lock conversions with flock instead of a sentinel
A conversion now holds a non-blocking flock on its key dir, which the
kernel releases if the worker dies. That replaces the .partial sentinel,
its 6-hour staleness guess (which a long ROM_CONVERTO_TIMEOUT could
outlive), and the rename-aside takeover. Cleanup skips locked dirs, and
partial output gets a hidden name so it never counts as a served copy.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(converto): parametrize repeated test cases
Collapse the per-platform info parsing, operation resolution and
converto_active cases into parametrized tests, so a new platform or
target is one row.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(scan): run rom-converto first with sigil as the fallback
rom-converto reads each rom's new or changed files first, in one batch,
and its title ids win. sigil still reads what it can, since it alone
provides save targets and Switch content types, and fills the ids
rom-converto left unset.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(converto): edit the cache size limits on the settings page
* feat(converto): store per-file metadata read by rom-converto during scans
* fix(converto): show the labels of the cache settings fields
* fix(scan): keep the stored save target when sigil reads nothing
* fix(converto): read Xbox 360 disc ids and Wii title versions, store content type as text
* feat(converto): save file icons, banners and backgrounds read by rom-converto
* chore(converto): bump rom-converto to v0.23.0
* fix(converto): address review findings in the conversion cache, scan metadata and settings
* refactor(converto): move per-file metadata out of the conversion PR
Scan-time metadata (title ids, the 17 rom_files columns, artwork and
converto.scan_metadata) moves to its own PR so its columns land with the
UI that reads them. This PR keeps conversion only.
The conversion cache no longer has uncompressed_size_bytes to budget
with, so a conversion to an uncompressed target reserves a fixed
multiple of its input and the cleanup pass after it evicts any overshoot.
Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ
* feat(converto): let the client pick the download format with ?format=
`?format=zso,iso` lists the formats a client can read. The stored file is
served whenever its format is listed, even with conversion off, so most
emulator clients never trigger a conversion. Otherwise the first listed
format with a cached copy is served, then the first one rom-converto can
produce.
A conversion that outlasts a short wait answers 202 with Retry-After
instead of falling back to the original, so a URL never serves two
different files and a client never gets bytes it can't read. 406 means
no listed format can be served. HEAD reports the same without starting
a conversion. This replaces `?converted=true`, the per-platform download
target and `max_sync_size_mb`; `cache_ttl_hours` stays config.yml-only.
Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ
* feat(converto): convert the library in place with a manual task
`converto.platform_formats` now names the format a platform's library is
stored in, and the new "Convert library" task brings every matched rom
to it. Each output is staged in a `.romm_tmp_` directory beside the
original, moved into place, and only then are the originals (and a cue's
tracks) deleted. Single-file roms take the new name, folder roms keep
theirs and get their .m3u entries rewritten, and the file rows refresh,
so a rom keeps its id, saves and collections.
Only lossless conversions qualify, so xbox (xiso trims the dump) has no
library format. Unmatched roms are skipped because a converted file no
longer hash-matches a DAT. `/api/config` now carries the library targets
and, per input extension, the formats a download can be converted to.
Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ
* feat(converto): library format settings and "Download as" on the game page
The settings page follows the reworked backend: per-platform formats are
now the library format the "Convert library" task stores matched games
in ("Leave as is" keeps a platform untouched), the scan metadata, cache
TTL and max-sync fields are gone, and a "Convert library now" button
starts the task behind a typed confirmation, since it deletes the
originals.
The game's More menu offers "Download as <format>" for a single-file rom
when download conversion is on, from the per-extension table
`/api/config` exposes. A one-byte ranged GET asks for the format, the UI
polls through 202s while it converts, then downloads it; a 406 shows an
error.
Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ
* fix(converto): address code-review findings (pr-ready step 2)
Guard the conversion settings route, add it to the user menu, ignore a
non-positive Retry-After, drop duplicate Download as clicks, name the game
in the persisted error, and tidy the settings page (display-name sort,
useUnloadGuard, decimal cache sizes, save snapshot).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(settings): share the config alerts and save bar (pr-ready step 3)
Extract ConfigFileAlerts and SettingsSaveBar from the three settings
views that copied them, move ScanSettings onto useUnloadGuard, align the
retry slot, and flatten downloadFormats, getDownloadFormats and the
format poll loop.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(converto): trim comments (pr-ready step 4)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(converto): guard destructive tasks and serve download formats per rom
- TaskSpec gains destructive and single_instance. The Tasks list asks for a
typed confirmation before a destructive task, and POST /tasks/run answers
409 while a single-instance task is queued or running.
- convert_library is both, and only runnable with ROM_CONVERTO_ENABLED.
- The heartbeat reports CONVERTO.ENABLED, which hides Conversion settings
from the sidebar and user menu and warns on the page.
- DetailedRomSchema.download_formats lists what the caller can convert the
rom's single file to, resolved by the backend's own operation table and
empty for visitors who can't start a conversion. It replaces
CONVERTO_DOWNLOAD_FORMATS in /api/config and the frontend's copy of the
extension matching.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Yukine <devyukine@gmx.de>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: DevYukine <20647088+DevYukine@users.noreply.github.com>
Repair comments where the em-dash sweep left broken pairs, colon plus
conjunction joins, and misaligned column lists. Block filesystem: in the
pairing callback check, route both Pair views through the shared
errorMessage() helper, and drop the SfcNode comments field the removed
rule used.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
isCustomScheme only rejected http and https, so a javascript: or data:
callback passed the check and ran in the RomM origin with the freshly
exchanged token. Share one check between the v1 and v2 Pair views and
block javascript:, data:, vbscript:, blob: and file: too (CodeQL
js/xss and js/client-side-unvalidated-url-redirection).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The mame2003 core bundled with EmulatorJS 4.2.x crashes with
"RuntimeError: unreachable" on many games (EmulatorJS#1030), while
mame2003_plus runs them. A core chosen on the play screen or set in
config.yml default_cores still wins.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replace the em-dashes in frontend comments outside the frozen v1 UI
(script, template and style comments, plus the header build-tokens.ts
writes into tokens.css), then drop the rule. String literals keep their
em-dash glyphs. The AGENTS.md rule stays, and pr-ready's humanizer pass
catches new ones in prose.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RyamrxVw5BzEidVzm68LY7
* chore(deps): bump vue-router to 5.3.1 and vue to 3.5.43
vue-router 5 needs vue ^3.5.34. The runtime API RomM uses is unchanged:
typecheck, the unit suite and the production build pass without code
changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* fix(v2): stop URL query writes from dropping history entries
Query-only router.replace calls resolved against currentRoute, which is
still the page being left while a navigation waits on async guards (the
view-transition capture, the ROM fetch in /rom/:id's beforeEnter). A
write landing in that window cancelled a pending push, so the click was
swallowed, or, on Back/Forward, replaceState'd the entry the browser had
already moved to with the old page's URL, deleting it from history.
patchQuery now binds each write to the path it was made on, waits for an
in-flight navigation to settle (tracked by installQueryNavigationGuard,
installed in AppLayout) and drops the write if the navigation left that
page. The gallery filter sync, the platform, collection, admin, library
management and notification tabs, and the notes selection now write
through it, and the gallery's debounced write is cancelled on unmount.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* style(v2): replace em-dashes in comments of files this PR touches
trunk check reports every no-emdash-in-comment hit in a modified file,
not only on changed lines. Comment text only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* fix(v2): rewrite a ?subtab= the details tab can't show
GameDetails swaps currentRom before a rom-to-rom navigation commits, so a
tab that resets its subtab for the new game writes into the pending
navigation and that write is dropped. The URL then kept a subtab the new
game doesn't have. useSubtabQuery now rewrites an invalid ?subtab= to the
subtab on screen on mount and after every path change, which also fixes
stale deep links.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* refactor(v2): key the details ROM by the route's :rom param
GameDetails read a single currentRom slot that the route guards filled
before the navigation committed, so the page being left briefly
rendered the next game under its own URL, and anything reacting to that
wrote into a navigation still in flight.
stores/roms now keeps a bounded, id-keyed cache of DetailedRoms.
setCurrentRom and update() feed it, so the shared /rom/:rom guard and
every SimpleRom write keep it current, and v1 keeps reading currentRom
unchanged. v2 reads through useRouteRom(), which looks the record up by
the committed route's :rom param: a guard can prefetch the next game
without the current page seeing it. The dialogs, useRomSync, the scan
and pending-asset refreshes, FilesTab and the player seeds all go
through the cache or the route id. useSubtabQuery's rewrite is narrowed
to stale links, the case it still covers.
Also replaces em-dashes in comments of the files this touches, which
trunk check flags per modified file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* style(v2): sort useRomScanRefresh imports for trunk's prettier
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* fix(v2): keep the shown game cached through a burst of rom hops (code-review)
Each superseded rom-to-rom navigation still cached its game, so ten
quick hops could evict the record the committed page renders and blank
it until the last hop landed. Re-cache the shown game before the next.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* refactor(v2): simplify the query-write and ROM cache plumbing (simplify)
- routeQuery: track the in-flight navigation as a single marker and
schedule one flush per router instead of a waiter queue; add
replaceQuery for whole-query writes and route Logs through it, so no
v2 query writer bypasses the guard.
- Tab, subtab and gallery-filter writers use syncQueryParam, which only
writes keys that changed.
- useSubtabQuery shares one owned-subtab helper and drops the route.path
trigger the id-keyed cache made redundant.
- The ROM cache holds 3 records (nothing reads it to skip a fetch) with a
single-step eviction; GameDetails re-caches the shown game via
useRouteRom; FilesTab uses refetchRom's result; Stream parses :rom
with romIdFromRoute.
- Trim comments to the two-line rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* style(v2): trim the roms.update merge comment (review-polish)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* style(v2): tidy comment grammar left by the em-dash pass (humanizer)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* fix(v2): address review findings on query writes and the ROM cache
- syncQueryParam compares against the queued write, so a control
switched back before the first write lands still gets written.
- Only the tracked navigation (or an untracked duplicate) settles the
query guard, so an older navigation aborting after a newer one
started can't release writes into it.
- roms.reset() (run on logout) clears the detailed ROM cache, and
deleting a game drops its record once the page has moved off it.
- Shared makeDetailedRom fixture beside makeRom; the CollectionsIndex
mock carries a route path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* fix(v2): settle query writes only for the tracked redirect chain
- A duplicate navigation settles the query guard only when it began as
the tracked navigation (a guard redirect back onto this page, followed
through redirect chains via redirectedFrom). An unrelated duplicate no
longer releases a held write while the tracked navigation is pending;
that navigation settles itself when vue-router cancels it.
- DeleteRomDialog logs a failed post-delete redirect instead of
reporting the delete as failed, and keeps the record of a game the
page still shows so an aborted redirect can't blank it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
* style(v2): drop the routeQuery header paragraph the guard docs already cover
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CB3a8xbmnmuMeddGnRgVse
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- Keep a shared thumbnail in place when its new name resolves to the same
file, so a case-only rename on a case-insensitive filesystem no longer
fails with a conflict trying to copy the thumbnail onto itself.
- Build the user in the collection dialog tests with a typed userFixture
instead of casting a partial object.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rename_file links then unlinks, so a name another worker took after the
check is refused instead of replaced; filesystems without hard links fall
back to rename.
- rename_asset owns the whole rename: the thumbnail and asset rows commit
in one transaction, and a failed commit moves the files back.
- A thumbnail another save or state still resolves is copied for the
renamed asset instead of moved away from the other one.
- Collection Apply and the visibility switch wait for each other.
- The collection settings test builds its fixture with a typed factory,
the RSwitch label-slot story uses a colour token, and the moved assets
fixture keeps a one-line docstring.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Event log: watch the scroller's own container and web font loads through
vueuse, re-measure only for a font the rows use, and keep the measurers
when only the width changes.
- Measure each word once on one shared canvas, and stop counting lines at
the clamp.
- Set the row geometry once on the list, from one source for the padding
and gap, instead of on every row.
- Share the file-and-size detail between downloads and player loads, read
the collection cover change off the saved data, and use recorded_events()
in the play-session test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ROM, file or bulk download is recorded once per caller within ten
minutes, and only when a transfer starts from the first byte, so range
requests and retries don't multiply it. In-browser players mark their
fetch with purpose=play, and the session they report becomes a rom.play
event instead. Feeds and QR links still count as downloads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The save and state test fixtures cast partial literals to SaveSchema and
StateSchema, hiding missing required fields from vue-tsc. saveFixture and
stateFixture fill every required field, and each test's own helper now
only sets what it cares about.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`getDownloadPath` encoded a selected file name but left `fs_name` raw,
then `getDownloadLink` ran `encodeURI` over the whole result. Three
things went wrong:
- a selected file name came back double-encoded, so the browser saved
`Game%20(USA).zip` instead of `Game (USA).zip`
- `encodeURI` also hit the query string, so `file_ids=29%2C30` reached
the backend as one value and `int()` raised on it: copying a link for
a multi-file selection produced a 500
- a raw `#` in `fs_name` started the fragment, truncating the path
before the request left the browser
Encode the segment once in `getDownloadPath` for both branches and let
`getDownloadLink` only prepend the origin.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
review-polish pass.
Both `src/utils` test files built the same rom literal, so move the typed
factory into `rom.fixtures.ts` and import it from each. Tighten two comments
that had grown past the two-line limit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
simplify pass.
`v2/router/routes.ts` hand-maintained 34 route-name string literals and a
comment saying ROUTES could not be imported without a cycle. `routeNames.ts`
is a leaf, so that constraint is gone: key the registry off ROUTES and type
it with the new `RouteName`, which turns a mistyped key into a compile error
instead of a silent fall-through to the 404 view.
Drop the unreachable chunk-load guard in the 401 interceptor: `main.ts`
imports the router statically, so it is in the entry chunk and the dynamic
import resolves from memory. Restate why that import is lazy.
Take `SimpleRom` instead of re-narrowing it, reuse the import specifier
already in `router.ts`, drop `circular: true` (already the default), and
inline the test roms so the factory is not duplicated across two files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
code-review pass.
dpdm cannot parse Vue SFCs, so the four entry points only reached 133 of
the frontend's modules: every `.vue` import was an unresolved dead end and
traversal stopped there. Make every `.ts` module an entry instead, which
brings the analysed graph to 771 modules. Frozen v1 `src/console` is carved
out because it still holds cycles we are not refactoring.
Take `ROUTES` and `isAuthExemptRoute` from the leaf module statically, and
keep only the router instance lazy. Guard the dynamic import so a failed
chunk load still rejects with the original AxiosError.
Move the `getDownloadPath` tests next to the module that now owns them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
v2's EmulatorJS player reached into the frozen v1 tree for
installIOSFullscreenShim. The v1 implementation hides app chrome via
Vuetify selectors (.v-app-bar, .v-bottom-navigation, .v-navigation-drawer),
which match nothing in v2: that UI uses no Vuetify, and the player already
unmounts AppNav/BottomNav through useStageActive. The nav-hiding half was
silently inert on iOS in v2.
Fork the shim to src/v2/utils/playerFullscreen.ts with the nav handling
dropped and the hardcoded black swapped for --r-color-canvas-bg, per the
v2 zero-hex-literal policy. The v1 export is marked @deprecated rather
than changed, as the v2 constitution prescribes for coexistence forks.
Adds the test coverage the shim never had.
Also removes src/utils/indexdb-monitor.ts, which has had no importer in
either UI.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Uo885XxwhN8wfC4oCtR48
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>
Add v2 browser playback for .p8 and .p8.png cartridges, backed by the
FAKE-08 WebAssembly runtime, with canvas rendering, audio, fullscreen and
keyboard, gamepad, mouse and touch input. Wires up platform detection,
play actions, routing, localization, gallery navigation, play-session
tracking and lifecycle cleanup.
The runtime is fetched in the emulator stage of docker/Dockerfile, pinned
by source commit and verified with sha256, so it is provisioned the same
way as EmulatorJS, Ruffle and js-dos rather than committed to the repo.
DISABLE_PICO8 gates the player, matching the existing DISABLE_EMULATOR_JS,
DISABLE_RUFFLE_RS and DISABLE_JSDOS toggles.
Based on #4383.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Renumber the two migrations onto master's head: 0108/0109 collided with
0108_roms_primary_region and 0109_rom_files_category_index, leaving the
chain with two heads. They are now 0114 and 0115 behind 0113.
Both rebuild the roms_facets sync triggers from a hardcoded column list,
so add the publishers and developers columns 0112 introduced. Without
them the rebuilt triggers would have silently stopped mirroring the two.
Adopt master's provider taxonomy. METADATA_PROVIDER_GROUPS now carries
demozoo, pouet, and csdb as catalogs, which replaces the branch's own
GENERAL_PROVIDER_KEYS set and feeds the setup wizard, the scan dialog,
and Settings from one registry. CSDb reaches the scan explainer for the
first time; it was already selectable there.
Regenerate the frontend types: DetailedRomSchema was missing the three
metadata blobs the backend has always declared on RomSchema, and the
blobs are now typed rather than Record<string, unknown>.
Correct the setup strings that still called the three sources enabled by
default, and sort the locale keys.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Security review follow-ups on the Demozoo, Pouet, and CSDb handlers.
Default the three sources to off, matching every other provider. They
were the only ones defaulting to on, so an upgrade began contacting
demozoo.org, pouet.net, and csdb.dk on the next scan with no operator
opt-in, reachable through the unauthenticated metadata heartbeat.
Guard the bare id conversion in scene_id_or_none. str.isdigit() accepts
superscripts and other digits int() rejects, so a pasted "²" raised out
of the Edit ROM endpoint as a 500.
Filter the remote demozoo_url through http_url(). It was the only one of
the three URL fields taking a string from the API rather than building
one from a hardcoded template and an integer id.
Match a YouTube id against an explicit ASCII class. isalnum() is
Unicode-aware, so it accepted ids the embed URL never can.
Stream the CSDb response against a byte budget. The cap ran after the
whole body was already buffered, so it bounded the parse but not memory.
Catch defusedxml's refusals. EntitiesForbidden derives from ValueError
and ParseError from SyntaxError, so the existing handler caught neither
and an entity-declaring document raised out of production_from_xml.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Quality pass over the jukebox feature: extract helpers the diff had
duplicated, collapse copy-pasted template blocks, and remove wasted work
on paths that run per render or per keystroke.
Reuse:
- share shuffled() from utils instead of two Fisher-Yates copies
- add v2/utils/errorMessage.ts and v2/utils/jukebox.ts so the mode list
has one owner instead of three hand-maintained copies
- game_cover_url reuses MusicTrackSchema.cover_url_for
Simplification:
- launch tiles and the session-mode ternary become data-driven
- drop unused order options from the music service and the unreachable
romId fallback in deleteSoundtrack
- extract buildPlayerPayload() from its two call sites
Efficiency:
- count music tracks over a single-column projection
- group tracks with push instead of rebuilding each bucket array
- precompute track rows so the list stops rescanning per render
- page the catalog and the panel's two fetches in parallel
- update a favorite in place rather than rebuilding three arrays
- debounce the search URL write alongside the fetch
Also adds freeRadio tests and fixes a vue-tsc error on route.query.game.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review-polish pass: cut the js-dos docstrings and the CDN-base comment back to
the non-obvious fact, drop JSDOS_BUNDLE_EXTENSION now that it has one call site
whose meaning is plain, and remove a redundant Partial<SimpleRom> cast from the
new fixture helper.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
js-dos boots exactly one format. Its `url` option runs the file through
emulators.bundleConfig(), which requires an archive carrying
`.jsdos/dosbox.conf`; handed an ordinary scanned game it panics with
"Broken bundle, .jsdos/dosbox.conf not found" and the player never starts.
Gate canPlayJsDos on the file extension so Play is offered only for files the
player can actually boot, instead of routing a win3x/win9x ROM to a dead
screen. The platform-level check is unchanged: usePlatformPlayable knows only
a slug, and a win3x platform is still playable in browser given a bundle.
Booting unbundled games would mean supplying `dosboxConf` and `initFs`
ourselves, which needs entrypoint detection and, for Win9x, a system image.
That is a feature in its own right, not a fix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
usePlatformPlayable is the platform-level twin of useCanPlay, but only the
latter learned about js-dos, so win3x/win9x games offered Play while their
platform tile showed no playable badge and sorted into the unplayable bucket.
Teach resolveEmulator about js-dos and derive `playable`/`isPlayable` from it
instead of hand-maintained OR chains.
Collapse the duplication the new backend introduced: a shared
resolvePlatformSlug in utils, a supportedBy factory for useCanPlay's three
identical computeds, one COOP/COEP nginx pattern per map, and a single
hard-navigation branch in useGameActions that reuses the canPlay useCanPlay
already returns.
In JsDos.vue, share the teardown tail between leavePlayer and onBeforeUnmount,
collapse four derivations of the route rom id into one, start the js-dos
runtime alongside the rom request rather than behind it, and hold the rom in a
shallowRef since the view only reads scalars off it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
useCanPlay had no tests of its own, and useGameActions mocks it wholesale,
so nothing exercised the has_file_on_disk gate that keeps a physical or
missing-file game from offering a Play action. Add the missing suite,
including a case per engine so the js-dos route cannot regain the gate.
Also apply trunk fmt to a js-dos case in utils/index.test.ts.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Resolve conflicts in useCanPlay and its useGameActions tests, where master
added the has_file_on_disk gate to the play checks while this branch added
the js-dos route. Keep both: js-dos also boots from the ROM file, so it gets
the same gate as EmulatorJS and Ruffle.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add the three sources to Classic and v2 settings, Scan, and Edit ROM.
Edit ROM accepts a production URL or a bare id. Metadata tab extra
links render only http(s) hrefs.
regionToEmoji mapped the bare code "as" to the Australian flag and "a" to
the Asia globe, the reverse of the REGIONS table (A=Australia, AS=Asia).
Harmless while every stored region is a full name, but reachable now that
region codes resolve more loosely.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The greptile suggestion added encodeURIComponent to the selected file
name in getDownloadPath, but the test still expected a literal space.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Multi-file roms (e.g. multi-disk Amiga games) failed to launch in the
EmulatorJS player with "Unsupported file format: ''", while single-file
roms on the same platform worked.
EmulatorJS derives the on-disk filename it writes to the emulator FS from
the last path segment of the game URL, and the core determines the disk
format from that filename's extension. getDownloadPath used the ROM-level
fs_name for that segment. For multi-file roms the rom is a folder, so
fs_name has no extension, and the core received an extension-less file.
When a single file is selected, use that file's real name (extension
included) as the content path segment instead of fs_name. The backend
already serves the correct file for a single file_ids value and only uses
the path segment for zip/m3u naming, so multi-file and no-selection cases
are unchanged.
Fixes#3746
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The EJS core mapping in frontend/src/utils/index.ts keyed the ZX
Spectrum entry as zsx instead of the canonical platform slug zxs (as defined by UniversalPlatformSlug.ZXS in backend/handler/metadata/base_handler.py).
Renaming the key to zxs restores in-browser play for ZX Spectrum.