Commit Graph
5113 Commits
Author SHA1 Message Date
Georges-Antoine Assi b037276bfc Add Playwright e2e cover for permission gating
The #3954 fix is about what a read-only user can SEE, which the Vitest
specs can't reach: visibility depends on grants the backend resolves and
`useCan` projects. These drive a real instance instead.

  frontend/e2e/rom-actions.spec.ts        ⋯ menu items + divider collapse
  frontend/e2e/profile-role.spec.ts       no self-editable role control
  frontend/e2e/game-media-files.spec.ts   Media/Files upload + delete

Every spec asserts both sides -- absent for `e2e_viewer`, present for
`e2e_admin` -- so it can't pass against a page that failed to render, and
notices a fix that over-hides. Verified by reverting the fix: 8 of 15 fail,
and the 6 admin-side guards stay green.

`backend/tools/seed_e2e_users.py` seeds the two fixture users idempotently.
Specs live in e2e/ so Vitest's src/** and test/** globs skip them, and
tsconfig now covers them so they're typechecked.

Not wired into CI: that needs a backend, a database and a library fixture
in the runner.
2026-07-26 09:07:14 -04:00
Georges-Antoine Assi 4a5e37cfc0 Require the write grant alongside delete grants
A bare DELETE grant projects to no OAuth scope (`grants_to_scopes` has no
(ROMS, DELETE) row), but the delete endpoints gate on the matching *_WRITE
scope. So a group granted delete-without-write got the delete affordance,
a 403, and the interceptor's logout.

Require both grants at every delete gate: ROM delete (more-menu and bulk
selection bar), ROM file delete, and platform delete.
2026-07-26 08:38:55 -04:00
Georges-Antoine AssiandClaude Opus 5 9a032471ed Hide v2 actions the backend won't allow
A read-only user was shown ROM write actions and a role picker that the
backend refuses. Both fail badly: the role PUT reports success and then
silently reverts (the backend ignores self-role changes), and every other
action 403s, which the axios interceptor treats as an expired session and
turns into a logout.

Gate them on the grants instead:

- useGameActions exposes canEdit / canDelete / canMatch / canRefresh so
  every ROM action surface shares one permission source.
- GameActionsList hides match / refresh / edit / delete, with conditional
  dividers so the menu doesn't trail stray separators.
- The Media and Files tabs hide their upload / delete affordances for
  manuals, soundtracks, shared ROM screenshots and ROM files. The
  per-user "Mine" screenshot section is untouched: it writes user assets,
  not the ROM.
- The profile page drops the role select. Nobody can change their own
  role, so it only ever reverted; the role already shows as a chip in the
  identity row, and admins change other users' roles from Administration.

Fixes #3954

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 08:23:58 -04:00
Georges-Antoine AssiandClaude Opus 5 eb2c8c58a8 Drop the username from the v2 profile page title
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-25 22:35:24 -04:00
Georges-Antoine AssiandClaude Opus 5 23c39c0480 Set page titles across v2 views
Game details now titles the tab with the game name, and the three
players (EmulatorJS, Ruffle, Stream) with "Play <game name>".

Adds a usePageTitle composable so titles that depend on fetched data
stay in sync: the router's meta.title is resolved in the navigation
guard before the data lands, and doesn't re-run on param-only
navigations like /rom/1 -> /rom/2.

Also fills the remaining v2 gaps: /pair and /pair/device had no title,
the platforms and collections index routes had untranslated English
ones, and platform / collection / profile set theirs imperatively so
they went stale after a rename and leaked the previous page's title
onto a not-found route.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-25 22:32:51 -04:00
Georges-Antoine AssiandClaude Fable 5 49d1ae71b2 Fix smart collections dropping newer filters
Smart collections silently ignored several filters at both ends:

- The backend never applied has_soundtrack, has_saves, has_states, or
  player_counts from stored criteria, so a "has soundtrack" smart
  collection contained every game. get_roms_scalar also dropped
  has_soundtrack before it reached filter_roms.
- The v2 criteria serializer had no fields for has_saves/has_states and
  only stored tri-state filters when true, so "unmatched" or "has
  saves" produced empty criteria and the no-filters guard blocked the
  save.

Criteria now carry saves/states filters and explicit false states, the
backend applies them, and summaries render negative states with the
existing "show-not-*" labels.

Fixes #3888

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 13:53:02 -04:00
Georges-Antoine Assi 12dc30b16b Merge pull request #3949 from rommapp/fix/ejs-default-options-fresh-launch
Apply config.yaml EmulatorJS defaults on fresh launches and after setting changes
2026-07-25 13:34:59 -04:00
Georges-Antoine Assi 38784e5fa4 cleanup 2026-07-25 09:49:35 -04:00
Georges-Antoine AssiandClaude Fable 5 8ac5654ed8 Remove the inherit option from per-page boxart styles
Per-page styles now always hold a concrete style; changing the
gallery-wide style resets both to match. Legacy stored "inherit"
values display and resolve as the gallery style. The advanced
disclosure starts collapsed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 09:42:29 -04:00
Georges-Antoine Assi 8cbb635f19 Merge branch 'master' into feat/per-page-boxart-styles 2026-07-25 09:27:52 -04:00
Georges-Antoine AssiandClaude Fable 5 8208e5f6dd Skip the rom-id ratio key when the cover style diverges from the gallery
The shared measured-ratio cache keys by rom id on the assumption that
every surface renders the same artwork for a rom. With per-context
styles a details/player cover would seed from the gallery image's ratio
(wrong shape until load) and overwrite the entry the gallery packer and
back-nav morph read. Key by URL only when the resolved style differs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 09:21:04 -04:00
Georges-Antoine Assi 07eb7280ef update tests 2026-07-25 09:14:56 -04:00
Georges-Antoine Assi 7d844c735d add miximage v2 support gamelist 2026-07-25 09:13:39 -04:00
Georges-Antoine AssiandClaude Fable 5 9b2a014969 Use V2 suffix in miximage_v2 cover style labels
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 09:08:33 -04:00
Georges-Antoine AssiandClaude Fable 5 0e05f94894 Render miximage_v2 cover style in v1
The boxartStyle setting is shared across UI versions, so a value picked
in v2 reaches v1 galleries. Teach v1 to render it (square ratio, ss-only
art resolution, hover video) without adding it to the v1 selector.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 09:06:50 -04:00
Georges-Antoine AssiandClaude Fable 5 5570eece4e Apply config.yaml EmulatorJS defaults on fresh launches and after setting changes
EmulatorJS drops the EJS_defaultOptions passed from config.yaml in two
places. preGetSetting short-circuits to the saved-settings localStorage
object once any setting or control was changed, returning undefined for
keys the user never touched. getCoreSettings, which writes the RetroArch
core options file during boot, returns an empty string when localStorage
is enabled but holds no saved entry yet, so core options such as
mupen64plus-FXAA never reach the core on a fresh launch.

Install a trap on the window.EJS_emulator assignment that patches both
methods and recomputes the constructor-captured values (rewindEnabled,
videoRotation, webgl2Enabled) right after the constructor returns,
before the async core download and boot consume them. Patching in
EJS_onGameStart (where the previous fix ended up after a cleanup) is
too late: by then the GL context exists and retroarch.cfg and the core
options file are already written.

The console player installs the same trap, and the web player now looks
up core options by the resolved core instead of the nullable core prop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 09:05:12 -04:00
Georges-Antoine AssiandClaude Fable 5 77c73eaa88 Allow different boxart styles for details and play pages
Adds two ui_settings keys (boxartStyleDetails, boxartStylePlayer)
defaulting to "inherit", resolved in useCoverArt via a per-surface
context. The v2 UI settings Gallery section gains an advanced
disclosure with two override selects.

Closes #3943

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 09:05:02 -04:00
Georges-Antoine AssiandClaude Fable 5 039d06ff4e Add miximage_v2 as an available cover style
Extends the v2 BoxartStyle union with miximage_v2_path (ScreenScraper
mixrbv2 art, square ratio, hover-video like miximage), adds it to the
cover style selector in UI settings, and translates the new label in
all locales.

Closes #3942

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 08:46:40 -04:00
Georges-Antoine Assi 250e1630e1 fix fmt 2026-07-25 08:06:52 -04:00
Georges-Antoine Assi e9539dadeb use allplatforms 2026-07-25 07:39:54 -04:00
SaveEditors e626c31315 Show empty platforms in platform index 2026-07-25 01:45:47 -04:00
Georges-Antoine Assi fa64d64973 cleanup 2026-07-24 22:00:22 -04:00
Georges-Antoine Assi 140e2d48ca Merge branch 'master' into fix/v2-player-bezel 2026-07-24 21:40:32 -04:00
Georges-Antoine Assi 1c5d5364fc Merge pull request #3940 from Spinnich/fix/v2-player-stale-disc-id
fix(player): guard v2 EmulatorJS against stale saved disc id
2026-07-24 21:39:29 -04:00
Georges-Antoine Assi 93a128965b Merge pull request #3936 from Spinnich/fix/rom-detail-smart-collections
fix(roms): list the smart collections a ROM belongs to on its detail view
2026-07-24 21:38:13 -04:00
Georges-Antoine Assi e8aa14e52e cleanup 2026-07-24 20:00:15 -04:00
SpinnichandClaude Opus 4.8 dd88216973 feat(player): let users hide a game's bezel in the v2 player
A scraped bezel can be misaligned or oversized and obscure the running
game, with no way to turn it off. Add a per-game "Show bezel" switch to
the player's Setup panel, shown only when the game has a bezel. The
choice persists in localStorage (player:<romId>:bezel); bezels stay on
by default and only the hidden state is stored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 22:19:48 +00:00
SpinnichandClaude Opus 4.8 9a12786fde fix(player): render ScreenScraper bezel in v2 EmulatorJS player
The v2 player never drew a game's bezel overlay. Add it to the v2 shell
(v1 is frozen), building the image URL from the resources base like
covers / box-art so the relative bezel_path resolves to the real PNG
instead of the SPA's HTML fallback.

EmulatorJS fullscreens its own #game container, which the browser
promotes to the top layer, so a sibling overlay vanishes there. Teleport
the bezel into that container while fullscreen so it keeps framing the
game, and keep its z-index below the EmulatorJS controls.

Fixes #3939

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 20:21:41 +00:00
SpinnichandClaude Opus 4.8 092d901ede fix(player): guard v2 EmulatorJS against stale saved disc id
The v2 player restored the per-game disc choice from localStorage
(player:<romId>:disc) with a bare parseInt and never checked the id still
existed. After a rescan the rom's file ids change, so the player kept
requesting a missing file; the download endpoint 404s and EmulatorJS
surfaces it as a generic "Network Error". Single-file games were hit
hardest since they have no disc picker to recover.

Add a resolveStoredDisc helper that keeps the saved id only when it still
matches a current rom file, otherwise falls back to the first file and
flags the entry as stale so the caller drops it from localStorage. Ports
the v1 guard (d1696cd0) to v2.

Fixes #3938

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 18:40:20 +00:00
SpinnichandClaude Opus 4.8 a58370b8c0 fix(roms): hydrate smart collections for the detail overview tiles
The overview's Collections row enriches each tile (cover mosaic + rom
count) from the collections store, but the v2 AppLayout only hydrated
regular collections. On direct navigation to a ROM, a smart-collection
tile therefore fell back to a countless, coverless entry ("0 games", no
cover). Fetch smart collections alongside the regular ones so the tiles
resolve their real count and covers.

Fixes #3934

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 14:36:02 +00:00
SpinnichandClaude Opus 4.8 95d5cbfcdf fix(roms): list smart collections a rom belongs to
The ROM detail response only filled `user_collections` from a rom's
standard collections (the collections_roms join), so smart collections
were silently omitted from the detail overview's Collections row.

Add smart-collection membership to the response: `UserCollectionSchema`
gains an `is_smart` flag and a `smart_for_user` builder that keeps the
smart collections whose cached rom_ids include the rom (respecting own /
public visibility), and `DetailedRomSchema` appends them alongside the
standard ones. The v2 overview renders them with the smart kind badge and
routes them to the smart-collection view.

Fixes #3934

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 14:21:35 +00:00
Georges-Antoine Assi 7a859a2777 Merge pull request #3926 from rommapp/dependabot/npm_and_yarn/frontend/linkify-it-5.0.2
build(deps): bump linkify-it from 5.0.1 to 5.0.2 in /frontend
2026-07-23 19:47:02 -04:00
Georges-Antoine Assi d06a2cb76b Merge pull request #3927 from rommapp/dependabot/npm_and_yarn/frontend/fast-uri-3.1.4
build(deps-dev): bump fast-uri from 3.1.2 to 3.1.4 in /frontend
2026-07-23 19:43:08 -04:00
Georges-Antoine Assi 60b3e84767 Merge pull request #3923 from rommapp/feature/scan-settings-in-user-menu
Add Scan Settings to the user dropdown menu
2026-07-23 19:42:31 -04:00
Georges-Antoine Assi bb1ce5635c Merge pull request #3920 from rommapp/fix/ejs-default-settings-fallback
Keep config.yaml EmulatorJS core settings active after user changes settings
2026-07-23 19:37:15 -04:00
dependabot[bot] 73530006bc build(deps-dev): bump fast-uri from 3.1.2 to 3.1.4 in /frontend
Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.2 to 3.1.4.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](https://github.com/fastify/fast-uri/compare/v3.1.2...v3.1.4)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-23 23:36:16 +00:00
dependabot[bot] 6364d475b0 build(deps): bump linkify-it from 5.0.1 to 5.0.2 in /frontend
Bumps [linkify-it](https://github.com/markdown-it/linkify-it) from 5.0.1 to 5.0.2.
- [Changelog](https://github.com/markdown-it/linkify-it/blob/master/CHANGELOG.md)
- [Commits](https://github.com/markdown-it/linkify-it/compare/5.0.1...5.0.2)

---
updated-dependencies:
- dependency-name: linkify-it
  dependency-version: 5.0.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-23 23:36:14 +00:00
Georges-Antoine Assi 6d5c4acf86 cleanup 2026-07-23 19:30:53 -04:00
zurdiandClaude Opus 4.8 23b0217329 refactor(frontend): drive CSS targets from a shared .browserslistrc
Replace the hardcoded `build.cssTarget` version list with a single source
of truth. The browser baseline (Tailwind v4's floor) now lives in
`.browserslistrc` as `>=` floors, and vite.config derives the esbuild-style
`cssTarget` Lightning CSS needs from it. Version data comes from
caniuse-lite instead of being pinned in the build config, and any other
tool reads the same file.

No behavior change: the derived targets resolve to the same set, so the
production build still emits both `-webkit-backdrop-filter` and the
standard property for every glass surface.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 22:57:09 +00:00
Georges-Antoine AssiandClaude Fable 5 ee2d9ae7b6 Add Scan Settings to the user menu Library group
Scan Settings was reachable only through the settings sidebar. Add it
to the user dropdown's Library group, mirroring the sidebar's order,
icon, and platforms.write gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 18:45:10 -04:00
zurdi 95b337288c Merge remote-tracking branch 'origin/master' into fix/v2-backdrop-filter-lightningcss 2026-07-23 22:38:23 +00:00
zurdiandClaude Opus 4.8 9e529150f8 fix(v2): restore backdrop-filter blur in production builds
Vite 8 switched the default CSS minifier from esbuild to Lightning CSS,
which treats `backdrop-filter` and `-webkit-backdrop-filter` as the same
property and keeps only the last declared one. Every v2 glass surface
declared the standard property first and the `-webkit-` twin second, so
the minifier dropped the standard `backdrop-filter` and kept only the
`-webkit-` alias. Chrome, Edge and Firefox do not support that alias, so
the blur silently disappeared on the navbars, RMenus and every other
glass surface in the built image (dev was unaffected because it does not
minify CSS).

Fix by letting Lightning CSS manage the prefixes:
- Add `build.cssTarget` so the minifier auto-prefixes from the standard
  property. This is the only knob that drives the minify path
  (`css.lightningcss.targets` is ignored there).
- Remove all hand-written `-webkit-backdrop-filter` declarations, which
  were the trigger and are now generated automatically for Safari.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 22:14:25 +00:00
Georges-Antoine AssiandClaude Fable 5 810854ad93 Keep config.yaml EmulatorJS defaults active after user setting changes
EmulatorJS' preGetSetting short-circuits to the saved-settings
localStorage object once any setting or control was changed, returning
undefined for every key the user never touched. That silently dropped
the config.yaml defaults passed via EJS_defaultOptions (webgl2Enabled,
rewindEnabled, core options) while the settings menu still displayed
them as active. Trap the EJS_emulator assignment and patch the
instance so unsaved keys fall back to the defaults per-setting, then
recompute the values the constructor captured before the patch could
take effect.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:49:19 -04:00
Georges-Antoine AssiandClaude Fable 5 00fe9ccddb Default EmulatorJS netplay username to the RomM account
EmulatorJS keeps the netplay player name in memory only and shows its
name popup whenever netplay.name is unset, forcing users to retype a
name every session. Preset it from the logged-in RomM username in the
existing netplay override block, so the popup is skipped and the
account name is used automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:48:21 -04:00
Georges-Antoine Assi e2827b9886 Merge branch 'master' into fix/server-stats-breakdown-perf 2026-07-23 15:50:08 -04:00
Georges-Antoine Assi 5744e2e518 Merge pull request #3896 from tmgast/feature/music-playlists
Add music favorites and playlists API
2026-07-23 15:14:54 -04:00
SpinnichandClaude Opus 4.8 70478c88d3 fix(stats): degrade gracefully when the stats breakdown fetch fails
The v2 Server Stats view loads the summary first, then the heavier
per-platform breakdown as a second request. A rejection from that second
request propagated out of the async lifecycle hook as an uncaught error
instead of leaving the summary and platform rows usable. Catch it so the
page degrades to partial data.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 18:42:18 +00:00
SpinnichandClaude Opus 4.8 f69e4756a7 perf(stats): aggregate server-stats breakdowns from roms_facets
The Server Stats page ran two full scans of the multi-gigabyte `roms`
table on every visit: the metadata-coverage breakdown counted eleven
provider-id columns per platform, and the region breakdown pulled every
row's regions into Python. Both were returned in the same request as the
cheap summary counts, so the whole page stayed blank until they finished.

Mirror the provider match ids into the narrow `roms_facets` table
(migration 0102, kept in sync by the same triggers as the existing facet
columns) and read both breakdowns from it, so neither query touches
`roms`. Split the v2 Server Stats view into a summary-first request and a
separate breakdown request so the six top cards render immediately.

Fixes #3901

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 17:27:09 +00:00
Spinnich bc073f6ace Merge remote-tracking branch 'upstream/master' into fix/server-stats-duplicate-slug-key
# Conflicts:
#	frontend/src/v2/components/Settings/PlatformsStatsSection.test.ts
2026-07-23 16:08:56 +00:00
SpinnichandClaude Opus 4.8 889f73f37e test(v2): fix stale row-count comment in platform stats test
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 15:37:56 +00:00