PlayerShell renders the stage in a v-else on `running`, so releaseGame
unmounts it while the view stays mounted. The fallback held that element
in a closure and only cleared it on exit, leaving document.fullscreenElement
and the legacy alias pointing at a detached node, with no fullscreenchange
to correct vueuse's state.
The real API exits when its element is removed, so the fallback now does
too, watching only while it holds an element. That keeps the fix in the
polyfill rather than asking every caller to clear fullscreen before it
tears its stage down.
Moves useFullscreenFallback to its own module: v2 composables are one
named export per composables/useFoo/index.ts.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Uo885XxwhN8wfC4oCtR48
Entry and exit failures are not the same. A rejected request is a denial
and the stage just stays windowed, but callers exit before opening a
body-teleported dialog, so a failed exit leaves that dialog painted over
by the stage with nothing said. The shared wrapper discarded both.
Uses console.error rather than the console.warn this replaced, which v2
does not allow to ship.
Also drops indexdb-monitor.ts from the frontend architecture doc's source
tree, which still listed the deleted file.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Uo885XxwhN8wfC4oCtR48
Comments cut to the repo's two-line limit, and the fallback's background
keeps a `black` fallback value so it does not depend on the `.r-v2` token
scope being present, as the v1 shim's literal did not.
The attribute name was written three times across the stylesheet and the
enter/exit pair, where a rename in one would silently stop the CSS
matching.
Verified the fallback in Chromium: it stands aside where the native API
exists, and where it does not the stage computes to position fixed,
z-index 99999, filling the viewport, opaque in both themes and with no
token scope, reverting to static on exit and leaving the prototype clean
on dispose.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Uo885XxwhN8wfC4oCtR48
usePlayerFullscreen took an optional target so three library-driven
players could call it bare, purely to install the prototype patch, and
throw the controller away. That discarded controller was not free:
vueuse defaults the target to documentElement and still registers its
fullscreenchange listeners on both it and document.
Split the side effect into useFullscreenFallback and make the target
required. The three call sites now say what they mean without a comment
apologising for an unused return value.
Refcount the install. The patch is process-global while its callers are
scoped, so overlapping consumers would otherwise stack private patch
layers and restore them in teardown order. Probing HTMLElement.prototype
rather than Element.prototype lets an installed fallback see itself.
Drops v2's writes to playing.fullScreen, which no longer had a reader in
either tree. The field stays because v1 still destructures it.
Also: hoist swallow to module scope, annotate the return inline rather
than exporting an unused interface mirroring vueuse's shape, cover the
document.fullScreen alias at the layer that defines it, dispose test
fallbacks in afterEach so a failed assertion cannot leak a patched
document into the next test, and drop test cases that re-covered the
util through the composable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Uo885XxwhN8wfC4oCtR48
The fallback that emulates the Fullscreen API gated on a user-agent
sniff for iOS. Both branches of that check also match iPad, where the
API genuinely works behind the webkit prefix, so the fallback was
replacing a working native implementation with a fixed-position div:
iPad players lost real fullscreen and kept the browser chrome.
Gate on capability instead. iPhone has no element fullscreen at all
(caniuse note 5, still current for iOS 27), iPad has the prefixed API,
everything else has the standard one, so probing Element.prototype puts
each platform on the best implementation it has and retires the fallback
by itself if iPhone ever ships the real thing.
Centralise the rest behind usePlayerFullscreen. Fullscreen was reaching
the five players five different ways, and the fallback was installed by
only one of them, so the shared "start in fullscreen" toggle did nothing
on iPhone in the other four. The composable installs the fallback for
the scope and wraps vueuse's useFullscreen, which brings the webkit
prefix handling that Stream's hand-rolled version lacked. Players whose
library drives fullscreen itself call it without a target: the fallback
patches the same prototype the library reaches for.
The fallback also has to expose document.fullScreen. It is the
deprecated alias support probes read to decide the API is usable, and
without it vueuse treats the polyfilled API as unsupported and enter()
silently does nothing.
Drops playing.setFullScreen, which had no callers. The fullScreen state
it wrote is still referenced by v1 and cannot go until that tree does.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Uo885XxwhN8wfC4oCtR48
CI's check-v1-frozen fails any diff touching
frontend/src/{views,components,console,layouts} without the
allow-v1-changes label, which is reserved for sanctioned critical bug
fixes. A deprecation comment is not one, so the annotation comes out
rather than bypassing the guard. The divergence is documented on the v2
fork instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Uo885XxwhN8wfC4oCtR48
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
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>
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>
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>
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>
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>
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>
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>
- `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>
- `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>
The browser capture read #videoCanvas by id, but the default path routes
frames through a MediaStreamTrackGenerator into a hidden #videoStream, so
drawImage returned a transparent bitmap. That still carries PNG magic, so
the backend accepted it and filed a blank thumbnail against a good state.
pull_state_to_library now asks the broker for the container's own capture
first, which is the same route for every emulator, and falls back to an
embedded frame (PCSX2) only when the broker answers 404. The browser
capture, its Redis stash, and the /state-frame endpoint are gone.
0108 adds every column of the 5.3.0 catalog, so a chain that stopped
before a later revision and then downgrades to 0107 used to keep that
revision's columns, including a NOT NULL full_path_hash on MariaDB that
5.2.0 could no longer insert around. `drop_roms_columns()` now removes
whatever of the catalog is still there in one ALTER TABLE, restores the
pre-Steam expressions on the 0098 columns, recreates the view over what
remains and drops the PostgreSQL enum type.
The plain column list no longer needs a connection, so the enum type is
created just before the ALTER that needs it and dropped through one
helper shared with 0116.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every ALTER TABLE roms copies the whole table: the FULLTEXT index from
0084 rules out ALGORITHM=INSTANT (its hidden FTS_DOC_ID column survives
even a DROP INDEX), and a STORED generated column takes ALGORITHM=COPY on
every engine. The 5.2.0 -> 5.3.0 chain issued 21 such ALTERs, one per
revision, so a library with a JSON blob per provider on every row paid
for 21 copies.
`utils/roms_columns.py` now declares every column the chain puts on
`roms`, plain and generated, and `ensure_roms_columns()` adds whatever
the table lacks in a single ALTER TABLE. Each revision that used to add
its own columns calls it instead, so the first one to run on a database
does the copy and the rest find their columns in place. A table whose
generated columns predate 0123 is recognised by the provider they do not
read yet and rebuilt at the current definition in the same statement.
On MariaDB the copy also fills `full_path_hash` through a column
referencing DEFAULT that is dropped right after, so 0126 no longer runs a
whole-table UPDATE through the roms_facets triggers followed by a NOT NULL
rebuild.
Measured on a 73k-ROM copy of the dev library (MariaDB 11.3.2, 128 MB
buffer pool): 168.5s -> 48.9s for 5.2.0 -> head, with one 16s copy where
there were 21 rebuilds. The resulting schema is identical to the old
chain's on MariaDB and PostgreSQL, and a fresh install lands on the same
schema on MariaDB 10.11.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The providers row dropped a grid provider's match cover whenever that
provider was configured, even when its grid came back empty, so a
timed-out CDN probe hid the one Steam capsule the match had found. The
row now only drops a provider whose result set is actually in the grid.
A source listed twice in the cover priority handed the picker its
covers twice; the priority helper now keeps a source's first position
only, for every caller. The v1 cover dialog keys its panels by
provider as well as name, since both providers can return the same
title. The provider chips grow to the touch target on touch and
gamepad input.
The invalid-key regression test now raises the adapter's own exception
class, and the endpoint gate is covered with Steam as the only enabled
provider. A component test drives the dialog wiring: chips filter the
grid, Steam covers are handed off untouched, and the providers row
keeps a match cover whose grid is empty.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Untv32z88QMZ2yRSsTgGcC
The cover search dialog only reached SteamGridDB, so a PC game whose
capsule lives on Steam had no way to pick it up short of a full
re-match. Steam now joins SteamGridDB behind `GET /search/cover`,
ordered by the configured cover priority, and each result carries its
provider so the dialog can filter by source and credit the artwork.
The Steam handler builds the picker from the store search alone and
probes the CDN for the portrait capsule and the landscape header under
the same budget the match picker uses, so a slow CDN costs thumbnails
rather than the dialog. Hits with no artwork are dropped.
A failing provider costs only its own covers; a rejected SteamGridDB
key is still reported, since that is the user's to fix. The "search
cover" action in the edit dialog now opens whenever either provider is
enabled, and the game overview credits Steam-hosted covers.
The resource shape the picker consumes moves to the shared base handler
as `CoverResource` / `CoverResult`, since it is no longer SteamGridDB's
alone.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Untv32z88QMZ2yRSsTgGcC
The gate tested command names alembic never passes: it hands its environment
the per-command `fn` name, so `do_stamp` and `display_version` are what reach
it. Pin that with a canary over the closure the gate matches.
Probe before reading the applied heads, so only a server that refuses pays for
the lookup and the other dialects pay nothing, and fold the tests into the
module they mirror.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>