Platform / Collection / Search shared an identical layout (single
virtualised scroll surface with hero, toolbar, AlphaStrip, dwell-
debounced prefetch, scroll restoration, list-mode RTable wiring,
search-input debounce, URL filter sync, sticky-toolbar overlay) — the
only differences were the hero (InfoPanel for Platform/Collection,
PageHeader for Search) and the resource-loading flow per view.
This commit hoists everything shared into `GalleryShell.vue` and turns
the three views into thin orchestrators that only know how to:
* resolve their resource (platform / collection-kind / nothing),
* provide a hero via the `#hero` slot,
* call `shellRef.applyRestoredScroll()` after the initial fetch.
The shell handles its own `onBeforeRouteUpdate` / `onBeforeRouteLeave`
guards to save scroll on every route change; views own their load-on-
update flow. Search additionally overrides the `#empty` slot to render
a boxed `EmptyState` illustration when a search resolves with no hits.
Line counts:
Platform.vue: 503 → 173
Search.vue: 414 → 77
Collection.vue: 472 → 191
GalleryShell.vue: 0 → 607 (new)
Total: 1389 → 1048
Future cross-view fixes (virtualizer tweaks, toolbar styling, dwell
timing, etc.) now land in one place instead of three.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reworks the sticky-on-scroll behaviour so the gallery toolbar reads as
a single element that scrolls naturally with the hero and steps OUT of
the scroll once it reaches the top — matching AppNav, where content
never reaches the bar's area.
- The toolbar item inside the virtualizer renders an empty placeholder
(its 64px of vertical space is reserved in the offset table).
- The actual GalleryToolbar lives once, as an absolute-positioned
overlay on the section. Its `top` is computed from `scrollTop`:
scrollTop < toolbarOffset → top = toolbarOffset - scrollTop (tracks
the natural scroll); scrollTop ≥ toolbarOffset → top = 0 (pinned).
- While pinned, a `clip-path: inset(toolbar-h 0 0 0)` on the virtualizer
hides anything painted in the top band so card rows don't bleed
through behind the toolbar. The toolbar's backdrop-filter then only
sees the page's BackgroundArt — same visual language as AppNav,
semi-transparent over the page background, no card content showing
through.
- A `--stuck` modifier adds the bottom border + blur only when pinned,
so the in-flow state (transparent, sitting between hero and rows)
reads cleanly without chrome.
Replaces the previous dual-toolbar slide-in approach (one inline, one
fixed sliding from above) which the user found jumpy. There is now
exactly one toolbar element from the user's POV.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Big rearchitecture of the gallery infinite-scroll. Three problems with
the prior Vuetify-v-virtual-scroll-based implementation drove this:
1. Scroll freeze on window resolve — dynamic-height re-measurement plus
the prior virtualItems computed re-running end-to-end on every
byPosition change locked the main thread hard enough to eat scroll
input.
2. AlphaStrip jumps landing on the wrong letter — v-virtual-scroll
estimates scrollTop from average measured item height, which skewed
when most items were unmeasured skeletons. Click "N", land short.
3. Aggressive per-row prefetch on fast scroll — the IntersectionObserver
fired per-row crossing, queueing 72-item windows for rows the user
was just flying past.
Architecture:
- `RVirtualScroller` rewritten as a custom virtualizer (~210 lines).
Owns a prefix-sum offset table built from `getItemHeight(item)`, so
`scrollToIndex` is just `containerEl.scrollTop = offsets[idx]` — no
estimation, no drift, exact landing on AlphaStrip jumps. Items render
with `transform: translateY(<offset>px)`. Configurable overscan
(default 25 per side ≈ 50 + visible). Emits `viewportRange` (items
whose pixel rect actually intersects the viewport — NOT the rendered
overscan) so consumers can wire AlphaStrip / dwell off "what the user
is actually looking at right now".
- `galleryItemHeight` per-kind table on `useGalleryVirtualItems`. Hero
280, toolbar 64, letter-header 56, row 254, list-table 1200,
load-more 80, empty 240, skeleton-row 254. Drives the offset math.
- `byPosition` mutated in place (no Map reassignment) — Vue 3's reactive
Map triggers per-key dependents; an arriving window only re-renders
the rows holding the just-resolved positions, not the full list.
- AlphaStrip lit letters + currentLetter derive from `viewportRange`
(computed) — exactly what's on screen, not what's in the rendered
overscan band.
- Per-row dwell prefetch: each visible row arms its own 2s timer.
Fast-scroll / AlphaStrip fly-by leaves zero fetches in flight; pausing
on a region for 2s fires per-row range fetches in parallel. Each row
asks for exactly its 8 positions via the new
`galleryRoms.fetchRange(offset, limit)`, so 4 visible rows resolve
independently and stream into the DOM as their requests come back.
- Sticky header-dock toolbar: when the inline GalleryToolbar scrolls
past the threshold (~hero height), a fixed copy slides in from above
with a 240ms ease-out, sharing the same handlers/state. Falls back to
the inline behaviour for `floating` dock (already always visible).
- Removed the IntersectionObserver / MutationObserver / per-batch
rAF-prefetch scaffolding; the dwell + viewport-range pair replaces
both responsibilities.
Manual browser validation pending. Letter ordering tweaked
(`#` first → AlphaStrip), skeleton label spacing nudged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Round-trips the active search term between Vue Router's `route.query`
and the v1 galleryFilter store. URLs are now bookmarkable for the bits
of state v2 actually exposes today.
- New composable in `src/v2/composables/useGalleryFilterUrl/`. URL→store
on mount and on every `route.query.search` change (covers browser
back/forward and pasted URLs); store→URL via `router.replace` so each
keystroke doesn't grow the history stack. Skips writes when desired
and current already match (no feedback loop with the inverse watcher).
- Plugged into Platform / Search / Collection.
- Removed the manual `searchTerm.value = null` cleanups in Platform and
Collection — the next gallery view's mount re-applies its own URL,
so the cleanup happens implicitly. No behavioural change for navigation
patterns we already supported.
- Scope is intentionally narrow today (only `searchTerm` round-trips)
because that's the only filter v2 surfaces. The other ~24 galleryFilter
fields plug in here once the v2 filter drawer ships.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wraps the shared Socket.IO instance with mount/unmount cleanup so v2
consumers stop hand-pairing `socket.on(event, handler)` with
`onBeforeUnmount(() => socket.off(...))`.
- Auto-connects the singleton socket unless `{ connect: false }`.
- Cleanup uses `onScopeDispose` (not `onBeforeUnmount`) so the composable
also works inside non-component effect scopes (Pinia store actions,
manually-scoped subscriptions). Returns `{ stop }` for early manual
cleanup; idempotent.
- Generic payload typing kept until the backend ships a typed event map
(constitution §X.10) — until then the consumer asserts the shape.
- Migrated `Scan.vue`'s `scan:done` listener as a proof of correctness.
No other v2 surface uses `socket.on()` (Patcher / RefreshMetadataDialog
are emit-only).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Vue Router's built-in scrollBehavior only restores window scroll;
gallery views scroll on RVirtualScroller's containerEl, so navigating
back from GameDetails / Settings dumped the user at the top instead of
where they left off.
- New v2 store `scrollRestoration` with Map<routeFullPath, scrollTop>.
Save is non-destructive (rereading the same key keeps the value), so
user can navigate A → B → A and still land at A's last position.
- Platform / Search / Collection views save the scroller's scrollTop on
onBeforeRouteLeave (and on onBeforeRouteUpdate when the same view
swaps to a new route param), then restore in onMounted after the
first window has loaded and setupSpy has attached the
IntersectionObserver. The observer catches the rows revealed at the
restored scroll position and kicks the prefetch for those windows.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Updated Collection.vue to implement a single-virtualiser architecture with sparse loading, replacing the previous ROM store with a gallery ROM store.
- Enhanced Platform.vue to support windowed loading and optimized fetching of ROMs, including adjustments to the loading state and pagination.
- Modified Search.vue to align with the new gallery ROM store, improving search functionality and loading behavior.
- Introduced skeleton loading states for game cards and adjusted animations for a smoother user experience.
- Removed redundant code and improved overall readability and maintainability of the components.
Platform / Search / Collection now render hero, toolbar, content rows and
load-more as items inside one RVirtualScroller — single scroll surface,
no nested scrollbars, virtualisation extends to libraries with thousands
of ROMs.
- New useGalleryVirtualItems builds a discriminated GalleryItem[] (hero,
toolbar, letter-header, row, list-table, load-more, empty, skeleton).
- New useResponsiveColumns chunks ROMs into rows that match the CSS
grid via ResizeObserver. Rows use repeat(N, minmax(card-w, 1fr)) so
the visible gap between cards grows accordion-style on resize.
- AlphaStrip is index-based: scrollToIndex(letterToIndex.get(letter),
{ smooth: true }) for animated jumps. Spy uses an IntersectionObserver
on [data-spy-letters] (comma-joined per-row letter set) so multi-letter
rows light up every letter they cover.
- Shared romBucketLetter util mirrors the backend's strip-articles regex
(^(the|a|an)\\s+) so frontend grouping matches server sort order — "The
Legend of Zelda" buckets under L, not T.
- RVirtualScroller exposes scrollToIndex(index, { smooth }) and
containerEl. Smooth path captures Vuetify's synchronous scrollTop set
and re-applies it via native scrollTo({ behavior: 'smooth' }).
- useLetterGroups slimmed to a pure grouping computed (DOM-ref scroll-spy
bits removed). GameGrid.vue and LetterGroupedGrid.vue deleted.
Manual browser verification on a very-large library (5–10k+ ROMs) is
still pending.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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>
CLAUDE.md §X — frontend debt list trimmed; §X.5 (dual-theme audit)
removed since the audit is done. Added a new "Intentional
hardcoded rgba(255, ...)" section enumerating the 30 sites that
stay literal by design: cover-overlay surfaces, panel background
pairs, backdrop scrims, destructive-accent rgba over
--r-color-danger, and tokens.css itself.
Frontend remaining debt: 4 items (virtualisation, useGalleryFilterUrl,
scroll restoration, useSocketEvent).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
41 hardcoded rgba(255, 255, 255, X) sites in the controller-debug
view migrated via context-aware regex (color → fg/fg-secondary/
fg-muted/fg-faint, background → bg-elevated/surface/surface-hover,
border → border/border-strong, opacity-binned). Debug-only view so
exact token shade isn't load-bearing — gets the surface to react to
theme without per-site analysis.
Closes the dual-theme audit's frontend debt. The 30 sites that
remain are intentional and stay hardcoded:
- tokens.css (9) — the token definitions themselves
- StatusBadge / GameCard /
GameActionBtn (11) — cover-overlay surfaces, dark glass
must read on top of cover art
regardless of theme
- RDialog / RMenuPanel (4) — panel borders paired with hand-tuned
dark glass background; surface is a
distinctive token-not-yet
- RMenuItem (2) — destructive-action red
- global.css (3) — backdrop scrim gradient
- RSkeletonBlock (1) — shimmer keyframe stop
§X.5 (frontend dual-theme audit) of CLAUDE.md is fully done.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Player/EmulatorJS and Player/Ruffle launcher screens (the
pre-game UI before the embedded emulator takes over): cover
placeholder, subtitles, glass panel, asset preview cards,
section labels, color picker border + code, brand line,
spinner. The fullscreen-stage state stays #000 — that's the
emulator canvas backdrop and is intentionally opaque dark.
98 → 71 sites left. Most of what remains is intentional —
cover-overlay surfaces (StatusBadge / GameCard chrome /
GameActionBtn) which need dark glass to read on top of any
cover art, the RDialog/RMenuPanel panel borders that pair with
hand-tuned panel backgrounds, and tokens.css (the actual token
definitions, not migration targets).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Card chrome moves from a bottom-left platform-name badge to a TR
platform-icon (semi-transparent disc). The badge prop renames to
showPlatformIcon; the info-button + emit("info") drop along with it
since clicking the card already navigates to GameDetails. Story
argType updated to match.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Future primitives that consume useCan() render with grants by
default. Stories that need to exercise role-based hiding can
override per-story:
storePermissions().hydrateFromRole("viewer" | "editor" | null);
Closes the §X.7 debt entry — primitive stories can now ship with
permission-aware controls without per-story boilerplate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces 7 sites of `(heartbeatStore.value as unknown as
{ FRONTEND?: { IMAGES_WEBP?: boolean } })?.FRONTEND?.IMAGES_WEBP`
with the typed composable. The cover-rewrite logic
`p.replace(/\.(png|jpg|jpeg)$/i, ".webp")` collapses into
`toWebp(p)` everywhere.
Files migrated:
- views: Home, CollectionsIndex, GameDetails, Gallery/Platform,
Gallery/Search, Gallery/Collection
- dialogs: AddRomsToCollectionDialog
The cast itself now lives only inside `useWebpSupport`. When the
backend adds IMAGES_WEBP to FrontendDict in OpenAPI, the cast
disappears and the composable becomes a thin wrapper.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces every `emitter?.emit("snackbarShow", ...)` in v2 with the
typed composable. Tone derived from the old `color` string (red →
error, green → success, orange → warning, primary → info). Each
call collapses an emitter+payload into a one-liner, and where
emitter was only used for snackbars, the inject + Emitter import
is dropped entirely (LoginForm, ResetForm, Auth/Register,
Auth/ResetPassword, NotesTab, SoundtrackPanel, Patcher).
Files migrated:
- Auth: LoginForm, ResetForm, Register, ResetPassword
- Dialogs: AddRomsToCollection, DeleteManual, DeleteRom, EditRom,
ManualUploadTarget, MatchRom, RefreshMetadata
- GameDetails: MediaTab, NotesTab, SoundtrackPanel
- AppShell: UserMenu
- Settings: UserProfile
- Views: Patcher
- Composables: useGameActions
NotificationHost still collapses free-form color strings to tones
for the duration of v1 coexistence; this commit removes v2's
contribution to the variance — every v2 emit now hits
NotificationHost with one of {success, error, warning, info}
already.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds an explicit §X.8 entry pointing the follow-up PR at the ~360
hardcoded rgba(255, 255, 255, ...) sites left after the first pass,
along with the token-mapping conventions used in the visible-surface
migration. Captures which views are still untouched (ControllerDebug,
Patcher, Player/EmulatorJS, dialog content, RDialog/RTable primitives,
auth views).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First pass of the dual-theme audit (premise #5). Replaces hardcoded
rgba(255, 255, 255, ...) with token references on the surfaces a
user sees first when toggling theme. Started at 429 hardcoded sites;
this commit migrates ~69 across 19 files. The rest is debt — see
CLAUDE.md §X.
Surfaces now theme-aware:
- AppShell: AppNav (classic-UI pill), UserMenu (avatar pill, chevron)
- Home: section header colors, CardRow head/count/arrows, empty state
- Galleries: GalleryToolbar (floating + kebab), Platform/Collection
empty states, GameCard label, GameList row text/thumb,
LetterGroupedGrid heading/load-more/empty, AlphaStrip letter colors,
InfoPanel border/title
- Tiles: PlatformTile (background/border/hover/count),
CollectionTile (name/count), CollectionMosaic (background/empty)
- Settings: SettingsShell (panel/subtitle), SettingsNav (panel/links),
UserInterface (sections/cards/desc), MetadataSources (tiles/logos/
indicators)
Tokens used: --r-color-bg-elevated, --r-color-surface,
--r-color-surface-hover, --r-color-border, --r-color-border-strong,
--r-color-fg, --r-color-fg-secondary, --r-color-fg-muted,
--r-color-fg-faint. The verbose `:global(.r-v2.r-v2-light) X { ... }`
override blocks collapse into single-token rules; tokens already
flip when html toggles between r-v2-dark and r-v2-light.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the working-rules sketch with the canonical constitution
agreed in the redesign session. Stable structure (premises →
operational rules → patterns → verification → anti-patterns → file
conventions) plus an explicit §X "Known debt" listing every
implementation task left open after this work.
Premises (13): v1 frozen; three component tiers; canonical shared
resources; tokens as SSOT; dual theme mandatory; universal input;
wrapper contract; universal substitution; Vuetify utility CSS +
our wrappers (no plain CSS); Storybook for /lib; TS strict; a11y;
performance.
Architecture patterns covered: errors & snackbars, loading states,
sockets, UI state persistence, pagination & virtualisation, forms
& validation, permissions, destructive confirmations.
§X enumerates the deferred work — virtualisation migration of
GameGrid/LetterGroupedGrid, galleryFilter→URL sync, scroll
restoration, useSocketEvent composable, call-site migrations to
useSnackbar/useWebpSupport, plus backend-side debts (ActionKey
in OpenAPI, /permissions/me, FrontendDict.IMAGES_WEBP, form error
format, typed socket event map). Each item has the architectural
context the follow-up PR will need.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
RBtn: when `loading` becomes true, the spinner only shows after
`loadingDebounce` ms (default 200). Actions that resolve faster
than that flash never paint a spinner. Going from loading →
not-loading is immediate. The clamp keeps the focus ring stable
on Save buttons, optimistic toggles, etc.
useWebpSupport: single-source resolution of FRONTEND.IMAGES_WEBP
from the heartbeat response. The 16 v2 call sites can now drop
their `as unknown as { FRONTEND?: { IMAGES_WEBP?: boolean } }`
duplication and call `toWebp(url)` instead. The cast itself stays
in one place — backend debt to add IMAGES_WEBP to FrontendDict in
OpenAPI; once regenerated, the cast disappears.
(Migration of the existing call sites is left for the next pass —
they keep working via the inline pattern; new code uses the util.)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Generic confirmation dialog with three friction levels (low / medium
embedded in feature dialogs / high via requireTyped). Mounted once
in GlobalDialogs alongside the other emitter-driven dialogs, opened
via the useConfirm() composable which returns Promise<boolean> so
call sites read as:
const ok = await confirm({ title, body, requireTyped: "DELETE" });
if (!ok) return;
Type-to-confirm is the constitution-mandated friction level for
filesystem-affecting actions; tone="danger" tints the confirm
button red; default focus lands on Cancel so a stray Enter doesn't
destroy work.
Adds two events to the canonical Events map (additive; v1 keeps
working): showConfirm carries the payload, confirmResolved routes
the user's choice back to the awaiting promise via id matching.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Centralised permission checks for v2 — closes the constitution's
"never inline-check user.role in features" rule. Three pieces:
- src/stores/permissions.ts: Pinia store holding the user's
effective grants. Today populated by hydrateFromRole() against a
role-map; tomorrow populated by setGrants() from /permissions/me.
Lives in the canonical store directory but is v2-only consumed —
v1 keeps its inline checks until removal.
- src/v2/composables/useCan: ActionKey vocabulary, scope vocabulary
({global,platform,collection,rom}), role-map mirroring backend
guards, and useCan(action, scope?) returning ComputedRef<boolean>.
installPermissionsHydration() watches authStore.user and keeps
the store in sync; AppLayout calls it on mount.
- Migrations: UserMenu.vue's isAdmin computed and SettingsNav's
Server Stats visibility gate now go through useCan("app.admin").
No more `user.role === "admin"` inline checks in v2.
Backend debt remains: ActionKey enum in OpenAPI + /permissions/me
endpoint + permissions:changed socket event. Until those land, the
role-map.ts file must be reviewed against backend role guards by
hand. Drift means the UI will offer actions the server rejects, or
hide actions it would have permitted.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three pieces of the forms / feedback layer that the constitution
calls for:
- useSnackbar(): typed convenience over the global snackbarShow
emitter event. success/error/warning/info methods plus a generic
show(). Existing call sites keep working via NotificationHost's
free-form-color collapser; new code is expected to use the
composable.
- src/v2/utils/validation.ts: pure rule helpers (required, email,
asciiOnly, lengthBetween, usernameLength/Chars, passwordLength).
Utility code is allowed to call i18n.global.t directly (the
no-i18n rule covers lib primitives, not utils). The frozen
rule arrays still living in stores/users.ts keep working for v1;
v2 new forms compose these helpers locally.
- RForm primitive (forms/RForm): wraps VForm with two QoL extras
— Enter on any field submits when validation passes, and a
failed validate() scrolls the first invalid field into view and
focuses it. Story exercises the basic submit flow; auto-picked
up by test/storybook.test.ts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Self-scrolling virtualized grid: rows are chunked from the rom array
based on a ResizeObserver-driven column count, and only the rows in
the visible window mount their GameCards. Card width and total height
are fixed via tokens (--r-card-art-w / --r-card-art-h heuristic) so
the row height stays predictable and v-virtual-scroll can window
accurately.
This is the component-level migration. Integrating it into the parent
gallery views (Platform / Search / Collection) requires their scroll
containers to delegate scroll to GameGrid (height context, no
overflow on the wrapper) and is deferred to a focused follow-up that
covers list mode and LetterGroupedGrid alongside.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wraps Vuetify's VVirtualScroll with the project's wrapper contract
(inheritAttrs: false, $attrs forwarding, slot passthrough). Items
are typed as unknown[] so consumers cast at the call site — making
the primitive non-generic keeps it usable inside Storybook
components: {} registrations, where Vue 3.4 generic components
clash with the Component record type.
Story exercises a 5000-row list to verify only the visible window
hits the DOM. Auto-discovered by test/storybook.test.ts.
This primitive is the substrate for the upcoming GameGrid and
LetterGroupedGrid migrations — both will chunk their items into
rows of fixed-width cards and feed those rows here, so libraries
with thousands of ROMs no longer mount thousands of cards at once.
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>
Drop unused imports (RTooltip in MetadataProviderChips, BackBtn in
GameDetails). Add aria-label to NotesTab textarea and proper
for/id pairing to its public-toggle checkbox label. Mark Home's
favoriteRoms with eslint-disable-next-line (false positive: used
in <template> but @typescript-eslint/no-unused-vars with
projectService doesn't see Vue templates).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add Vitest 4 with happy-dom, @vue/test-utils, and a single
test/storybook.test.ts that auto-discovers every story under
src/v2/lib and runs its play() via composeStories — no Playwright,
just composition-based interaction tests. 89 stories now smoke-pass
in CI.
Scripts: lint:fix (auto-fix), lint (now scoped to ./src/v2; v1 is
frozen), lint:all (legacy sweep), test, test:watch, test:ui,
storybook:test.
eslint.config.js gets argsIgnorePattern: "^_" so unused-by-design
parameters can use the underscore convention.
CI: new frontend.yml runs lint, test, build in parallel on
frontend/** changes; typecheck.yml bumped to Node 22 with cached
npm ci. Existing typecheck job preserved for branch protection.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Implemented RSliderBtnGroup as a segmented/tab control with a sliding indicator.
- Created stories for different variants: Segmented, Tab, and Disabled.
- Added types for SliderBtnGroupItem to define item structure.
- Introduced RSpinner component for inline loading states with stories.
- Developed RList and RListItem components with stories for list display.
- Created RToolbar component for toolbar layout with customizable properties.
- Added RTooltip component for tooltips with various activator patterns.
- Updated imports in EmulatorJS and LibraryManagement views to reflect new component paths.