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.
- Implemented Administration view with UsersTable, TokensTable, and Tasks components.
- Created ClientApiTokens view with ClientTokensTable component.
- Developed LibraryManagement view with tabs for FolderMappings, Excluded, and MissingGames.
- Added MetadataSources view displaying API key and connection status for various metadata providers.
- Introduced ServerStats view for displaying library-wide totals and per-platform breakdowns.
- Established UserInterface view for toggling between v1 and v2 UI versions, theme selection, and language settings.
- Rewrote UserProfile view for managing account details, avatar, and linked services, integrating RetroAchievements component.
- Introduced AuthCard component to standardize the layout of authentication views.
- Added AuthBackLink component for consistent navigation back to the login page.
- Replaced password input fields in Login, Register, and ResetPassword views with PasswordField component for better encapsulation of show/hide functionality.
- Removed GameContextMenu component and related context menu logic, transitioning to MoreMenu for per-ROM actions.
- Updated AppLayout and AuthLayout to utilize useThemeClass for theme management.
- Cleaned up unused variables and styles across various components to enhance maintainability.
feat: add PlatformsIndex.vue for displaying a grid of platforms with loading skeletons
fix: update bcrypt version to 4.0.1 and adjust dependencies in uv.lock
Bring in manual/soundtrack backend + shared frontend code so v2 can expose
the new media features. Resolved RomM.vue by keeping both the v2 gate and
the app-wide SoundtrackMiniPlayer; took the branch's uv.lock.