Commit Graph

10459 Commits

Author SHA1 Message Date
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
Georges-Antoine Assi
56522d6207 fix: show total versions count in v1 gallery sibling tooltips
The tooltip counted only sibling_roms (other versions), producing
"1 version(s)" for a group that actually holds 2. Use the localized
rom.versions-count key with sibling_roms.length + 1, matching the v2
SiblingBadge, so it reads the true total with no "(s)" suffix.

Generated-By: PostHog Code
Task-Id: e4d9f2f2-2a59-42fa-ad8b-0cbb4235b6a6
2026-07-05 19:43:27 -04:00
Georges-Antoine Assi
1699800da5 i18n: use existing key for versions filter summary label
Replace the hard-coded "Versions" token in the smart-collection filter
summary with the localized platform.show-duplicates key so non-English
locales don't show an English-only label.

Generated-By: PostHog Code
Task-Id: e4d9f2f2-2a59-42fa-ad8b-0cbb4235b6a6
2026-07-05 19:41:41 -04:00
Georges-Antoine Assi
e1026be685 i18n: translate "versions" relabel across all locales
Update the "duplicates"/"siblings" filter and settings strings in the
remaining 16 locales to use each language's existing term for ROM
versions, matching the en_US/en_GB relabel.

Generated-By: PostHog Code
Task-Id: e4d9f2f2-2a59-42fa-ad8b-0cbb4235b6a6
2026-07-05 18:46:00 -04:00
Georges-Antoine Assi
055487f0dc i18n: rename "duplicates" filter to "versions" in the UI
The "Show duplicates" filter and related sibling-ROM labels were
confusing (see issue). Rename the user-visible text to "versions",
matching the term already used for sibling ROMs elsewhere in the UI
(switch version, "{n} versions", "Group versions of the same ROM").
The API contract and internal identifiers are left untouched.

Generated-By: PostHog Code
Task-Id: e4d9f2f2-2a59-42fa-ad8b-0cbb4235b6a6
2026-07-05 18:41:23 -04:00
Georges-Antoine Assi
d24d883c5d Merge pull request #3687 from rommapp/posthog-code/launchbox-update-media-import
fix(launchbox): import local media when matching via update_rom
2026-07-05 17:58:40 -04:00
Georges-Antoine Assi
40cdeac615 fix(launchbox): import local media when matching via update_rom
Manually (re)matching a LaunchBox ID through the ROM edit dialog never
imported any LaunchBox media. The update_rom endpoint fetched metadata
without fs_name/platform_slug (so local media never resolved), never
generated media paths, and had no store loop, unlike the ScreenScraper
block in the same handler.

Pass fs_name/platform_slug to get_rom_by_id, call
populate_rom_specific_paths on the fetched metadata, and add a
store_media_file loop that also clears stale media when the ID changes.

Fixes #3521

Generated-By: PostHog Code
Task-Id: 45791732-58e8-41c9-b616-4a91018e388d
2026-07-05 17:53:50 -04:00
Georges-Antoine Assi
f4a6acd00b Merge pull request #3686 from rommapp/posthog-code/ss-quota-scan-fallback
fix(scan): fall back to other providers when ScreenScraper quota is exhausted
2026-07-05 17:24:56 -04:00
Georges-Antoine Assi
a2f3573c65 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-05 17:11:51 -04:00
Georges-Antoine Assi
4d9bef4d6e refactor(scan): handle SS daily-quota 429 in the handler
Move the quota-skip decision out of scan_handler and into the SS handler:
lookup_rom, get_rom, and get_rom_by_id now catch the daily-quota 429 and
return an empty SSRom, so the scan degrades to the other providers with no
quota-specific code at the call site. Non-429 errors still propagate.

scan_handler keeps only the fault-tolerant provider gather. The service
breaker still short-circuits repeat calls and manual search still surfaces
the 429 (it does not go through these swallow paths for name search).

Generated-By: PostHog Code
Task-Id: 77dff3d9-6120-4156-bb25-1556a50a75e4
2026-07-05 17:09:03 -04:00
Georges-Antoine Assi
1ac31e9ff0 refactor(scan): move quota breaker into ScreenScraper service
Track the ScreenScraper daily quota where the knowledge lives: a breaker
in the service, tripped on the first HTTP 430/431 and reset at the start
of each scan. When tripped, _request() short-circuits the API call but
still raises the 429, so manual search keeps its clear "quota exhausted"
message while the scan catches it and falls back to the other providers.

Replaces the handler-level skip flag with this service-scoped breaker.

Generated-By: PostHog Code
Task-Id: 77dff3d9-6120-4156-bb25-1556a50a75e4
2026-07-05 16:40:04 -04:00
Georges-Antoine Assi
1338999ae9 refactor(scan): track provider skip state on the handler, reset per scan
Move the "skip this provider for the rest of the scan" state off a set
threaded through scan_rom and onto the MetadataHandler base class, so each
provider tracks it internally. The state is cleared for every provider at
the start of each scan via reset_metadata_handlers_scan_state().

Generated-By: PostHog Code
Task-Id: 77dff3d9-6120-4156-bb25-1556a50a75e4
2026-07-05 16:22:04 -04:00
Georges-Antoine Assi
fc938179e6 refactor(scan): drop user-facing warning for skipped provider
Background scans usually run with RomM closed, so the scan:warning toast
would rarely be seen. Keep the backend skip/fallback behavior and the log
line, and remove the socket event, its frontend handler, and the i18n key.

Generated-By: PostHog Code
Task-Id: 77dff3d9-6120-4156-bb25-1556a50a75e4
2026-07-05 14:56:22 -04:00
Georges-Antoine Assi
ddc4adb60b Merge pull request #3685 from rommapp/posthog-code/box3d-wrap-all-edges
fix(v2): wrap 3D box side scan onto all four edges
2026-07-05 14:45:05 -04:00
Georges-Antoine Assi
87a1c717aa Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-05 14:35:52 -04:00
Georges-Antoine Assi
88aad83337 fix(v2): wrap 3D box side scan onto all four edges
RBox3D previously mapped the "BOX (2D, SIDE)" scan only onto the two
edge faces matching its orientation, leaving the other pair as blank
cardboard. Landscape scans (N64) also inflated the box depth because it
derived from the raw spine w/h.

Now the side scan wraps all four edges: it reads the right way on the
pair matching its orientation and is spun 90 degrees in-plane (with a
width/height swap) so object-fit crops it identically on the
perpendicular pair. Box depth now derives from the scan's short/long
ratio against whichever box dimension its long edge maps to, so a
landscape N64 strip yields a correctly thin depth without leaning on the
clamp.

Generated-By: PostHog Code
Task-Id: b3a8fc9d-e320-4c37-ac6d-3e9e95e0b48a
2026-07-05 14:28:33 -04:00
Georges-Antoine Assi
ba208efff7 fix(scan): fall back to other providers when ScreenScraper quota is exhausted
When a user hit ScreenScraper's daily API quota mid-scan, the whole scan
stopped matching ROMs against every provider instead of just skipping SS.
The 429 raised for SS quota (HTTP 430/431) propagated out of the per-ROM
provider gather (which lacked return_exceptions), discarding the other
providers' results, and every subsequent ROM re-hit the exhausted API.

- Skip ScreenScraper for the rest of the scan on the first quota hit,
  tracked in a shared per-scan set, so remaining ROMs stop hammering it.
- Keep the current ROM's other-provider data when SS quota is hit.
- Make the provider gather fault-tolerant (return_exceptions) so one
  provider raising never discards the others' results.
- Notify the user once via a non-fatal scan:warning socket toast.

The manual-search path still surfaces the 429 quota message unchanged.

Fixes #3620

Generated-By: PostHog Code
Task-Id: 77dff3d9-6120-4156-bb25-1556a50a75e4
2026-07-05 14:16:21 -04:00
Georges-Antoine Assi
882acec486 Merge pull request #3684 from rommapp/posthog-code/clipboard-error-http
fix(v2): surface an error when clipboard copy fails over HTTP
2026-07-05 13:36:37 -04:00
Georges-Antoine Assi
34e115a2b5 remove license from rom-patcher 2026-07-05 13:29:13 -04:00
Georges-Antoine Assi
f7abd29f94 fix(v2): guard window in useClipboard support check
Check `typeof window !== "undefined"` before reading window.isSecureContext
so the support check evaluates to false instead of throwing in non-DOM
environments where navigator exists but window does not.

Generated-By: PostHog Code
Task-Id: 8b05c0fe-95b7-46bd-9ecb-7b17afe7569b
2026-07-05 13:20:57 -04:00
Georges-Antoine Assi
08112d7a31 fix(v2): surface clipboard errors in useGameActions.share fallback
Split the native Web Share attempt from the clipboard fallback so a
cancelled share sheet stays silent while a failed clipboard write (e.g.
over HTTP) now shows an error toast via useClipboard, matching the rest
of this change.

Generated-By: PostHog Code
Task-Id: 8b05c0fe-95b7-46bd-9ecb-7b17afe7569b
2026-07-05 13:19:02 -04:00
Georges-Antoine Assi
05a413fc1c i18n(v2): translate clipboard copy messages for all locales
Replace the English placeholders for common.clipboard-copied and
common.clipboard-copy-failed with proper translations in every non-English
locale, matching each locale's existing clipboard terminology.

Generated-By: PostHog Code
Task-Id: 8b05c0fe-95b7-46bd-9ecb-7b17afe7569b
2026-07-05 13:10:17 -04:00
Georges-Antoine Assi
7248d5d6d5 fix(v2): surface an error when clipboard copy fails over HTTP
The browser Clipboard API only exists in a secure context, so over plain
HTTP navigator.clipboard is undefined and copy buttons failed silently.
Several v2 copy handlers swallowed the throw, so users saw no feedback and
believed the copy succeeded (e.g. the client API token dialog in #3614).

Add a shared useClipboard composable that guards on isSecureContext and
shows an error toast when a copy cannot happen, then route the silent-catch
call sites (token dialog, invite link, hash chip, pairing code) through it.

Fixes #3614

Generated-By: PostHog Code
Task-Id: 8b05c0fe-95b7-46bd-9ecb-7b17afe7569b
2026-07-05 12:54:16 -04:00
Georges-Antoine Assi
12484d4aff Merge pull request #3683 from rommapp/posthog-code/fix-markdown-manuals
Support markdown manuals and enforce allowed file types
2026-07-05 12:28:23 -04:00
Georges-Antoine Assi
711ad16059 fix(roms): use .md extension in manual upload accept lists
macOS shows the raw "text/markdown" MIME in the file picker because it has
no registered display name for it. The .md extension resolves to the system
Markdown type, so the picker shows a friendly "Markdown" label.

Generated-By: PostHog Code
Task-Id: 1d785bcc-ea5c-4b99-b619-73625a9e218c
2026-07-05 12:22:56 -04:00
Georges-Antoine Assi
e7de380aac fix(roms): restrict manual matching to allowed extensions
Discover manuals only for the allowed extensions (.pdf, .md) instead of
globbing {rom.id}.*, so stray files (e.g. {rom.id}.part) are never treated
as a manual. Select deterministically by newest mtime when multiple allowed
manuals coexist. Drop the redundant .md token from the frontend accept lists.

Generated-By: PostHog Code
Task-Id: 1d785bcc-ea5c-4b99-b619-73625a9e218c
2026-07-05 12:20:41 -04:00
Georges-Antoine Assi
82bd5e30b8 feat(roms): support markdown manuals and enforce allowed file types
Generated-By: PostHog Code
2026-07-05 08:49:47 -04:00
Georges-Antoine Assi
600ba61077 Merge pull request #3682 from rommapp/posthog-code/update-claude-md-with-pr-guidelines
docs(claude): add PR linking and template conventions
2026-07-05 08:15:01 -04:00
Georges-Antoine Assi
41970d641b docs(claude): add PR linking and template conventions
Generated-By: PostHog Code
2026-07-05 08:13:02 -04:00
Georges-Antoine Assi
65996ad8d7 Merge pull request #3681 from rommapp/posthog-code/fix-unmatched-rom-titles-parsing
Use parsed filename for unmatched ROM titles instead of raw filename
2026-07-05 08:07:03 -04:00
Georges-Antoine Assi
7c578dbfd5 docs(scan): trim placeholder-name comments
Generated-By: PostHog Code
Task-Id: 987bb9c1-1bfb-43f2-adc7-c26e69f06a39
2026-07-05 08:02:52 -04:00
Georges-Antoine Assi
3c5228a9d9 test(scan): omit NotRequired name for no-match HasheousRom
name is NotRequired[str] on HasheousRom, so passing name=None fails mypy's
typeddict-item check. Omit it to represent a no-match result.

Generated-By: PostHog Code
Task-Id: 987bb9c1-1bfb-43f2-adc7-c26e69f06a39
2026-07-05 08:01:24 -04:00
Georges-Antoine Assi
6bf9a947cd fix(scan): discard placeholder from seeded name before parsed fallback
rom_attrs["name"] is seeded from rom.name earlier, so on the no-provider-match
path it still holds the raw filename placeholder. That made the
`or rom_attrs.get("name")` branch win over the fs_name_no_tags fallback,
retaining the raw filename as the title. Treat the seeded name as a placeholder
too, so the parsed filename fallback applies when no provider matched.

Generated-By: PostHog Code
Task-Id: 987bb9c1-1bfb-43f2-adc7-c26e69f06a39
2026-07-05 07:57:32 -04:00
Georges-Antoine Assi
d0dd847dd1 fix: use parsed filename for unmatched ROM titles instead of raw filename
Generated-By: PostHog Code
2026-07-05 07:47:33 -04:00
Georges-Antoine Assi
fcdb071d62 Merge pull request #3675 from rommapp/posthog-code/fix-ssrf-dns64-nat64
fix: allow NAT64-wrapped public IPs through SSRF filter
2026-07-04 22:28:28 -04:00
Georges-Antoine Assi
8a43ae3009 fix: allow NAT64-wrapped public IPs through SSRF filter
DNS64/NAT64 networks synthesize IPv6 answers that embed a public IPv4
in the RFC 6052 well-known prefix 64:ff9b::/96. The SSRF classifier
rejected these because the prefix is is_reserved, breaking all outbound
metadata and cover fetching on NAT64-only deployments.

is_forbidden_ip now unwraps a NAT64-wrapped address and evaluates the
embedded IPv4 instead, so a wrapped public IPv4 is allowed while a
wrapped private/internal IPv4 (e.g. 127.0.0.1, 10.0.0.1) stays blocked.

Fixes #3668

Generated-By: PostHog Code
Task-Id: 73b38615-966e-4955-9228-2cb6bbcda277
2026-07-04 22:16:09 -04:00
Georges-Antoine Assi
bd4b70d5ff Merge pull request #3671 from chiyi-creator/fix/public-domain-rom-tag
fix: stop mapping Public Domain ROMs to Poland
5.0.0-beta.1
2026-07-04 15:00:09 -04:00