Comment and docstring pass over the `released_days` change: cut the copies of
rationale that already live next to the thing they describe, and drop the
sentences defending obvious choices.
`RELEASED_DAY_REGEX` now carries the calendar ranges, so a match is a valid day
and `parse_released_days` needs no sentinel pair and no second range check.
`release_day_ranges` stops re-sorting what `epoch_ms_in_ranges` already sorts.
`anniversaryQuery`'s return type is a named export, so the widget imports it
instead of unwrapping a `ReturnType`, and the widget's two reset paths share
`showEmptyDay`.
`loadMore` is `loadNextPage`, since it appends one page rather than the rest.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`GET /api/roms` already does what `/roms/anniversaries` hand-rolled: it selects
ordered ids over the filtered set, takes the total from that index, hydrates
only the page asked for, and re-projects the rows into id order. So the widget
now asks it for a page rather than owning an endpoint that pulls the whole day.
`released_days` on the list endpoint takes days as "M-D", matching any year, and
`released_before_year` bounds them. Both go through `filter_roms`, so the same
day-of-year match is available to the gallery filters and to smart-collection
criteria, and the range union stays where it was: still sargable, still a
covering index range scan on `idx_roms_generated_first_release_date`, no SQL
date function and no dialect branching. Verified on a 73k-rom database that the
plan through the list endpoint's join is unchanged: `type=range`,
`Using where; Using index`, no filesort.
The filter means exactly what it says, so the calendar policy moved to the
client, where the clock it depends on already lived. `anniversaryQuery` picks
the days and the year bound off the viewer's own date: it skips 1 January,
where several providers park year-only metadata, rolls 29 February onto 28
February in a non-leap year, and bounds the years at the viewer's own. The
server no longer has to second-guess a timezone offset, so the 31 December
asked for on 1 January UTC correction is gone rather than fixed.
Consequences for the widget: the counter is the day's real total instead of one
clipped at a 500-row ceiling that no longer exists, and a card costs one page
of 24 rather than up to 4 MB up front. Paging backwards stays in memory;
only moving past the loaded pages fetches, with the spinner on the arrow so
focus is never yanked mid-page. A failed page keeps the card on screen.
`released_days` is added to the list endpoint's unscoped-cache gate: the
sidecar keys encode no filters, so a narrowed page must not be served under the
shared "all" key. Covered by a test that primes the unscoped key first.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The day's ordering breaks ties on the rom id. Every rom released on the
same calendar day carries the same timestamp, so without it the paging
order, and which rows the 500 ceiling keeps, varied between requests.
MariaDB plans it the same way: still a covering index range scan, no
filesort.
The widget clears the loaded day when a request fails, so the rollover
check retries it. Claiming the day up front held the error copy until
local midnight, and the card offers no way to ask again.
Also pins the clock in `test_defaults_to_todays_utc_date`, which failed
on 1 January and raised on 29 February; corrects the Czech 2-4 plural
form, which the locale's own rule reaches; and drops "scope" from the
endpoint docstring, where it read as a claim about the auth scope
declared right above it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The PICO-8 modules sat beside the view they serve, while every other v2
helper lives in v2/utils, player ones included (playerBezel, playerDisc,
playerFirmware).
scriptLoader moves with them: pico8Runtime imports it, and nothing in
v2/utils reaches into v2/views, so leaving it behind would have been the
first exception. EmulatorJS and JsDos pick it up from the new path.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The player gathered keyboard, gamepad, on-screen and mouse state inline, so
the bit tables, the btnp edge detection and the pad polling all sat in the
SFC with no way to test them. pico8Input owns that state and hands back the
per-frame snapshot; the view keeps only DOM plumbing, which drops its script
block by 92 lines.
The mouse scaling takes an offset and the canvas size rather than an event,
so the clamping is exercised without a DOM. 23 tests cover the edge
detection, the dead zone, the #3851 phantom-pad guard, the pointer-button
masks and the reset a replay depends on.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Audio ran on the main thread and rebuilt the graph every frame: an AudioBuffer
and a one-shot AudioBufferSourceNode per frame, roughly 18k nodes and 80MB of
garbage per ten minutes of play. A single AudioWorkletNode now drains a ring
buffer on the audio thread, so playback survives a stalled main thread. The
route gets no COOP/COEP, so samples cross by transfer rather than through a
SharedArrayBuffer, and the worklet hands each buffer straight back for the
player to refill: 231 posts and 231 recycles over a four-second cart, so
steady-state playback allocates nothing. The runtime fills a caller-owned
buffer instead of returning a fresh slice, which drops the last copy.
Frame pacing moves to pico8Pacer, and audio scheduling to pico8Audio, so the
two pieces most likely to be wrong are unit-testable without a component. Both
had no coverage while the wasm bindings did; they now have 19 tests between
them, including the catch-up cap and the buffer recycling.
useGamepad keeps the knowledge about raw pad state, so export isUsablePad,
PAD_BUTTON and AXIS_THRESHOLD rather than restating them here. The button
index map is now keyed by name, with the event-detail lookup derived from it.
Vite inlines assets under 4KB as data: URIs, which addModule cannot be relied
on to accept, so the worklet is pinned to a real file.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Another element taking pointer capture mid-press left the cartridge with a
stuck mouse button, and a FAKE-08 build with ABORTING_MALLOC disabled would
hand back a null pointer we wrote through.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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>
Cut the comment that compared the pixel loop to the byte-store version it
replaced, and the two three-line notes on the runtime fetch and the script
loader, keeping only what a reader cannot recover from the code.
Rename padButtonMap, padAxisMap and mouseButtonMap to *Bits: they are pair
lists of masks, not records like keyboardMap next to them.
Give the test's fake canvas context a real ImageData return so it fails if
the runtime starts reading width or height, and drop the imports that
change orphaned.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The canvas, the control group and the four d-pad buttons shipped English
aria-labels and tooltips. The parity check cannot see a key that was never
added, so nothing caught them.
The face buttons keep A and B as their own accessible name: those are the
canonical PICO-8 button names and are not translated.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Render through a packed-RGBA palette lookup and a 32-bit pixel view, so a
paint is two stores per framebuffer byte instead of eight clamped byte
writes, and rebind the heap views only when wasm memory grows.
Separate `advance` from `render` so a catch-up tick emulates several frames
but paints once, rather than discarding up to two full frames of pixel work
exactly when the machine is already behind.
Load the runtime and fetch the cart in parallel, reuse one input struct
instead of allocating per step, and skip disconnected gamepads, whose stale
analog values press buttons on their own in Firefox (#3851).
Replace the hand-rolled liveness flag with useIsAlive, take the canvas
geometry and the canvas background token from their existing homes, and move
the pad, axis and mouse-button mappings next to the keyboard map.
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>
A request still in flight across local midnight could resolve after the
rollover's and overwrite the new day's games with yesterday's. The
rollover had already marked the day loaded, so the timer would not ask
again for another 24 hours.
Each load now claims its day up front and commits nothing (games, error
state or the loading flag) once a newer load has claimed a different day.
Addresses the review comment on AnniversaryWidget.vue:99.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The card is pinned to a date but was only loaded on mount, so a Home page
left open across local midnight went on showing yesterday's games. A
minute timer compares the day it loaded for against the clock, so only a
crossed midnight costs a request.
Addresses the "Widget stays stale overnight" review comment on #4396.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Shows games released on today's date in an earlier year, one at a time,
with arrows to page through the rest. Sits in the Home widget rail beside
Random pick and Library stats, with its own Settings toggle (default on)
and an entry in the drag-reorder list.
New endpoint GET /api/roms/anniversaries, ROMS_READ, whole-library,
returning up to 24 SimpleRomSchema oldest release first. Clients send
their own local month and day so "today" matches the calendar in front of
the user rather than the server's UTC clock.
The day-of-year match is a union of one-day ranges over
generated_first_release_date rather than MONTH()/DAY() on the value.
Ranges are sargable, so idx_roms_generated_first_release_date serves both
the match and the sort as one covering range scan: 195 rows examined and
~2 ms against 63,334 rows and ~70 ms for the function predicate on a
100k-row table. Emitting no SQL date function also means no dialect
branching and no migration.
1 January returns empty. Several providers park year-only metadata there
(ScreenScraper parses a bare year with %Y, CSDb publishes nothing else,
IGDB reports year precision as 1 January), so nothing in the stored data
tells a real 1 January release apart from an unknown day. Leap-day
releases roll onto 28 February in non-leap years.
Visibility follows /random: filter on hidden platforms and roms, then
re-check each hydrated row with perms.can_see_rom.
Closes#3440
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Rename `FirmwareTemplate.platform_path` to `firmware_dir`: it returns the
firmware folder, while the same name on `StructureTemplate` returns the platform
folder. Name the watcher's index for the segment it points at.
Fold the two reads of a raw structure key into `_raw_template`, and drop the
docstrings that only restated a one-line delegation or a signature.
Remove `footer-create-summary-default`, which no component references and whose
copy still named Structure A.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The banner and footer chips held either `roms/{platform}` or `{platform}/roms`
before, so their width was bounded. A configured template is not, and a nested
one overflowed its container at every viewport, clipping the path mid-segment.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`filesystem.structure` now spells out the whole layout rather than only the part
below a platform folder. A template is relative to the library root, `{platform}`
marks the platform folder, and `{game}` marks where a game begins.
Merge `{gameFile}` and `{gameDir}` into one `{game}` terminal. The information a
terminal carried was the depth, not the kind: at a declared level a file is a
game of its own and a folder is one multi-file game, which a stat answers. That
drops the two-template idiom for a level holding both, and `_discover_default_roms`
with it, since the default scan is now just `roms/{platform}/{game}`.
Retire the auto-detected `{platform}/roms` layout, along with
`filesystem.roms_folder` and `filesystem.firmware_folder`, which named one path
segment each that a template now contains. Both are refused at startup with the
template that reproduces the layout, so an instance that relied on either says so
instead of scanning an empty library and marking every rom missing. Firmware gets
its own `structure.firmware` key rather than following the rom layout implicitly.
`get_roms_fs_structure` keeps meaning the folder a platform's games start in, so
the `.physical` sentinel paths already in the database still resolve. Per-platform
overrides have to agree with `default` on where the platform folder sits;
relocating one platform needs platform discovery and the watcher to union several
roots, which is left out.
The setup wizard reports `library_ready` plus the configured template instead of
a `struct_a`/`struct_b` discriminator, so the banner shows the layout in force
rather than guessing it client-side.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Testing the custom library structure against a live library turned up four
defects, all of them a path being reduced to a bare file name.
Both exporters wrote a rom's `fs_name` alone, so every game a template nests
was exported as if it sat in the platform folder: ES-DE and Pegasus could not
find any of them. They now write the rom's path relative to the platform
folder, the folder the metadata files themselves live in, and copy exported
media into the matching subfolder so two identically named roms keep their own
artwork.
Merging into an existing gamelist.xml / metadata.pegasus.txt keyed entries by
file name too, so identically named roms in different folders both merged into
the first entry and produced duplicates. Entries are now keyed by path, with a
Pegasus block matched by the folder its listed files sit in.
Reading a gamelist.xml had the same collision: two roms sharing a file name
both took the metadata of whichever entry was parsed last. A rom's own path now
wins, and a bare file name stays a fallback key for the tools that write those,
dropped when two entries share it.
Default discovery surfaced hidden folders as multi-file games, unlike
structured discovery which skips them. exclude_multi_roms now owns that rule
for both.
Also validate `exclude`'s exclusion_type: an unknown value reached
`Config.__getattribute__` and returned a 500 rather than a 422.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cut the comments that explain rather than note: the migration's four-paragraph
docstring, the upload-path and digest-SQL docstrings, and the mark-missing note
in the scan loop. Drop an em-dash from LocationChip's header per CLAUDE.md.
Reword 0126's downgrade error so it no longer embeds a SELECT, which bandit
reads as string-built SQL, and mark the dialect-selected backfill nosec B608 the
way the other migrations do.
Add the LocationChip test its HashChip sibling already had, covering the copy
going through useClipboard (the composable is what applies the secure-context
guard).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Key the unique roms index on a sha256 digest of the full path. Indexing
(platform_id, fs_path, fs_name) directly is 5804 bytes of utf8mb4, which MySQL
rejects with ER_TOO_LONG_KEY and MariaDB silently demotes to a hash index; the
digest column keeps it a 260-byte BTREE on every supported driver. It is derived
by the same @validates hook that maintains the other fs_name columns, and
resynced explicitly in update_rom and convert_rom_to_folder.
Migration 0126 backfills the digest in one dialect-branched UPDATE. A Python
executemany right after the ADD COLUMN silently applies only its first parameter
set on mariadb-connector, leaving the rest NULL. test_migrations pins the SQL
expression to compute_full_path_hash so the two cannot drift.
Drop the relocation pre-pass. mark_missing_roms already runs before the identify
loop, so a moved file reaches get_matching_missing_rom, which requires all three
hashes to agree (or a title_id, covering non-hashable platforms), refuses
ambiguous matches, re-parses filename tags and emits over the socket. The
pre-pass duplicated it with a weaker CRC-only check, hashed every candidate
twice, compared folder sizes against a total that excludes filtered files, and
ran on QUICK scans.
Send uploads to a folder the platform's structure will actually discover, so the
next scan does not flag a fresh upload as missing, and refuse with a 400 when
only the user can pick the folder.
Make 0126's downgrade refuse when duplicate file names exist instead of deleting
the roms (and their saves, notes and collection membership) that carry them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A grouping folder is no longer also a game. With `{gameDir}` and
`{category}/{gameFile}` declared together, the category folder was surfaced
as a multi-file game *and* descended into, listing its contents twice. A
folder any template descends into is now treated as a grouping level.
Relocation runs for every platform, not only those with a custom structure.
Dropping a platform's template moves every game back to the platform root,
which previously read as a library of new games and orphaned all the saves,
play history, favorites and collection membership. A library whose paths are
unchanged still costs one query and no hashing. This also removes the need
for a manual "apply relocation" toggle.
Physical games are excluded from relocation candidates: they have no file, so
they read as having disappeared from their path on every scan.
A near-miss on the terminal macro (`{gameFolder}` for `{gameDir}`) now names
the offending section instead of only reporting a missing terminal.
Documents two limits the QA pass asked about: a move that also compresses or
extracts the game changes its size and is not detected (the size pre-filter
runs before hashing), and how reverting to the default layout behaves.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Conflict resolution notes:
- Locale rom.json: master sorted and reworked every file; took master's and
re-inserted `location` / `location-copied` in sorted position. Added them to
the new tr_TR locale.
- FSRom gained a required `fs_path`, so `build_hashless_fs_rom` now takes one
and both call sites pass the rom's own path.
- `get_roms` keeps this branch's `_collect_fs_roms` discovery while adopting
master's one-pass build and in-place sort.
- `mark_missing_roms` takes full paths and now also excludes physical games
(master), and the scan loop keeps master's early missing-sync plus its
restored-rom emit alongside this branch's relocation pass. The relocation
filter now applies only to the identify loop, so a relocated rom is no longer
re-flagged missing at the end of the scan.
- Relocation writes rom files through master's `sync_rom_files` (which replaced
`purge_rom_files` / `add_rom_file`), so row ids and track metadata survive.
- Master's unique index on (platform_id, fs_name) contradicts this branch's
premise that same-named files in different folders are distinct games.
Migration 0126 widens it to (platform_id, fs_path, fs_name); physical games
all share one folder, so a duplicate title is still rejected.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Change detection needs equality, not a fingerprint, and the hash was the
only reason the tick handler was async. Comparing bytes drops the WebCrypto
call, its non-secure-context fallback, and both mid-flight liveness checks
the awaits had made necessary: the decision now runs before the upload with
nothing suspended in between.
Seeding reads the SRAM with getSaveFile(false), which skips the dump that
was firing a saveSaveFiles tick, so the subscription no longer has to be
ordered below it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The active flag and the install slot both said "this component still owns
the subscription", so the slot alone now carries it.
fnv1a64's second lane re-hashed the same bytes offset by one with the same
prime, leaving the halves correlated; distinct primes over a single load
drop the per-byte modulo too.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A tick that is mid-hash when Exit or Save & Quit closes the gate would
still issue its own upload and race theirs. Teardown during the seed
likewise re-armed the gate and subscribed to a dead emulator.
displayMessage now tolerates a torn-down emulator for all of its callers.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
EmulatorJS exposes no `off`, so a second EJS_onGameStart against one live
emulator would leave two handlers with independent trackers uploading the
same tick.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The rating-count column cast whatever `total_rating_count` held straight to
a number, without the digit guard every other numeric branch in the
migration carries. The metadata blobs are writable verbatim through the raw
metadata form, so a library holding a non-numeric value could not migrate at
all: PostgreSQL aborts the ALTER TABLE on `invalid input syntax for type
numeric`. The MariaDB branch also reached for JSON_VALUE, which MySQL only
gained in 8.0.21, below the 8.0 the docs advertise.
`/roms/{id}/similar` was gated behind DISABLE_DOWNLOAD_ENDPOINT_AUTH while
resolving permissions unconditionally, so with that flag set an anonymous
request hit `UnauthenticatedUser.role` and 500'd. It is not a download
endpoint; it now requires ROMS_READ, as /api/recommendations does.
The details page also fetched similar games with the feature switched off,
and OverviewTab took a `webp` prop for state it already reads from
useWebpSupport.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The engine carried its tuning history in its comments: measurement logs for
PIVOT_B, the weight a facet held before the company split, the shape of the
cold-start feed before the Bayesian average. None of that describes what the
code does now, and it belongs in the history rather than beside the values.
Also folds serving's ROM loader into feed's, which differed only by the
visibility filter applied afterwards.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fall back to a JS hash when WebCrypto is unavailable (non-secure
contexts) and never let a hash or upload error escape the emitter or
the game-start hook. Comments trimmed to the style guide (no em-dashes,
one or two lines of why).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Behind a new config flag, emulatorjs.auto_save_sync (default false), the
EmulatorJS player uploads the in-game save (.srm) to the server on
EmulatorJS' own "System Save interval" tick, without Save & Quit.
EmulatorJS already runs that timer (default 300 s) and its
gameManager.saveSaveFiles() fires a "saveSaveFiles" event carrying the
SRAM bytes, but nothing listens to it, so today an in-game save reaches
the server only from Save & Quit or the Export Save File button (#4201).
This subscribes to that event from Player.vue and uploads through the
existing saveSave() when the SRAM hash is unchanged since the previous
tick (a save the core is still writing is never uploaded — the corruption
the earlier automatic upload was removed for, #2349) and differs from the
last upload (an idle session uploads nothing). The tracker is seeded from
the SRAM the core holds after the server save is applied, so a launch
never uploads the server's own file back, and the subscription is turned
off before Save & Quit, Quit and unmount.
The bytes EmulatorJS hands out are views onto the emulator heap, a
SharedArrayBuffer on threaded cores; they are copied into a plain
ArrayBuffer before hashing or uploading.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merge 0123/0124/0125 into one migration. Each added STORED generated
columns to `roms`, and 0125 already dropped and re-added several, so
upgrading rewrote the widest table three times and restated the
`roms_metadata` view three times. One ALTER TABLE now carries the Steam
rebuild, the three IGDB tag columns and the rating count, and the view is
recreated once. Verified upgrade/downgrade/upgrade on MariaDB and Postgres.
Score each unordered pair once. Candidate generation is symmetric, so
every pair had its dot product computed twice. The sweep now runs in
ascending id order and scores only from the lower id, which also makes a
ROM's edges final the moment the sweep passes it, so the incremental
flush survives. Only the target's quality bonus differs by direction, so
one content score is blended twice. The per-ROM candidate ceiling moves
into `candidate_ids`, taking the rarest posting lists first, where it
bounds work instead of being applied after the cost was already paid.
Read identity off one list. `sibling_roms` decides "same title" from
seven provider ids; the suppression here used two, so a pair matched only
by MobyGames was a sibling everywhere else in RomM and a recommendation
for itself here. `IDENTITY_ID_FIELDS` on the model is now the one home,
consumed unscoped by the builder since a reissue on other hardware is no
more a suggestion than a second copy on the same platform.
Make the facet vocabulary a StrEnum. It was spelled out in five places,
two of them already stale, and `facet: str` kept it out of the API
contract, so an unmapped facet silently rendered a raw value. It reaches
OpenAPI as a closed union and the frontend maps are keyed by it, so
adding a facet now fails the typecheck until the UI handles it.
Give each surface one serving entry point. `similar_roms` and
`recommended_roms` own the over-fetch, hydration, visibility filter,
series cap and cache that the two endpoints and the inspection tool each
re-implemented with three different over-fetch constants; the cache moves
in with them so no caller can rank a feed without populating it.
Endpoints now do ORM-to-schema only.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Backend, wasted work:
- `_score_one` computed `content_similarity` twice per candidate on the
trim path and built `shared_reasons` for every candidate clearing the
score floor, discarding almost all of them. Compute content once and
build reasons only for the edges actually stored.
- `get_feature_rows` outer-joined `RomMetadata`, a view over the wide
`roms` table, defeating the point of reading the narrow facet mirror.
Read the generated columns off the `Rom` join already present.
- Feed cache invalidation ran a keyspace SCAN on every `rom_user` write.
Put graph and per-user version counters in the key so it is one INCR,
matching `invalidate_filter_values_cache`.
Backend, reuse:
- Route the five name comprehensions beside `_expanded_names` through it.
- `_recency_factor` reimplemented `to_utc`.
- `replace_similarity_edges` hand-rolled `itertools.batched`.
- Derive `TASTE_FACETS` from `FACET_WEIGHTS` instead of restating its keys.
Backend, dead code:
- `ScoredNeighbour`, `BuildStats.to_dict`, `delete_all_similarity_edges`,
the unread `difficulty`/`completion`/`backlogged` affinity fields,
`FACET_ORDER` and `RomInfo.rom_id`, and a no-op `column_type` ternary.
Frontend:
- Extract `RecommendationReason` from the two byte-identical copies in
`Home.vue` and `SimilarGamesGrid.vue`, dropping the repeated
`primaryReason` calls and their non-null assertions.
- Cap the caption with `--r-card-art-w` rather than a `158px` literal that
does not track the per-breakpoint card width.
- Key the similar-games fetch on the ROM id: `watchEffect` refetched on
every optimistic mutation of `currentRom`.
- One home for the similar-games limit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The uniform 16/9 cells letterboxed every asset into an identical tinted
box, so a 42x680 box spine and a 2:1 marquee both read as mostly empty
background. Assets now keep their real proportions under a shared height
cap and sit on a common baseline, with a drop-shadow that follows the
artwork's own silhouette (most scans are transparent PNGs) and a lift on
hover.
The details cover goes back to being inert. The Media tab's Artwork
subtab now leads with the rom's own cover, so every piece of artwork the
page holds sits in one grid and one lightbox.
Review follow-ups. CLAUDE.md bans em-dashes in anything we write, and
Vue Test Utils already refuses to dispatch on a disabled button, so the
click asserted nothing the surrounding expectations did not.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GameCover swaps to the external `url_cover` when the primary image fails,
but the zoom re-resolved the chain itself and kept pointing at the failed
URL — clicking a visible fallback cover opened broken artwork.
Have GameCover expose the src it is rendering and ask it at click time, so
there is one home for "which artwork is on screen". The affordance keys off
`hasArtwork`, which is the separate question of whether there is anything
to zoom into at all.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GameHeader and InfoGrid each built the same search location object; move
it to a shared `searchLocation` util so the query schema lives in one
place.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Only the outer wrapper and the stage dismissed on click, but the item box
between them fills the stage while the image letterboxes inside it. At
1440x900 the item measured 1280x774 against a 421x680 cover, so nearly
everything that read as backdrop was the item div and swallowed the
click. Give the item its own .self handler; the image itself still keeps
the lightbox open.
Fixes#4362
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The details page cover was inert in the v2 UI. Clicking it now opens the
same fullscreen RCarousel lightbox the screenshot and artwork grids use,
sourced from the resolution GameCover already runs so the zoom shows
whatever artwork is on screen (box art, physical, mix image).
A magnify hint fades in on hover and focus, and stays visible on touch
and gamepad where there is no hover. A rom with no artwork at all keeps
its procedural placeholder and the hero stays inert. The 3D box hero is
untouched: it is already interactive.
Closes#4361
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Region, language and custom tags in the details header now link into a
filtered search, the same pivot the Overview info grid already offers on
genres, companies and franchises.
Closes#4363
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>