Commit Graph

38 Commits

Author SHA1 Message Date
Claude
54a6ca6c96 Remove the no-emdash-in-comment ESLint rule after a one-time sweep
Replace the em-dashes in frontend comments outside the frozen v1 UI
(script, template and style comments, plus the header build-tokens.ts
writes into tokens.css), then drop the rule. String literals keep their
em-dash glyphs. The AGENTS.md rule stays, and pr-ready's humanizer pass
catches new ones in prose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RyamrxVw5BzEidVzm68LY7
2026-09-28 17:25:42 +00:00
Georges-Antoine Assi
a35391f77d chore(frontend): trim platform icon comments (review-polish)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 21:47:39 -04:00
Georges-Antoine Assi
5269e942a6 refactor(frontend): simplify platform icon resolution
- 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>
2026-09-25 21:45:59 -04:00
Georges-Antoine Assi
d5e73dae5b fix(frontend): address code-review findings on platform icons
- 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>
2026-09-25 21:31:34 -04:00
Georges-Antoine Assi
ffb6dc62f9 fix(frontend): only request platform icons that ship
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>
2026-09-25 21:08:43 -04:00
zurdi
9fb8bafd65 Merge remote-tracking branch 'origin/master' into fix/gallery-list-table-header 2026-09-22 21:40:33 +02:00
Sam Dornan
bcb203dc18 fix(v2): declare color-scheme with the v2 theme palettes (#4701)
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>
2026-09-22 12:37:34 -05:00
zurdi
8feef65006 refactor(v2): give the list view's repeated parts one home
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
2026-09-20 19:49:51 +02:00
zurdi
9696de8ee8 fix(v2): rebuild the gallery list view for phones
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
2026-09-20 17:44:40 +02:00
Zurdi
3a877dad99 Merge pull request #4580 from rommapp/claude/v2-mobile-list-rows
feat(v2): phone-friendly list rows, soundtrack header and mini player
2026-09-17 18:02:52 +02:00
zurdi
b76e2a44df feat(v2): even out the top-bar pills and stream the scan progress
- 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
2026-09-17 16:32:14 +02:00
Georges-Antoine Assi
ec11448bba fix(frontend): check each nginx isolation map on its own
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>
2026-09-17 09:24:00 -04:00
Georges-Antoine Assi
b5cd86e3f7 fix(frontend): restate the player isolation URLs instead of reading nginx
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>
2026-09-17 09:13:32 -04:00
Georges-Antoine Assi
a3b534a1c3 chore(v2): address the review comments on the launch path
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>
2026-09-17 08:36:53 -04:00
Georges-Antoine Assi
fdb4cb5e82 chore(v2): trim the launch-path comments and mount the nginx map in dev
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>
2026-09-17 08:18:21 -04:00
Georges-Antoine Assi
8ecb4dd0c5 refactor(v2): fold the cleanup pass findings into the launch path
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>
2026-09-17 08:18:20 -04:00
Georges-Antoine Assi
3eadc4c33c fix(v2): apply the code review fixes to the launch path
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>
2026-09-17 08:18:20 -04:00
zurdi
5497ee9edb chore(v2): trim the launch-path comments and factor the test fixtures
Comments down to the fact a reader cannot recover from the code, and the save,
state and firmware fixtures behind one factory each rather than a cast per
literal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1VFUvsR5wYK3axxR1gebc
2026-09-17 05:53:30 +02:00
zurdi
6bf6ed25d2 refactor(v2): fold the cleanup pass findings into the launch path
- 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
2026-09-17 05:44:52 +02:00
zurdi
8d4e856360 fix(v2): close the gaps the code review found in the player launch path
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
2026-09-17 05:33:30 +02:00
Sam Dornan
1f231c84f4 test(precompress): close the gaps the review found in the gzip_static guards
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
2026-09-12 04:49:06 +00:00
Sam Dornan
64740468ec fix(frontend): address the review findings on the precompress plugin
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
2026-09-12 02:09:24 +00:00
Sam Dornan
36cda30407 refactor(frontend): run precompression as a build plugin
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
2026-09-12 01:38:01 +00:00
Sam Dornan
76ab7ac7c7 perf(frontend): precompress built assets and serve them with gzip_static
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
2026-09-12 01:30:10 +00:00
zurdi
45f55bf633 fix(v2): gallery header/nav mobile polish + dimension tokens
- 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>
2026-07-03 11:56:42 +00:00
zurdi
c8bc51dc81 Enhance light theme support with color adjustments and new tokens 2026-06-24 17:52:21 +00:00
zurdi
25b9397467 feat: implement CRT mode with visual effects and toggle functionality 2026-06-17 01:28:17 +02:00
zurdi
da0961281a Implement responsive navigation layout with BottomNav and BreakpointBadge components 2026-06-05 15:09:26 +02:00
zurdi
16d6cef03e feat: implement drawer z-index and enhance search context handling 2026-05-25 20:44:37 +00:00
zurdi
1aa23bd46e feat: unified RDialog consumers 2026-05-21 16:25:31 +00:00
zurdi
d7eb469f1f feat: introduce zIndex tokens for consistent stacking layers across components 2026-05-14 17:08:35 +00:00
zurdi
674ca98c57 feat: add RExpandTransition component for height animations
- 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.
2026-05-14 15:07:03 +00:00
zurdi
8b796098d0 feat: implement list mode enhancements; add new components for list row and header, update styles and tokens for improved layout 2026-05-07 15:09:26 +00:00
zurdi
1728980948 feat: add status action to GameActionBtn and integrate with GameCard
- 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>
2026-05-06 09:34:10 +00:00
zurdi
ca5aa0ef6b refactor: update color usage across components to utilize color-mix for improved theming
- 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.
2026-04-29 09:39:50 +00:00
zurdi
f97d7d28c9 feat(frontend-v2): eliminate hardcoded rgba(255, ...) outside tokens.css
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>
2026-04-29 08:31:14 +00:00
zurdi
49d01f65d6 chore(frontend-v2): polish tokens script and drop layout scope redundancy
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>
2026-04-28 13:12:58 +00:00
zurdi
b3180a5aca feat(frontend-v2): generate tokens.css from index.ts as single source
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>
2026-04-28 13:09:50 +00:00