Commit Graph

12209 Commits

Author SHA1 Message Date
zurdi
bf33b07abd feat(player): warn when the armed state is older than the latest save
The newest compatible state is still armed by default, but when a save
postdates it the resume panel shows a warning with a one-click "Boot
from save" action, so a handheld's newer in-game progress is not
silently rolled back by an older browser state. The save preview row
also shows the save's own screenshot when it has one.

Closes #4278

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XXrMndq8eYexafm6nhajLo
2026-09-15 20:07:43 +02:00
zurdi
3e63a47a9f Merge remote-tracking branch 'origin/master' into fix/ejs-save-slots 2026-09-15 19:47:47 +02:00
zurdi
f45d79d10c refactor(player): simplify save write path and slot plumbing (simplify pass)
Seed the save tracker once per boot and from the bytes just loaded
instead of re-reading the SRAM, fold the "wait for the queue, skip
unchanged bytes" sequence into one helper used by both forced writes,
and upload the state and the save in parallel on Save & Quit. The
loaded save is a plain variable, the slot fallback lives in one place,
the selection id derives from the selected asset, and the byte compare
is a plain loop.

The viewport-fit layout drives AssetList's own scrollable prop from the
lg-and-up and tall breakpoints instead of a CSS custom property, and
the fit selectors drop the redundant root modifier. The slot length is
validated by the upload endpoint from a limit on the model, and the
datetime tag helper takes its timestamp explicitly.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XXrMndq8eYexafm6nhajLo
2026-09-15 19:28:00 +02:00
zurdi
67f065ab6c fix(player): serialize save writes and align slot uploads (code-review pass)
Save writes from the periodic tick, the in-game Save button and Save &
Quit now run through one chain, so two first writes cannot both open a
version; loading a save bumps a generation that voids in-flight writes,
and byte-identical uploads are skipped since a slotted upload bypasses
the backend dedupe. Slotted uploads let the backend stamp the timestamp
and tag the screenshot with the same one, so save and screenshot match
by stem again, and a session version opened without a screenshot can
still receive one on update.

A slot-less save is no longer kept as a write target when a state is
armed, slot names are compared exactly like the backend does, the custom
slot field is capped at the column length, and an empty-string slot no
longer collides with the "new slot" sentinel. The viewport-fit layout
uses a new `tall` breakpoint token gated on `lg-and-up`, gives the hero
column a scroll fallback, and lets AssetList keep its own scroll cap via
a custom property. The slot info icon becomes a tappable button so the
tooltip also opens on touch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XXrMndq8eYexafm6nhajLo
2026-09-15 19:12:22 +02:00
Georges-Antoine Assi
4a1883e3af Merge pull request #4507 from LoneAngelFayt/streaming-patches
feat(streaming): let the launch screen pick which save to restore
2026-09-15 12:59:22 -04:00
Georges-Antoine Assi
6bd6ef5c23 test(streaming): drop the flaky slow-launch claim refresh test
The test shrinks the claim refresh and staleness windows to 0.05s and 0.2s and
races them against a 0.5s activate, so whether the refresh lands before the
read depends on scheduling. It passed and failed in alternating runs on an
unchanged tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 12:23:05 -04:00
zurdi
4a8d530ce1 fix(player): boot from the picked save and file web saves under sync slots
Picking a save on the v2 EmulatorJS launch screen never disarmed the
auto-selected newest state, and the player loads a state in preference
to a save, so the pick was ignored whenever any state existed. Selection
rules now live in a pure module: a picked save disarms the state, a
picked state keeps the bound save as the write-back target.

Web saves now follow the sync clients' slot model. New saves go to the
"autosave" slot (capped history) or the slot picked on the launch
screen; a save that already has a slot keeps it; a legacy slot-less save
stays as an archive and its progress moves to the picked slot. Each
session opens one new version in the slot and updates it on later
writes, so periodic sync does not churn the history.

The launch screen gains a slot selector with an info tooltip, the save
preview collapses to a compact row so the list gets the height, the
pre-game screen fits the viewport on desktop with only the asset list
scrolling, and the slot chip drops its redundant label.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 18:14:53 +02:00
Georges-Antoine Assi
c0001bd27d style(streaming): trim the save-picker comments and the emulator compare
review-polish pass over the save-picker change.

Two comments carried more prose than the rule allows. The emulator comparison
re-normalized a value ResolvedContainer already lowercases at resolve time,
which the sibling state resolver relies on, so it now reads the same way.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 12:09:45 -04:00
Georges-Antoine Assi
1c5255df1f refactor(streaming): resolve the picked save once and list it like a save
simplify pass over the save-picker change.

The claim validated the pick, dropped the resolved row and passed the bare id
down two layers, where hydration fetched and re-checked the same save. It now
carries the row the way the resume state and the memory card already are, so
the restorability rule has one home and the claim one lookup.

The picker holds the picked id rather than the row, so an id that is no longer
on offer falls back to the newest by construction instead of through a watch,
and the list of archives uses AssetList, the variant meant for saves, rather
than the tile strip whose thumbnail area a save never fills.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 11:58:59 -04:00
Zurdi
5294bd61b5 Merge pull request #4516 from rommapp/fix/metadata-provider-card-review
fix(v2): address review findings on the shared metadata provider card
2026-09-15 17:48:37 +02:00
zurdi15
b764db9f8a fix(v2): address review findings on the shared metadata provider card
Follow-up to #4515, merged before its review landed:

- Mark the card logo decorative (empty alt); the provider name sits
  next to it and screen readers announced each provider twice.
- Add a name-tag prop so the scan reference dialog renders provider
  names as h4 again, keeping heading navigation.
- Restore the ul/li provider collection in the setup wizard so screen
  readers keep list semantics.
- Finish the Flashpoint label normalization in the GameDetails
  provider registry and the heartbeat store scan options; the
  remaining copies live in frozen v1 files.
- Replace raw hex colors in the story's placeholder logo URLs with
  CSS color names.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-15 17:43:19 +02:00
Georges-Antoine Assi
73b7725686 fix(streaming): report only the saves the broker can restore
code-review pass over the save-picker change.

The launch screen listed every save this emulator wrote, but the broker only
restores .zip archives, so a bare save file could be named as the one about to
be restored while a much older archive actually went up. One restorable list
now feeds the panel, the tab and the picker alike.

A claim that carries a pick looks the save up by id instead of loading every
save on the ROM to scan for it, and the emulator comparison normalizes both
sides so a config value that is not already lowercase cannot silently match
nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 11:39:46 -04:00
Zurdi
52483fb0f9 Merge pull request #4515 from rommapp/refactor/metadata-provider-card
refactor(v2): unify metadata provider cards behind a shared component
2026-09-15 17:31:28 +02:00
zurdi15
4990904485 refactor(v2): unify metadata provider cards behind a shared component
The settings tiles, setup wizard step and scan reference dialog each
hand-rolled their own provider card markup and duplicated the provider
display data (names, logos, links, locale keys) three times. The
LaunchBox and Flashpoint tiles in the settings grid also showed a gap
under the footer: the tile was not a flex column, so a card stretched
by a taller sibling in its grid row left the spare space below the
footer instead of above it.

- Add the MetadataProviderCard shared composite with tile and row
  layouts, status chip, setup/caveat pills, and #description /
  #actions slots, plus a Storybook story covering both layouts.
- Add the METADATA_PROVIDER_INFO registry as the single home for
  provider display data; all three surfaces derive from it. This
  normalizes "Flashpoint Archive" -> "Flashpoint" and
  "How Long To Beat" -> "HowLongToBeat".
- Pin the tile footer to the card's bottom edge, fixing the gap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-15 17:24:29 +02:00
Georges-Antoine Assi
20d44b3bee Merge remote-tracking branch 'origin/master' into streaming-patches
# Conflicts:
#	backend/handler/streaming/states.py
2026-09-15 11:23:42 -04:00
Georges-Antoine Assi
d053767e68 Merge pull request #4469 from rommapp/claude/bump-uv-0.12.13
chore(uv): bump to 0.12.13 and make pyproject the single source for the version
2026-09-15 09:51:55 -04:00
Georges-Antoine Assi
c5071c3b42 chore(uv): trim the required-version comment to one line
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 09:45:49 -04:00
Georges-Antoine Assi
3bafae8286 Merge remote-tracking branch 'origin/master' into claude/bump-uv-0.12.13
# Conflicts:
#	docker/Dockerfile
2026-09-15 09:30:31 -04:00
Georges-Antoine Assi
827aef4221 Merge pull request #4490 from rommapp/fix/trigger-ddl-privilege-guard-3932
fix(migrations): name the fix when the server denies trigger DDL
2026-09-15 09:25:37 -04:00
Georges-Antoine Assi
78ba4c4721 fix(migrations): give the trigger-DDL probe a name no schema can hold
Trigger names are schema-wide, so the fixed probe name could name an
operator's own trigger, and DROP TRIGGER IF EXISTS would really remove it.
A fresh uuid per call makes the statement a guaranteed no-op, so the only
error it can raise is the refusal it is looking for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 09:20:54 -04:00
Georges-Antoine Assi
d74d6b27a5 Merge pull request #4480 from rommapp/claude/stale-scan-stats-meta
fix(tasks): fill the scan counters a job's stored stats predate
2026-09-15 08:36:25 -04:00
Georges-Antoine Assi
a0aba1f51d Merge pull request #4478 from LoneAngelFayt/feat/streaming-webstation
fix(streaming): prefer the emulator's own screenshot for save-state thumbnails
2026-09-15 08:35:43 -04:00
renovate[bot]
cf770354a2 chore(deps): update github actions (#4513) 2026-09-15 06:54:07 -05:00
Georges-Antoine Assi
f2291a225f Merge pull request #4472 from kylebenzo/fix/zip-rom-patching
fix(patcher): apply patches to ROMs inside ZIP archives
2026-09-15 07:47:17 -04:00
Georges-Antoine Assi
62b6a7596b docs(streaming): trim the state-screenshot comments
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 07:41:22 -04:00
Georges-Antoine Assi
ef9983fc02 refactor(streaming): one home for the PNG check, one deadline for the frame
The magic-byte test moves behind `_is_png`, so the two places that need it (the
broker body, where the answer decides whether the embedded frame is tried, and
the filesystem sink) read as one rule instead of two. Narrowing the extract
catch back to the failures a savestate archive can raise keeps a programming
error loud rather than logging it as a missing thumbnail.

The frame fetch gets its own 10s deadline: it runs while the claim is still
held and the player waits on the exit screen, and a thumbnail does not need the
archive-transfer budget.

From the pr-ready simplify pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 07:37:33 -04:00
Georges-Antoine Assi
63129edb30 fix(streaming): reject a non-PNG broker frame and inflate off the loop
The broker's screenshot now shadows the frame PCSX2 embeds in its own state,
so a 200 that is not a PNG has to read as no frame rather than as an unusable
one, or the state lands with no thumbnail at all. Extraction moves onto a
thread alongside the fetch it falls back from, since the body it inflates runs
to hundreds of megabytes.

From the pr-ready code-review pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 07:30:06 -04:00
Georges-Antoine Assi
4d36cfd513 fix(v2): stop the RProgressLinear ticker story outliving its test
The live ticker rescheduled itself through requestAnimationFrame with no
stop condition, so the loop kept running after the story unmounted. Once
the suite tore the environment down, a pending callback fired against a
gone requestAnimationFrame and failed the run with an unhandled
ReferenceError, even with every test passing.

Drive it from an interval started on mount and cleared on unmount, the
way the RProgressCircular and RImg animated stories already do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 21:59:42 -04:00
Georges-Antoine Assi
0f4db4dfc2 Merge pull request #4471 from rommapp/claude/precompress-static-assets
perf(frontend): precompress built assets and serve them with gzip_static
2026-09-14 21:56:28 -04:00
Georges-Antoine Assi
60e4e385b5 Merge remote-tracking branch 'origin/master' into fix/zip-rom-patching
# Conflicts:
#	frontend/src/locales/zh_CN/patcher.json
2026-09-14 18:44:46 -04:00
Georges-Antoine Assi
4f6532500d fix(patcher): label the archive-member select and cover it with tests
The member picker reused patcher.select-file, so a ROM with several base
files rendered two dropdowns both labelled "Select file". Add
patcher.select-archive-member across all 18 locales and use it.

Treat an empty archive_member_name form field as "not specified" rather
than as a member name that matches nothing.

Fold getZipMembers into the archiveMembers computed and watch that, so
the selection also resets when the member list itself changes.

Add PatcherTab coverage for sending the selected member, typed against
RomArchiveMember so the fixture cannot drift from the schema.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 18:41:56 -04:00
Georges-Antoine Assi
ff335ea2c0 fix(patcher): keep zipfile errors matchable and stop forcing ZIP64
A module-level exception tuple freezes zipfile.BadZipFile, but seven test
modules reload the zipfile module, which rebinds the class. After any of
them runs, a corrupt archive escaped the handler and surfaced as a raw
BadZipFile instead of a 400. Look the class up at raise time instead.
NotImplementedError goes with it, being a RuntimeError subclass.

Declare each rebuilt entry's final size instead of passing force_zip64,
so zipfile marks an entry ZIP64 only when it needs to; a patched ROM
handed to a basic unzip implementation was otherwise rejected even though
the unpatched archive loaded fine.

Drop the extracted and patched intermediates once they are consumed,
rather than holding three full-size copies for the life of the download.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 18:41:47 -04:00
Sam Dornan
c4a36aa023 ci: gate the preview-build report job on the build-preview label (#4475)
The workflow triggers on `pull_request: types: [labeled]`, so adding any
label starts a run. `prepare`, `build` and `merge` are each gated on the
`build-preview` label and are skipped without it, but `report` was gated
only on the event type, so it ran and read `needs.merge.result` of
`skipped` as a failure. Every PR that received any other label got a
false "Preview build failed" sticky comment.


Claude-Session: https://claude.ai/code/session_01YBBbdsDv9BiYJnKwcCGE6A

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 17:19:37 -05:00
Zurdi
d4f81f097f Merge pull request #4487 from rommapp/claude/graphql-api-migration-vu20z2
refactor(roms): give the ROM filters a single home, and match them against the facets mirror
2026-09-14 23:46:48 +02:00
Zurdi
522d15f1b4 Merge pull request #4482 from rommapp/claude/zealous-sagan-qlvox0
fix(v2): dismiss tooltips when an overlay opens over them
2026-09-14 23:46:39 +02:00
Zurdi
fc75bbb722 Merge pull request #4500 from rommapp/feat/steam-cover-provider
feat: offer Steam as a cover art provider
2026-09-14 23:40:57 +02:00
Kyle Benzo
d8a32ab7dd fix(patcher): preserve output filesystem errors 2026-09-14 13:01:53 -07:00
Kyle Benzo
fad8b2943d fix(patcher): use archive fallback for zip extraction 2026-09-14 12:55:08 -07:00
kylebenzo
3e73579614 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-09-14 12:49:58 -07:00
Zurdi
7e774e3049 Merge pull request #4489 from wolfg1969/master
Translate the remaining untranslated zh_CN strings
2026-09-14 20:45:55 +02:00
Zurdi
a4005539dd Merge pull request #4474 from rommapp/claude/ui-framework-identification-sajda8
docs: correct stale Vuetify claims in v2 skills and architecture doc
2026-09-14 20:45:07 +02:00
Zurdi
c2690c1a1e Merge pull request #4468 from rommapp/claude/nginx-alternatives-pwxq1p
perf(docker): upgrade nginx to 1.29.8 and tune the serving layer
2026-09-14 20:43:58 +02:00
Georges-Antoine Assi
13b073dc4b Merge pull request #4501 from rommapp/perf/roms-single-rebuild-migration
perf(migrations): add the 5.3.0 roms columns in one table copy
2026-09-14 07:45:06 -04:00
Georges-Antoine Assi
07f5a1d005 refactor(migrations): tighten the roms catalog (simplify)
- `rebuild_generated_columns` owns the index drop, since it is the one
  place a column is dropped, so 0123's downgrade gets it too.
- `ensure_roms_columns` builds its action list first and runs on it, and
  no longer re-reflects the table to re-test a column it just added.
- One list behind `STEAM_FED_COLUMNS`, and `INHERITED_COLUMNS` says what
  the set difference at the use site used to.
- 0112 builds the view through `roms_metadata_view_sql`, and 0126 drops
  the add-column branch the shared copy made unreachable.
- Tests share one generated-expression helper and read index and column
  names off the module that owns them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 07:29:28 -04:00
Georges-Antoine Assi
e3f34a4562 fix(migrations): harden the roms catalog replays (code-review)
- `drop_roms_columns` drops a composite index that still spans a column
  it removes before the ALTER: MariaDB and MySQL would otherwise keep the
  index over the remaining columns, so 0126's unique index left by a run
  that died before its stamp would become UNIQUE (platform_id).
- `ensure_roms_columns` recreates `roms_metadata` whenever it is absent,
  so a run that died between its ALTER and the CREATE VIEW gets the view
  back on the replay instead of only when a rebuild is pending.
- A generated column the engine does not reflect as computed counts as
  not reading Steam and is rebuilt, rather than raising a KeyError.
- One home for the `steam_metadata` column name, imported by 0123.
- Tests pin the lost view, the leftover MariaDB default and the surviving
  unique index; the ALTER recorder matches `roms` as a whole word.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 07:14:10 -04:00
Zach Clendenen
fb0b389adb style(streaming): trim the save-picker comments to the facts
review-polish pass over the save-picker change.

The comments explaining why an older pick only lands where the broker clears
the save tree said the same thing in four places, so each one now carries only
what its own reader cannot get from the code. The save fixture in the launch
screen test becomes a typed factory, which the emulator-scoping case it did not
cover yet now uses.
2026-09-14 03:02:03 -05:00
Zach Clendenen
a9ec19b3d9 refactor(streaming): look the picked save up by id instead of scanning the list
simplify pass over the save-picker change.

`resolve_save_archive` loaded every save the user has for the ROM just to find
one row by id. `db_save_handler.get_save` is the owner-scoped point lookup the
save endpoints already use for exactly this, so call it and check the rom_id,
which drops a list load per claim that carries a pick.

The ROM scoping moves from the query into the check, so pin it with a test.
2026-09-14 02:51:47 -05:00
Zach Clendenen
b0d33be5b0 fix(streaming): order the launch screen saves the way the backend restores them
code-review pass (xhigh, --fix) over the save-picker change.

The launch screen inherited `user_saves` ordered by `updated_at` from the rom
schema, while the backend picks the archive to restore by `(created_at, id)`.
A content-hash rewrite on an older row was enough to make the two disagree, so
the no-picker panel could name a save the broker would not restore. The list
is now sorted the way the backend orders it.

Also give the restorability rule one home on the backend, so the validator and
the selector cannot drift, and correct a stale comment that still called the
memory card id claimSession's third argument.
2026-09-14 02:43:27 -05:00
Zach Clendenen
107d797292 feat(streaming): let the launch screen pick which save to restore
Containers whose broker clears the save tree before restoring can land an
archive older than the container's own files, so offer the pick there and
validate it at claim time.
2026-09-13 23:57:21 -05:00
Zach Clendenen
16c355e4d2 docs(streaming): correct how non-PCSX2 states get their thumbnail
The docstring said the other emulators write the frame as its own file,
served by /state-screenshot. romm-broker PR 36 removed state_screenshot_path()
from every emulator module and replaced it with a single pixelflux capture of
the stream, so there are no per-emulator frame files left. PCSX2 is still the
only format that embeds one, read only when the broker's capture 404s.
2026-09-13 23:41:51 -05:00