- Move the slug-to-URL resolver into src/v2/utils/platformIcons so
PlatformIcon no longer pulls in the blob cache, and normalize slugs
through one helper.
- Keep PlatformIcon's tooltip as title or alt, which drops the three
:show-tooltip="false" overrides the slug fallback needed.
- Drop the plugin's unused directory argument, the redundant onError
guards and the doubled fsSlug lookup, and shorten the test helper.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Emit the slug-to-file map from the manifest plugin and reload it when
icons change under the dev server.
- Default the plugin's icon directory so both configs share one path.
- Keep decorative platform icons at an empty alt, and turn off the slug
tooltip where the display name already sits next to the icon.
- Clean up the manifest test's temp dir and cover CachedPlatformIcon.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The v2 platform icon components probed /assets/platforms/<slug>.svg, then
.ico, and let the browser 404 on every miss before settling on default.ico.
A build-time manifest of the shipped filenames (virtual:platform-icons) now
picks the right file up front, so unknown slugs go straight to the default
and the prefetch cache makes at most one request per shipped slug.
The manifest is a Vite virtual module rather than an eager import.meta.glob,
which would emit hashed copies of all ~240 icons and inline the small ones
into the lib chunk just to read their names.
RPlatformIcon moves out of lib/ to components/shared/PlatformIcon, since it
now depends on platform-specific asset knowledge. Its tooltip also falls
back to the slug when no title or alt is given (the empty-string alt default
used to short-circuit the `??` chain).
Based on the approach in #4728 by @andest01.
Fixes#4671
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
v2's UA-drawn chrome currently follows Vuetify's runtime theme, which injects
`:root { color-scheme: dark }` while a dark theme is active and nothing at the
root for light. That holds only because RomM.vue keeps vuetifyTheme.change() in
sync, and v1 plus Vuetify are slated for deletion: once their stylesheet is
gone the root is undeclared again, where Chrome falls back to light chrome and
a dark v2 UI gets light form controls.
Declare the scheme next to each palette so it travels in the same scope class
the v2 tokens already own, rather than depending on a v1 framework's runtime
theme.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
The redesign wrote the same compact sort control into three headers, the
same compact row anatomy into four components, and a second rAF tween
beside the one it had just added.
- Extract ListSortMenu, which also settles the three different answers
the headers gave when no column carries the current sort.
- Move the compact row's flex/stack/facts rules to global.css, beside
the list chrome already there.
- Share one `tween` helper between the two animating composables.
- Let useAnimatedNumber take an already-formatted value, so Stat and
PageHeader stop repeating the same number-or-string branch.
- Make the tick column a layout token instead of a constant, a CSS
variable declared only for phones, and three literal fallbacks.
- Read the expansion duration from the motion token it documents.
- Drop the `compact` aliases that only renamed `smAndDown`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
The list header was built for a desktop table: it floated as its own
island over the rows, which showed through its blur, and the table
underneath it scrolled sideways on a phone.
- Pin the header edge to edge as one glass surface with the toolbar,
tinted only once pinned, keeping its border as the divider.
- Trade the columns on sm-and-down for a two-line row (cover, title,
facts) with a chevron that rolls a three-column detail panel open,
so nothing scrolls sideways.
- Swap the alpha strip for an A-Z menu in the toolbar on phones and
tablets, and land letter jumps flush under the toolbar in both
layouts.
- Give the platforms and collections indexes, and the missing-games
list, the same row.
- Move the selection counter into a notch above the floating bar and
animate the bar in.
- Roll every counter up to its new value (useAnimatedNumber).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
- The scan indicator, the now-playing pill and the user menu trigger share
a new `--r-nav-pill-h` layout token, so the three pills line up at the
same height.
- The scan indicator drops its spinner; its bottom progress bar carries
the activity instead, with a glow streaming along the unfilled track
while the scan runs. The glow is a new `stream` mode on RProgressLinear.
- On portrait phones the now-playing title is capped narrower and loops,
so the pill no longer crowds the bar; landscape keeps the wider title.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S76JZm1jjh32KhBbPCBvGW
Address the Greptile review: compare the restated patterns against the
$coep_header and $coop_header maps separately, since a merged set hides a
pattern dropped from one of them, and skip the check where the whole repo
is not mounted, so the drift test can still run in the dev container.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The vite plugin parsed the COOP/COEP patterns out of the nginx template at
config load, but the Dockerfile's frontend-build stage copies frontend/
alone, so the config threw ENOENT and the image build failed.
Restate the two patterns in the plugin and let its test assert they still
match the template's map, which also drops the dev container mount that
existed only to feed that read.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Condense the comments that ran past two lines, and build the launch
intent fixtures from typed factories again rather than bare literals.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dev container mounts frontend/ alone, so the vite plugin that now
reads the nginx template could not find it and the dev server refused to
start. Mount the template directory read-only.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dev server now parses the isolated URLs out of the nginx template
instead of restating them, and refuses a template that yields none.
js-dos skips the runtime preload on the leg it is about to reload away,
records its play session on pagehide, and takes the relaunch marker from
the composable that defines it.
Also drops a redundant parameter and a duplicated derivation from
applyLaunchIntent, collapses the repeated id checks in isLaunchIntent,
gives the js-dos asset bases one home, and trims the comments.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replace the player entry when leaving by SPA navigation, keep a failed
js-dos runtime load from stacking a second stylesheet, and answer the
player URLs from `vite preview` as well as the dev server.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- The stream player restated the stop pair `useActivityPresence.stop()` now
owns, so it calls it.
- The dev server's isolation list and the nginx map it mirrors are checked
against each other by a test, rather than by a comment asking whoever edits
one to remember the other.
- One case covers the js-dos runtime being injected once, whichever side of the
first load a second view mounts on.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1VFUvsR5wYK3axxR1gebc
Findings from the review pass over the SPA launch change, plus the two bot
reviews on the PR.
Correctness:
- Presence stops were addressed to the device, not to a rom, so a view that
never announced anything could clear what another tab was playing. A stop now
needs a started session, and happens once; `useActivityPresence` grows the
`stop()` the two call sites were spelling out by hand.
- The EmulatorJS exit read `window.EJS_emulator`, which a departure taken while
the loader was still injecting would not see yet, so the runtime could be left
in a document a later launch then failed to load into. It tracks the injection
itself.
- js-dos resolved its asset base per view: a second launch in a document whose
runtime came from the CDN looked for the payloads locally. Two views mounting
at once could also both inject the runtime. Both now go through one
document-level loader, which resolves with the base it served from and lets a
later mount retry a failed load.
- A blocked sessionStorage threw while every EmulatorJS view was initialising.
Storage that cannot be read is an absent intent, and one that cannot be
written cancels the relaunch rather than losing the selection to it.
- Outside a secure context the headers cannot expose SharedArrayBuffer, so the
reload only delayed the same error by a round trip. It is refused up front.
- The dev server mirrored one of the two nginx isolation entries, leaving the
console player unisolated there.
Reuse and cover:
- `usePlayerExit` owns the whole rule again: `departing` moved in, so both views
use `guard` rather than one of them restating it, and the `leaving` flag it
never needed is gone.
- Resolving an intent back into a selection is a pure pair in `launchIntent.ts`
with its own tests, rather than closures the view kept to itself.
- The Vite plugin is a script beside `precompress`, so the regexes that have to
track nginx are tested.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1VFUvsR5wYK3axxR1gebc
The nginx guard only read the http-level default.conf and the three raw
location bodies, so two ways of reintroducing the ROM-corruption bug went
undetected. Both were confirmed against the suite before this change, each
leaving all seven tests green:
- gzip_static added at server scope in the template, with the locations left
intact: /library/ and /cache/ inherit it, and a request for Game.nes returns
Game.nes.gz's bytes.
- gzip_static removed from the fingerprinted-assets regex location, which the
parametrised list never covered, silently dropping precompressed bundles.
Parse the template's location blocks instead, honouring braces inside the
quoted regex matcher, and assert against server scope, each build-output
location including the regex one, and any location that gains the directive.
A prefix match would have let /assets/romm/resources/ pass as expected, so
matchers resolve exactly and only the regex is keyed by its opening.
Also tie MIN_BYTES to nginx's gzip_min_length with a test rather than a
comment, cover the "gzip made it bigger" branch that the extension filter
kept unreachable, drop an em dash, and correct a comment that claimed every
file without a .gz sibling is gzipped on the fly, which is untrue for types
outside gzip_types.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDXxq3vAxJVGhm1pQuK8V7
The summary divided by zero and printed "NaN% smaller" when nothing
cleared the extension and size filters.
The comment on the extension list said it tracks gzip_types, which was
wrong twice over: .svg, .wasm, .webmanifest and .map are absent from that
directive, and gzip_static serves a .gz sibling without consulting it at
all. Someone editing either list on the strength of that comment would
have changed behaviour silently.
Storybook builds ran the plugin too, gzipping storybook-static that nginx
never serves. It is stripped alongside vite-plugin-pwa, which .storybook
already does for the same reason.
The Python test could only grep vite.config.js for the call, so a gutted
closeBundle or apply: "serve" left it green. A vitest suite now runs the
hooks against a temporary directory and checks the archive round-trips,
that small and already-compressed files are skipped, and that a rerun does
not compress its own output.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDXxq3vAxJVGhm1pQuK8V7
Chaining the step onto the build script left `vite build` on its own
without compression, and only worked because npm ran the chain. A plugin
makes it part of the build itself, so there is nothing to bypass.
It runs with enforce: post so the service worker vite-plugin-pwa emits is
compressed too, and reads its output directory from the resolved config
rather than assuming dist. The precache is generated earlier in the build
and still lists no .gz entries.
Written here rather than taken off the shelf: vite-plugin-compression was
last published in 2022, vite-plugin-brotli caps at vite 7, and
vite-plugin-compression2 declares no vite 8 support while depending on
@rollup/pluginutils, which this rolldown-based build does not use. Node's
zlib covers it in one file with no dependency.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDXxq3vAxJVGhm1pQuK8V7
The SPA bundle was compressed on every cold page load. Writing a .gz
sibling at build time and turning on gzip_static moves that work to the
build: serving the 1.6 MB main bundle drops from ~71ms to ~9ms per
request, measured over 25 requests against a local nginx.
Level 9 is affordable when it runs once, though it lands within a percent
of what nginx produces at runtime, so the win is the CPU rather than the
bytes. Anything without a .gz sibling still compresses on the fly.
The step is chained into build rather than a postbuild hook because
frontend/.npmrc sets ignore-scripts, which stops npm running pre and post
hooks at all. Node's zlib does the work, so no new dependency.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDXxq3vAxJVGhm1pQuK8V7
- RTabNav: the horizontal tab strip no longer swallows vertical swipes
(`overflow-y: hidden` so it's not a vertical scroll container; drop
`touch-action: pan-x`, which froze the page) — the view scrolls even
when the swipe starts on the tabs.
- AppNav: remove the "back to v1" escape-hatch button (and its now-dead
code / imports / styles); the v1 UI keeps its own switch.
- GalleryShell/AlphaStrip: the stuck toolbar overlay now insets by the
strip's real footprint via shared tokens, so it lines up exactly with
the in-flow toolbar; wider, more tappable strip on phones, raised to
centre in the visible band (above the bottom bar).
- CollectionHead / PlatformHead: bigger collection cover on phones
(matches the index); the platform icon is a per-breakpoint square in a
box that grows to it, so it reflows instead of overflowing/clipping.
- Add `--r-coll-cover-*` and `--r-alpha-strip-w*` dimension tokens.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Introduced RExpandTransition.vue to animate height changes of wrapped elements using v-if or v-show.
- Added index.ts to export the new RExpandTransition component.
- Updated RList, RListItem, RToolbar, RTooltip, RVirtualScroller components to remove Vuetify references in comments.
- Replaced v-expand-transition with RExpandTransition in Login.vue and Patcher.vue for consistent animation behavior.
- Refactored Scan.vue to manage open panels using a Set for better performance and clarity.
- Updated styles in global.css and tokens.css to improve focus ring visibility and component styling.
- Removed vuetify.ts theme definitions as they are no longer needed.
- Introduced a new "status" action in GameActionBtn, allowing users to set and display game status.
- Replaced the StatusBadge component with the GameActionBtn in GameCard for a unified interface.
- Updated various components to accommodate the new status feature, including GameDetails and AppNav.
- Added CSS variables for page max width to ensure consistent layout on ultrawide displays.
- Removed redundant max-width styles from several components to streamline layout management.
Co-authored-by: Copilot <copilot@github.com>
- Replaced hardcoded RGBA colors with color-mix for various UI elements in AuthCard, MissingFSBadge, PageHeader, AppLayout, RTable, RMenuPanel, RDialog, global styles, and tokens.
- Enhanced consistency in color application by introducing new color tokens for brand, status, and overlay colors.
- Updated background and border styles in multiple views including ControllerDebug, Pair, Patcher, Player, Scan, and Settings to align with new theming approach.
- Improved accessibility and visual coherence by ensuring color contrasts are maintained across light and dark themes.
Adds three new token groups so the 21 sites previously documented as
"intentional hardcoded rgba" can use proper tokens instead:
- colorOverlay (fixed dark glass, never theme-flips) — drives the
surfaces sitting on cover artwork: StatusBadge, GameCard
platform-icon / badge, GameActionBtn. Tokens: --r-color-overlay-fg
(.95) / -fg-secondary (.85) / -fg-muted (.45) / -border (.12) /
-border-strong (.25) / -scrim-soft (.55) / -scrim-strong (.78).
- panel + panelBorder pair (theme-flipped, in colorDark/colorLight) —
the deep-glass / off-white surfaces that RDialog and RMenuPanel
share. The inline `:global(.r-v2-light) X` overrides collapse into
single rules.
- tooltipBg + tooltipBorder pair (theme-flipped) — moves the
v-overlay__content.r-tooltip skin in global.css off literals.
- shimmerSweep (theme-flipped) — moves the linear-gradient sweep
inside RSkeletonBlock::after off the hand-paired rgba values.
Also: RMenuItem danger hover background now uses
`color-mix(in srgb, var(--r-color-danger) 12%, transparent)`
instead of the raw rgba(255, 80, 80, 0.12) — derived from the
canonical danger token.
Outside tokens.css (which holds the source values), v2 now has
zero `rgba(255, 255, 255, X)` literals.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
build-tokens.ts: import the source as .js (compatible with vue-tsc
without enabling allowImportingTsExtensions), wrap top-level await
in main(), drop a leftover unused helper. Doc strings now point to
"npm run build:tokens" — the script name avoids npm's reserved
"token" subcommand. Header in the regenerated tokens.css matches.
AppLayout, AuthLayout and PairShell: drop the redundant
"r-v2 r-v2-{dark|light}" classes from their root divs. RomM.vue
already toggles those on <html>, which covers both the in-tree
shell and any teleported overlays — anchoring them again on the
layout root was harmless duplication that complicated the v1 →
v2-only cleanup. Each layout keeps its own BEM root class
(.r-v2-shell, .r-v2-auth, .r-v2-pair-shell) for its scoped styles.
useThemeClass becomes unused and is removed; when v1 is deleted,
the only thing left to clean is the toggle in RomM.vue.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
scripts/build-tokens.ts emits src/v2/styles/tokens.css with explicit
naming overrides for the special cases (--r-row-pad, --r-elev-*,
--r-nav-h, abbreviated layout vars). tsx wired into devDeps;
build:tokens script + predev/prebuild hooks keep the CSS in sync.
Backfill missing tokens that lived only in CSS: --r-color-fav
joins colorBrand, and the focus colors in colorDark / colorLight
match the translucent values components actually consume (not the
unused #ffffff / #111117 they used to declare). Drop the orphan
--r-focus-ring-color (zero references in the codebase).
Adopt --r-radius-card (14px) for RMenuPanel and RDialog instead of
hard-coded 14px; switch a NotesTab badge from 10px to --r-radius-lg.
Closes the "panels use 14px not --r-radius-lg" pitfall — the
constitution no longer needs that footnote.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>