Commit Graph

10495 Commits

Author SHA1 Message Date
Georges-Antoine Assi
80a1ea18f8 fix(v2): order artwork images before videos, narrow filter with type guard
Sort library media so image entries precede video entries (stable sort
keeps original order within each group), and use a type-predicate filter
so the result stays typed as RomArtworkEntry[].

Generated-By: PostHog Code
Task-Id: fad7faa2-a17e-4583-a816-1b9915ba138f
2026-07-07 11:00:13 -04:00
Georges-Antoine Assi
3e1212e38d cleanup 2026-07-07 10:57:53 -04:00
Georges-Antoine Assi
acbd8feff8 import i18n correctly 2026-07-07 10:53:00 -04:00
Georges-Antoine Assi
65f29fe383 remove has_manual_files 2026-07-07 10:47:15 -04:00
Georges-Antoine Assi
9096fad433 refactor(v2): make RCarousel generic over its item type
Type the #item/#thumbnail slot payloads by inferring T from the `items`
prop, so consumers drop the per-slot casts. Props move to a sibling
types.ts (RCarouselProps<TItem>) since an inline interface leaks into the
generic component's default export.

Generated-By: PostHog Code
Task-Id: fad7faa2-a17e-4583-a816-1b9915ba138f
2026-07-07 10:40:49 -04:00
Georges-Antoine Assi
2c44ae25e5 simplify resolve artwork 2026-07-07 10:30:27 -04:00
Georges-Antoine Assi
3348d9bb29 cleanup 2026-07-06 22:17:56 -04:00
Georges-Antoine Assi
15e24629a3 feat: display library media files in artwork gallery and overview
Generated-By: PostHog Code
2026-07-06 21:54:44 -04:00
Georges-Antoine Assi
5c0e396328 Merge pull request #3699 from rommapp/posthog-code/clarify-sync-negotiate-slot
docs(sync): clarify slot pairing behavior in negotiate OpenAPI spec
2026-07-06 18:26:47 -04:00
Georges-Antoine Assi
faf61b22d2 docs(sync): clarify slot pairing behavior in negotiate OpenAPI spec
The /api/sync/negotiate endpoint pairs saves on (rom_id, slot) and
excludes null-slot server saves from pairing, so a client save sent with
slot=null always negotiates as an upload even when an identical file
exists on the server. This is intentional but was undocumented, which
led to confusion (issue #3697).

Add Field descriptions to the request and response schemas and expand
the endpoint docstring to explain the pairing rule and recommend a
stable slot name (e.g. "autosave"). Regenerate frontend types.

Generated-By: PostHog Code
Task-Id: 9f1c9eee-6365-4223-8cd1-b50e7d7b9cf0
2026-07-06 18:18:42 -04:00
Georges-Antoine Assi
0be2e3e376 Merge pull request #3698 from rommapp/posthog-code/fix-unauth-scan-socket
fix(sockets): require TASKS_RUN scope for scan and scan:stop
2026-07-06 18:06:05 -04:00
Georges-Antoine Assi
a17f09ad57 refactor(sockets): drop underscore prefix from cross-file scan helpers
reject_unauthorized_scan and should_scan_rom are imported from the test
module, so they are not private to scan.py; drop the leading underscore.

Generated-By: PostHog Code
Task-Id: 54ea2f32-9e01-404d-885c-543d8685abdd
2026-07-06 16:31:00 -04:00
Georges-Antoine Assi
9af51f52bd fix(sockets): require TASKS_RUN scope for scan and scan:stop
The scan and scan:stop Socket.IO handlers performed no authorization, so
any client reaching /ws could trigger a full library rescan (including a
complete scan that deletes on-disk media before re-fetching) or abort an
administrator's in-progress scan without any credentials.

Gate both handlers on the same TASKS_RUN scope the REST task endpoints
require, resolved from the server-side session identity stored on connect
rather than from any client-supplied value.

Generated-By: PostHog Code
Task-Id: 54ea2f32-9e01-404d-885c-543d8685abdd
2026-07-06 16:24:46 -04:00
Georges-Antoine Assi
527a4bb1ae Merge pull request #3695 from rommapp/posthog-code/patcher-upload-any-game
feat(patcher): always show patcher tab and allow uploading a patch
2026-07-06 16:20:12 -04:00
Georges-Antoine Assi
66b766f56c feat: preselect game platform and reorder patcher upload fields
Preselect the ROM's own platform in the patcher upload target and move
the platform dropdown below the output filename field.

Generated-By: PostHog Code
Task-Id: 2245878d-8f72-4dd7-aadf-781a8edde9fe
2026-07-06 16:14:02 -04:00
Georges-Antoine Assi
26bf69cbe9 Merge branch 'master' into posthog-code/patcher-upload-any-game 2026-07-06 15:12:08 -04:00
Georges-Antoine Assi
67d15a36d4 Merge pull request #3694 from rommapp/posthog-code/virtual-collections-metadata-sources
fix: generate virtual collections from all metadata sources
2026-07-06 15:11:23 -04:00
Georges-Antoine Assi
3b01f125e6 fix: show loading state while slow virtual collections load
The collections index gated its skeleton and empty state only on
fetchingCollections, so a slow virtual fetch (the "all" type on large
libraries) left the "no collections yet" empty state on screen for 10s+.
Gate loading on all collection kinds and add a virtual-section skeleton
for when curated collections are already present.

Generated-By: PostHog Code
Task-Id: 66644ee6-e16d-4b19-8ee3-8d91ca932e02
2026-07-06 14:49:55 -04:00
Georges-Antoine Assi
79565f7280 remove IGDB 2026-07-06 14:33:55 -04:00
Georges-Antoine Assi
68afb247ef Merge pull request #3696 from rommapp/posthog-code/gallery-tab-nav
fix(v2): gallery focus-ring and tab-order polish
2026-07-06 14:23:21 -04:00
Georges-Antoine Assi
d2437a365e Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-06 14:14:24 -04:00
Georges-Antoine Assi
10254ac079 revert(v2): restore useGridNav to master
Back out all gallery grid tab-navigation changes (single-tab-stop roving
and its test); this will be tackled on a separate branch. The focus-ring
fixes (RBtn, RTabNav) and the scroller tabindex opt-out (GalleryShell)
are unrelated and stay.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 14:13:05 -04:00
Georges-Antoine Assi
cf9b403544 refactor(v2): remove gallery card-action row navigation
Drop the in-card action access from the gallery grid entirely: the
gamepad X/Y entry point, the in-action-row arrow/Escape nav, the
cellActions helper, GameCard's :focus-within overlay reveal, and the
related test. The grid keeps card-to-card nav and a single tab stop;
a card's actions are reached via the detail page.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 14:03:45 -04:00
Georges-Antoine Assi
f90815eff6 revert(v2): remove AlphaStrip keyboard roving
Drop the single-tab-stop + arrow/Home/End roving added to AlphaStrip and
its test; the strip returns to native per-letter tabbing. No useGridNav
changes backed the strip (its roving was self-contained), so nothing else
to unwind there.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 13:58:43 -04:00
Georges-Antoine Assi
d1ea571e0e refactor(v2): drop ContextMenu/Shift+F10 card-action trigger
Remove the keyboard triggers for entering a card's action row; gamepad
X/Y remains the way in (with D-pad + B for nav/exit). Keeps the action
row out of scope for a keyboard trigger until a non-conflicting key is
chosen.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 13:53:30 -04:00
Georges-Antoine Assi
4c26a1c846 revert(v2): drop Space as card-action trigger (clashes with multi-select)
Space already toggles a card's selection in multi-select, so it can't
double as the "open card actions" trigger. Back to ContextMenu / Shift+F10
(keyboard) and gamepad X/Y; a macOS-friendly keyboard trigger is TBD.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 13:51:04 -04:00
Georges-Antoine Assi
e3557889ea fix(v2): make card-action access work on macOS keyboards
The ContextMenu key and Shift+F10 don't exist / aren't context-menu
shortcuts on macOS, so keyboard users there had no way into a card's
actions. Add Space as the cross-platform trigger (only when focus is on
the card itself), keeping ContextMenu / Shift+F10 for Windows / Linux and
gamepad X/Y. Space is always swallowed on a card so it never scrolls the
grid.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 13:45:39 -04:00
Georges-Antoine Assi
41afc95481 feat(v2): keyboard/gamepad access to a card's actions in the gallery
The single-tab-stop grid keeps a GameCard's overlay action buttons
(status/download/favorite/more/play) out of the Tab order, so they were
unreachable without a mouse. useGridNav now lets the ContextMenu key /
Shift+F10 (keyboard) or X/Y (gamepad) drop focus into the focused card's
action row; from there Arrow keys move between the actions and Escape
returns to the card. GameCard keeps its overlay revealed on :focus-within
so the actions are visible while navigating them. Adds tests.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 11:55:33 -04:00
Georges-Antoine Assi
4231e8513d perf: factor roms_metadata join into a single base CTE
The virtual_collections view joined roms_metadata (itself a heavy
COALESCE/JSON view) once per collection type, evaluating it ~5x per
listing. Factor the roms<->roms_metadata join into a single base CTE
that each collection CTE unnests from. Output is identical.

Generated-By: PostHog Code
Task-Id: 10289bf4-b0d0-4856-80c9-1be93c926f37
2026-07-06 11:48:52 -04:00
Georges-Antoine Assi
64ab9c6f4d Merge pull request #3693 from rommapp/posthog-code/fix-platform-variant-rename
fix(platforms): stop platform variants from renaming the parent platform
2026-07-06 11:34:48 -04:00
Georges-Antoine Assi
5d604fb604 feat(v2): single tab stop for gallery grid and AlphaStrip
Revert the gallery grid to a single-tab-stop model: Tab lands on the
active/first card, Arrow keys do the 2D nav, and the next Tab leaves to
the following region. Hidden in-card overlay buttons stay out of the tab
order.

Apply the same pattern to AlphaStrip: it's now one tab stop (the current
letter, else the first available), with Arrow Up/Down + Home/End moving
between the available letters and skipping unavailable ones. Adds tests.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 11:23:59 -04:00
Georges-Antoine Assi
affc739f7e feat(v2): improve keyboard tab navigation in the gallery
- useGridNav: keep every card in the Tab order (Tab walks card → card)
  while pulling the hidden in-card hover-overlay action buttons out of it
  (tabindex="-1"), applied eagerly on mount and re-synced as virtualised
  rows mount/unmount. Adds tests.
- GalleryShell: opt the virtual scroller out of the tab order
  (tabindex="-1") so Tab no longer lands on the scroll container.
- RBtn: stop the scoped `outline: none` from swallowing the global
  modality-gated focus ring; only clear the native UA outline for
  non-focus-visible (mouse) focus, so keyboard/pad show the branded ring.
- RTabNav: replace the outline focus ring (clipped into vertical slivers
  by the nav's overflow) with a contained, rounded inset focus highlight.

Generated-By: PostHog Code
Task-Id: 2dcae833-1422-499e-bf58-0c555cf5e96e
2026-07-06 11:02:56 -04:00
Georges-Antoine Assi
32757d838a feat(patcher): always show patcher tab and allow uploading a patch
The v2 patcher tab now appears for every game, not only ROMs that bundle
nested patch files. The patch source can be either a library patch file
(as before) or a patch uploaded from disk, which is applied server-side
and never stored in the library, so users don't have to keep patches
around until they need them. Download and upload-to-RomM options are
unchanged.

Backend: POST /roms/{id}/patch now accepts multipart form data with
either patch_file_id or an uploaded patch_file (exactly one). The upload
is streamed to a temp dir in bounded chunks, validated for extension and
size, applied, and removed after streaming. Scope stays ROMS_READ since
the patch is temp-only.

Frontend: added a Library/Upload source toggle (shown only when the ROM
bundles patches) using RDropzone, and the request now sends FormData.
Regenerated OpenAPI types and dropped the now-unused no-patch-files key.

Generated-By: PostHog Code
Task-Id: d0fc3734-585d-44bc-aaa9-481a3cd6a23b
2026-07-06 10:39:11 -04:00
Georges-Antoine Assi
602faccc5c fix: generate virtual collections from all metadata sources
The virtual_collections view read only roms.igdb_metadata, so franchises,
genres, companies and play modes set manually or provided by non-IGDB sources
(ScreenScraper, Flashpoint, gamelist) never produced auto-generated
collections, even though the same values already drove /api/roms filtering and
the game detail page.

Redefine the view to source each grouping from the roms_metadata view, which
coalesces manual and provider metadata in priority order. Matching values now
merge into a single collection regardless of their source. The 3-ROM minimum
threshold is unchanged.

Fixes #3187

Generated-By: PostHog Code
Task-Id: 10289bf4-b0d0-4856-80c9-1be93c926f37
2026-07-06 10:39:03 -04:00
Georges-Antoine Assi
e61d6cd5b8 fix(platforms): stop platform variants from renaming the parent platform
get_supported_platforms built a slug->platform map with a plain dict
comprehension. When a folder is mapped as a variant or alias of an
existing platform, scanning resolves it to the parent slug, so two
platform rows share the same slug. The comprehension let the later row
(the variant) overwrite the parent, renaming it in the platform picker
and Folder Mappings page.

Prefer the canonical platform (fs_slug == slug) when building the map so
a variant folder no longer shadows its parent.

Fixes #3157

Generated-By: PostHog Code
Task-Id: 571866ea-86a0-49c2-b62e-dbea077d0181
2026-07-06 10:17:34 -04:00
Georges-Antoine Assi
a750e3ee40 fix alignment 2026-07-06 09:03:36 -04:00
Georges-Antoine Assi
abdc611ba8 Merge pull request #3692 from rommapp/readme-badges
Readme badges
2026-07-06 08:46:58 -04:00
Georges-Antoine Assi
5866af21f6 Merge pull request #3691 from rommapp/posthog-code/v2-a11y-audit
test(v2): add axe accessibility gate + keyboard nav tests to Storybook
2026-07-06 08:46:18 -04:00
Georges-Antoine Assi
85688a4863 Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-06 08:45:17 -04:00
Georges-Antoine Assi
2e7d25a296 remove dead link 2026-07-06 08:43:54 -04:00
Georges-Antoine Assi
c6abcc29ce reorder badges 2026-07-06 08:41:14 -04:00
Georges-Antoine Assi
cfc47732aa Add trendshift and discord badges 2026-07-06 08:28:40 -04:00
Georges-Antoine Assi
fba242150a docs(v2): trim and compact a11y comments
Remove redundant explanation and shorten the remaining comments added by
the accessibility work to the "why" only.

Generated-By: PostHog Code
Task-Id: b44aba2c-90c9-407d-8c80-5bbe77ecd6c1
2026-07-05 22:40:51 -04:00
Georges-Antoine Assi
240127ee88 fix(v2): work down the a11y backlog surfaced by the axe gate
Resolve 7 of the 8 ratcheted `todo` stories with real fixes and flip them
back to the `error` gate:

- RProgressCircular: add optional `label`; render aria-hidden when the ring
  is decorative (indeterminate + no label/slot), else name it via label or
  slot content. Cascades to RSpinner, RSelect (Loading), RTextField (Loading).
- RTextField: label the interactive prepend/append-inner adornment button
  from a new `*InnerLabel` prop (falls back to the tooltip).
- RDateField: move role="combobox" off the RTextField `<label>` wrapper onto
  the field container, restoring the input's label and using an allowed role.
- RTable: mark the layout-only scroll/body containers presentational so
  rows/cells resolve their required table parent in all states.
- RMenuItem, RDropzone, RSlider: supply the menu parent / input label /
  slider aria-label the components already support.

RSelect (Clearable) stays `todo`: the clear button is nested inside the
activator button and the correct fix is a visual-layout refactor that needs
in-browser verification.

Refs #1848

Generated-By: PostHog Code
Task-Id: b44aba2c-90c9-407d-8c80-5bbe77ecd6c1
2026-07-05 22:30:19 -04:00
Georges-Antoine Assi
1eb4d1c8ed test(v2): add axe accessibility gate + keyboard nav tests to Storybook
Wire axe-core into the vitest Storybook runner so every v2 lib story is
scanned for accessibility violations, gated per story by the
@storybook/addon-a11y `a11y.test` parameter (error / todo / off) with a
global default of "error".

Fix the unlabeled-control violations this surfaces (icon-only buttons,
decorative images) and mark the remaining component-level gaps as `todo`
so CI stays green while the backlog stays visible. Add keyboard-operability
play() tests to RSwitch, RTabNav, and RRating.

Refs #1848

Generated-By: PostHog Code
Task-Id: b44aba2c-90c9-407d-8c80-5bbe77ecd6c1
2026-07-05 22:10:52 -04:00
Georges-Antoine Assi
6c742d19ba Merge pull request #3690 from rommapp/posthog-code/detect-browser-language
feat: default UI language to browser language when available
2026-07-05 22:04:18 -04:00
Georges-Antoine Assi
b438dd3bd9 refactor: simplify browser language detection
navigator.languages is universally supported, so drop the
navigator.language fallback and the redundant empty-entry guard.

Generated-By: PostHog Code
Task-Id: a1ecc509-0fd8-44fd-b203-f69e4bd18c65
2026-07-05 21:42:44 -04:00
Georges-Antoine Assi
5fb86e4c64 feat: default UI language to browser language when available
On first visit, match navigator.languages against the available
locales instead of always falling back to en_US. Tries an exact
match (en-US -> en_US) then a language-only match (fr -> fr_FR),
falling back to en_US when none apply. A saved preference still
takes precedence.

Fixes #3139

Generated-By: PostHog Code
Task-Id: a1ecc509-0fd8-44fd-b203-f69e4bd18c65
2026-07-05 21:38:07 -04:00
Georges-Antoine Assi
95b9ca8f5c Merge pull request #3688 from rommapp/posthog-code/rename-duplicates-to-versions
i18n: rename "Duplicates" filter to "Versions" in the UI
2026-07-05 21:23:38 -04:00
Georges-Antoine Assi
db248a0af3 i18n: fix "versions count" grammar in en settings description
Generated-By: PostHog Code
Task-Id: e4d9f2f2-2a59-42fa-ad8b-0cbb4235b6a6
2026-07-05 19:45:38 -04:00