Commit Graph

5165 Commits

Author SHA1 Message Date
Georges-Antoine Assi
2bdd1956fc Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-01 17:58:43 -04:00
Georges-Antoine Assi
674b7f22dc fix(rom-details): render the manual viewer on mobile
Two independent faults left the Media tab's Manual panel as an empty frame
on phones:

* vue3-pdf-app wires its toolbar controls by `id` on mount and abandons the
  whole viewer when one is missing, so hiding the prev/next page buttons with
  `v-if` at the xs breakpoint stopped any page from ever being laid out. The
  buttons now always render and are hidden with CSS instead.
* RDropzone declares `inheritAttrs: false` without ever binding `$attrs`, so
  the sizing class its consumers pass was dropped. On desktop the fixed-height
  chain hid that; on mobile, where the details view scrolls as one document,
  nothing gave the viewer a height and it collapsed to the toolbar.

The dropzone now forwards attrs, the manual viewer takes an explicit viewport
slice on mobile, and the soundtrack panel opts out of the zero-basis fill
there so it keeps sizing to its content.

Fixes #4046

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 17:43:32 -04:00
Georges-Antoine Assi
0c06c19d2d Merge pull request #4056 from rommapp/feat/random-pick-widget-polish
feat(home): make the random pick widget clickable and denser
2026-08-01 17:21:50 -04:00
Georges-Antoine Assi
a5ec7e9e55 fix(home): stop reporting a failed random pick as an empty library
The widget nulled its pick on any error, so a transient failure on
reroll swapped a good pick for the "No games loaded yet" copy. Failures
now keep the current pick and surface an error snackbar, the card's
fallback text distinguishes a failure from an empty library, and a page
that comes back empty (the cached id index drifting from the database)
is retried once before it counts as one.

Both calls also opt out of the char index, filter values and rom id
index, which the endpoint returns by default and which span the whole
library: a reroll drops from ~463KB to ~15KB on a 75k-rom library.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:49:43 -04:00
Georges-Antoine Assi
4a19f65b81 fix(home): disable the reroll button while a pick is in flight
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:28:33 -04:00
Georges-Antoine Assi
cf44d5174a Merge pull request #4055 from rommapp/fix/scan-firmware-already-known
fix(scan): report only newly discovered firmware
2026-08-01 16:27:48 -04:00
Georges-Antoine Assi
84b1155a71 fix(home): only turn the die on a reroll that runs
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:25:14 -04:00
Georges-Antoine Assi
3ca53d3a35 feat(home): make the random pick widget clickable and denser
Drop the "Open" button: the cover and title now link to the rom. The
freed space shows the platform and the release year / region so the
pick is identifiable when a library holds several variations of the
same title. Reroll moves to the card's top-right action slot and
shows a readable die face that changes on every roll.

Closes #4048

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:20:12 -04:00
Georges-Antoine Assi
372d34752d fix(scan): report only newly discovered firmware
The scan:scanning_platform payload carried the platform's total
firmware_count, so the scan view showed a firmware chip and expanded the
panel on every re-scan of an unchanged library. The panel body only lists
ROMs, leaving an empty card.

Emit the firmware count scoped to the running scan instead, and key the
auto-expand off the ROM list alone.

Fixes #4049

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:19:58 -04:00
Georges-Antoine Assi
06ebacad5a chore(settings): shorten heartbeat refresh comment
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:09:41 -04:00
Georges-Antoine Assi
06556fcc79 fix(gallery): show region and language flags on v2 covers
v2 exposed the "Show regions" and "Show languages" settings but nothing
consumed them, so covers lost the region and language emblems that 4.x
showed. Add a CardFlags overlay to GameCard: up to three emoji per chip
with the full list in the hover title, fading out under the hover overlay
so it never collides with the action row.

Fixes #4027
2026-08-01 14:12:41 -04:00
Georges-Antoine Assi
bcbf771d3f fix(settings): refresh filesystem folders when opening folder mappings
The folder-mapping table lists FS_PLATFORMS from the heartbeat snapshot
taken at app init, so a folder created after that only showed up after a
full page reload. Refetch the heartbeat when the section mounts.

Fixes #4035
2026-08-01 14:12:41 -04:00
Georges-Antoine Assi
b475196327 fix(frontend): reload once when a stale chunk fails to load after a deploy
Hashed asset names change on every deploy, so a tab left open across an
upgrade 404s on its next lazy import and goes blank until the user
reloads by hand. Listen for `vite:preloadError` and for router
dynamic-import failures, and reload once. A session-scoped timestamp
guards against a reload loop when an asset is genuinely missing.

Fixes #4034
2026-08-01 14:12:41 -04:00
Georges-Antoine Assi
286ccff5a1 feat(match): show the ROM file name in the match dialog header
The match dialog covers the gallery card it was opened from, hiding the
file name, which is the one piece of ground truth when re-matching a
mismatched game. Show it next to the dialog title, truncated to a single
line with the full name in the hover title.

Fixes #4038
2026-08-01 14:12:41 -04:00
Georges-Antoine Assi
48c2a75192 fix(platform): show tooltips on passive metadata provider chips
Provider chips without a link (HowLongToBeat, Libretro, Flashpoint) were
styled with `pointer-events: none`, which also suppressed the native
`title` tooltip, leaving those icons unlabelled. Drop only the pointer
affordance and keep the chip hoverable.

Fixes #4040
2026-08-01 14:12:40 -04:00
Georges-Antoine Assi
f26c3234d7 fix(auth): return 401 for unauthenticated requests, keep 403 for missing scopes
Protected routes answered 403 both when there was no session and when the
authenticated user lacked the required scope. The frontend read every 403
as session expiry, cleared the session cookie and redirected to /login, so
a permission denial (for instance saving a state without the save scope)
tore down whatever the user was doing, including a running emulator.

`protected_route` now uses its own scope guard that raises 401 with a
`WWW-Authenticate` header when the caller is unauthenticated, and 403 when
the caller is authenticated but under-scoped. The axios interceptor only
redirects on 401 and lets 403s surface inline to the caller, refreshing the
CSRF cookie when the backend rejected the CSRF token.

Endpoint assertions for unauthenticated requests move from 403 to 401;
authenticated under-scoped cases stay 403.

Fixes #4045
2026-08-01 14:12:40 -04:00
Georges-Antoine Assi
6362091bb4 remove unnecessary admin page 2026-08-01 10:44:35 -04:00
Georges-Antoine Assi
80e58d59b3 Merge pull request #4025 from rommapp/fix/player-resume-source
fix(player): skip the save load a state immediately discards
2026-07-30 21:47:31 -04:00
Georges-Antoine Assi
702aa00a2d fix(player): drop the resumeFrom prop and let the state win
Keep the save prop as the write-back target for "Save & Quit" without
adding a second prop to say which asset boots: when both a save and a
state are selected, the session resumes from the state.

The save is no longer loaded right before a state overwrites it, so the
outcome is the same but without the discarded SRAM injection.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 21:43:51 -04:00
Georges-Antoine Assi
b7d0625c21 Merge pull request #4022 from rommapp/feat/autofocus-search-field
feat(frontend): autofocus the search field on the Search view
2026-07-30 21:32:24 -04:00
Georges-Antoine Assi
091749976f chore(frontend): trim autofocus-search comments in GalleryShell
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 21:26:59 -04:00
Georges-Antoine Assi
20e416e752 fix(player): resume from the picked asset instead of always the state
The v2 player armed a save and a state independently and handed both to
<Player>, which applied the save and then the state. A savestate restores
the whole machine (SRAM included), so the save was always discarded when
any compatible state existed.

Split the two roles the `save` prop was serving: it stays the write-back
target for "Save & Quit", while a new `resumeFrom` prop says which asset
actually boots. The v2 shell passes the visible tab, so the AssetPreview
("Resume from save/state") and what loads can no longer disagree.

v1 keeps save and state mutually exclusive, so it leaves `resumeFrom`
unset and falls back to the previous precedence.

Fixes #4010

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 21:03:54 -04:00
Georges-Antoine Assi
9509a1e355 fix(v2): pivot to a filtered search from the overview info grid
Genre / company / franchise / collection chips were plain spans with a
hover affordance but no behavior, dropping the pivot-to-search v1 offered
from the same rows. Sections now carry the gallery filter their items map
to, and the chips render as links into the search view scoped to that
value. Links rather than click handlers, so middle-click and open-in-new-
tab work and the chips join keyboard / spatial navigation.

Fixes #4011

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 21:03:54 -04:00
Georges-Antoine Assi
c7a2cad6ad feat(frontend): autofocus the search field on the Search view
Opening Search (navbar button or the "/" hotkey) left focus nowhere, so
typing right away did nothing. The toolbar's search field now takes focus
on mount, gated to precise-pointer, non-gamepad devices: touch would pop
the on-screen keyboard uninvited, and a focused text field swallows the
gamepad's synthetic arrow keys.

`shouldAutofocusSearch` moves out of RSelect into v2/utils, since it is
now shared policy rather than an RSelect internal.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 21:03:40 -04:00
Georges-Antoine Assi
2b6853a221 Merge pull request #4015 from rommapp/fix/scan-region-language-reorder
Reorderable region and language priority lists in scan settings
2026-07-30 19:28:15 -04:00
Georges-Antoine Assi
7228165b6f Merge pull request #4014 from rommapp/fix/rselect-menu-overflow-and-separator
fix(v2): keep RSelect menus inside the viewport and tidy the selection text
2026-07-30 19:25:46 -04:00
Georges-Antoine Assi
8f2a361c79 Merge pull request #4012 from rommapp/fix/v2-prev-next-game-buttons
feat(v2): previous / next game buttons on the details page
2026-07-30 19:05:36 -04:00
Georges-Antoine Assi
aae4d1d9f4 fix(v2): gate prev/next arrows on real gallery provenance
The gallery store keeps `romIdIndex` alive after the user leaves the gallery,
so membership in that list wasn't evidence the user was still browsing it: a
ROM opened from Home, Activity or a scan result could inherit the previous
gallery's neighbours and offer to step through a list it has nothing to do
with. Track how the details chain was entered and require a gallery
click-through, while leaving rom-to-rom hops and play sessions armed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 18:37:16 -04:00
Georges-Antoine Assi
4dc3b75d30 feat(v2): reorderable region and language priority lists
The region and language fields in scan settings used a chip combobox,
which only appended at the end and removed from the end: reordering or
dropping a middle entry meant clearing the field and retyping it.

Both now use ScanPriorityList, the same ordered-row control the metadata
and artwork provider lists use, so entries can be dragged, moved with the
up/down buttons, and removed individually.

ScanPriorityList grows an `allow-custom` mode for these open sets: a
free-text field commits on Enter, splits comma or whitespace separated
input, and lowercases and deduplicates to match how the backend stores
the codes. The known codes stay available as one-click suggestions.

Fixes #3999

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 14:56:02 -04:00
Georges-Antoine Assi
1dd36cc58d feat(v2): previous / next game buttons on the details page
Restores the v1 gallery-stepping affordance in the v2 details view. A new
PrevNextNav composite reads the current ROM's position from the v2 gallery
store's ordered `romIdIndex`, so the order matches whatever gallery the user
came from (filters, sort, grouping included), and hides itself when the ROM
isn't part of a list (direct link, related-game jump, Home row).

Fixes #3998

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 14:53:42 -04:00
Georges-Antoine Assi
8ddf855fc5 fix(v2): keep RSelect menus inside the viewport and tidy the selection text
The `size` middleware capped the panel with
`min(360px, var(--available-height, 360px))`, but `--available-height` is
never defined, so the cap was always a hard 360px no matter how much room
the activator actually had. `flip` then placed a 360px panel into a
smaller gap and the menu spilled past the viewport edge: at a 500px
viewport the search field could land 66px above the top, or the list 106px
below the bottom. Use floating-ui's real `availableHeight`, as RMenu
already does.

A multi-select without chips rendered each title and each "," separator as
a direct child of `.r-select__value`, a flex row with a 6px gap, so the
separator picked the gap up on both sides and the activator read "A , B".
Give the run its own box.

Also focus the in-panel search field with `preventScroll`: it autofocuses
on mount, which is before floating-ui places the panel, so the UA would
scroll to the panel's pre-placement box at the viewport origin.

The 2D/3D media labels disagreed in every locale ("Box art (2D)" vs
"3D box art"); settle on the parenthesised form.

Fixes #4000

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 14:53:37 -04:00
Spinnich
fdb000576a perf(roms): stop the Missing tab scanning the whole library
Settings -> Library Management -> Missing made three whole-library passes
per request, two of which produced data the page never renders, and none
of which could be cached because "missing" counts as a filter.

- The tab now opts out of the char index, the filter values and the
  ordered id index, so the endpoint serves its total from a plain COUNT.
- `missing_from_fs` gets a composite index with `name_sort_key`, and the
  filter compiles to an equality: MariaDB does not treat `IS NOT FALSE`
  as indexable, so the index would otherwise only ever be scanned end to
  end. The column is NOT NULL, so both forms match the same rows.
- The filter-value list is keyed on the scope (search / platform /
  collection) alone. It is built from a query that never applies the
  row-level filters, so a filtered request now answers with, and warms,
  the same whole-library entry an unfiltered one does.

Fixes #3992

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 12:13:03 +00:00
Georges-Antoine Assi
ff8d4d0d5d Merge pull request #3986 from rommapp/fix/launchbox-cloud-empty-store
fix(launchbox): stop the cloud provider from silently matching nothing
2026-07-28 23:09:10 -04:00
Georges-Antoine Assi
57f4fd21d0 cleanup 2026-07-28 23:01:07 -04:00
Georges-Antoine Assi
e8aa2f5afd fix(gallery): pack placeholder covers at the active boxart ratio
The grid flow-packs rows in JS from each card's real width
(cardHeight * coverRatio), and rows render nowrap with flex-shrink: 0 —
so an underestimated width overflows the viewport instead of wrapping.
Ratios are measured on cover load, but a rom with no cover paints its
placeholder at the boxart style's ratio and never measures, so the
packer's hardcoded 2/3 under-reserved its width and let an extra card
into the row.

The packer now takes the style ratio as its fallback for any position
without a measured cover, which also covers the pre-load paint of every
card in a non-2/3 gallery.

Fixes #3984

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 22:36:39 -04:00
Georges-Antoine Assi
ad07bafbd1 fix(tasks): load the task list when the tasks page opens
The list was fetched once at app boot, inside a bootstrap that runs
before anyone is logged in. /tasks needs the tasks.run scope, so any
session established after boot (any login without a reload) left the
watcher, scheduled and manual lists empty for the rest of the page load,
in both UIs. For a logged-in non-admin the same call 403'd on every page
load and tripped the interceptor's redirect to login.

Fetch on mount from the pages that need it instead.

Fixes #3981

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 22:22:13 -04:00
Georges-Antoine Assi
85351739e8 fix(platforms): use a clearer icon for the include-empty filter
mdi-select-all is a marquee-selection glyph, so it read as an action
rather than a filter state. mdi-asterisk carries the wildcard
"everything" meaning the segment actually has.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 20:11:09 -04:00
Georges-Antoine Assi
52940ea3d4 fix(launchbox): stop the cloud provider from silently matching nothing
LaunchBox cloud lookups read from a Redis store that only the metadata
update task fills, but nothing surfaced when that store was empty. The
provider reported healthy, every search returned zero results, and the
logs said nothing.

- heartbeat now reports unhealthy until the store is populated, and an
  empty store logs what to set to fix it
- the update task can be run manually whenever LAUNCHBOX_API_ENABLED is
  on, instead of also requiring the scheduled-update flag
- the ~600k entry dump was buffered into a single pipeline, peaking at
  1.7GB of RSS and writing nothing at all if the job was killed part way
  through. Writes now go out in batches and parsed elements are dropped
  as they are consumed, which caps the run at ~260MB. The task also gets
  its own timeout, since the default 5 minutes does not cover a 100MB
  download plus a 500MB parse
- alternate name lookups ignored the platform, so "Super Mario World" on
  PlayStation matched Super Mario Bros.
- Coleco ADAM was spelled wrong, and Famicom / Super Famicom pointed at
  platform names LaunchBox does not use

Fixes #3981

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 19:55:16 -04:00
Georges-Antoine Assi
8abd192163 fix(v2): batch URL query writes so concurrent toolbar filters don't stomp
`router.replace` is async, so `route.query` keeps reading the pre-navigation
value. Two URL-backed controls changing in the same flush each built their
next query from that stale snapshot, and the second navigation won with a
query that never saw the first one's key.

Reachable today on the Collections index: picking the "virtual" kind also
clears the visibility filter in the same flush, and the clear dropped
`?kind=virtual`.

Route every writer (search, view mode, Platforms and Collections filters)
through `patchQuery`, which merges patches and issues one navigation per
tick.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 18:41:15 -04:00
Georges-Antoine Assi
ba83af5caf fix(platforms): hide empty platforms behind a toolbar filter
The Platforms index switched to allPlatforms, so every leftover 0-game
platform row rendered in the grid, burying real libraries under hundreds
of stubs.

Empty platforms are hidden again by default and surface through a new
segmented toolbar cluster, URL-synced as ?show=all. They stay reachable
(and deletable) that way, so they don't become stranded in the database
again.

Fixes #3979

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 18:32:44 -04:00
Georges-Antoine Assi
81d740c5bd Merge pull request #3976 from rommapp/fix/rom-artwork-nested-game-media
fix(frontend): only treat top-level game folder files as media assets
2026-07-28 18:20:11 -04:00
Georges-Antoine Assi
1598c3ac69 fix(frontend): only treat top-level game folder files as media assets
The v2 details view scooped every image/video inside a multi-file ROM
folder into the artwork resolver, so a Wii U dump shipping cutscenes as
content/Movie/*.mp4 rendered dozens of <video preload="metadata">
elements at once. The resulting burst of Range requests saturated the
backend and hung the page for minutes.

Library media now has to sit at the top level of the game folder, which
is what "a trailer or artwork dropped next to the ROM" meant all along.
Nested files are game data; nested assets that are genuinely media
(screenshots, soundtrack, manual) already have their own surface via
their category.

Fixes #3975

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 09:15:16 -04:00
seffignoz
f2161609e7 fix(v2): reload document for EmulatorJS player 2026-07-27 19:44:10 -04:00
Georges-Antoine Assi
3b9ac86c83 Always allow changing the virtual collection type
The selector was gated on `showVirtualCollections`, a home-page toggle
that defaults to off, so the control was disabled out of the box. The
grouping type is not home-only: the collections index and the collection
gallery read it and fetch virtual collections regardless of that toggle.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 18:43:11 -04:00
dependabot[bot]
a34cea218a build(deps): bump postcss from 8.5.15 to 8.5.23 in /frontend
Bumps [postcss](https://github.com/postcss/postcss) from 8.5.15 to 8.5.23.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.15...8.5.23)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-26 19:20:07 +00:00
Georges-Antoine Assi
cd48aa761f cleanup 2026-07-26 14:14:07 -04:00
Georges-Antoine Assi
9e5582230d Sign in once per role instead of per test
Every spec drove the login form, which is 15 UI logins to test something
login.spec.ts can cover on its own.

auth.setup.ts now runs first as its own project, logs each fixture user in
once and saves the session (cookies plus localStorage) to playwright/.auth/.
Specs pick an identity with `test.use({ storageState })` and start signed in.
That is preferred over building a context by hand, which would silently drop
the project's options -- baseURL, the blocked service worker, viewport.

login.spec.ts is the one place the form is exercised, on a deliberately
unauthenticated page, and it gained cover the suite never had: a rejected
password and the redirect for an anonymous visitor.

Suite: 33s -> ~19s, with 18 tests instead of 15. Verified three times against
the build and once against the dev server.
2026-07-26 14:08:37 -04:00
Georges-Antoine Assi
f05c4238fd slim readme 2026-07-26 14:00:06 -04:00
Georges-Antoine Assi
33b224f2c3 Serve a build in CI instead of the dev server
Replaces the global-setup warm-up. The warm-up existed to absorb Vite's
on-demand compilation and its "optimized dependencies changed. reloading"
force-reload; serving a static build means neither happens, so the workaround
is unnecessary rather than merely cheaper.

`vite preview` inherits `server.proxy` (`proxy: preview?.proxy ?? server.proxy`),
so /api and /ws still reach the backend -- an earlier comment claiming preview
ignores the proxy was wrong. Build is ~5s and the suite drops from ~3.7min to
~35s. Local runs stay on the dev server so a change is picked up without a
rebuild; `CI=1 npm run test:e2e` opts into the CI path.

Repetition against the build then exposed two races the dev server had been
masking, both real bugs in the specs rather than infrastructure:

* Assertions ran before `/permissions/me` hydrated the grants store, so an
  admin's menu was read pre-hydration and looked like a permissions bug.
  `gotoHydrated()` now waits for that response and for the app bar to render,
  and the presence assertions use `expect.poll` instead of a one-shot read.
* The PWA service worker precaches ~9MB, re-installed on every fresh context
  and caching between runs. Blocked via `serviceWorkers: "block"`.

Six consecutive runs against the build: 15/15, no flakes, ~33s each.
2026-07-26 13:46:00 -04:00
Georges-Antoine Assi
2dbb2a7fbe cleanup 2026-07-26 13:22:22 -04:00