Commit Graph

12749 Commits

Author SHA1 Message Date
Sam Dornan
74c8e4bfb5 feat(metadata): read a fan translation's tag and target language (#4665)
* feat(metadata): read a fan translation's tag and target language

A translated dump is playable in the language it was translated into, but the
tag saying so was kept verbatim, so the rom was filed under no language at all
and the filter drawer grew one throwaway value per patch: "T+Eng1.1_RPGe" and
"T-Eng0.98_DeJap" are the same thing to a reader and two different facets to
the gallery.

The GoodTools, TOSEC and plain spellings now resolve to one "Translation" tag,
and the language the patch targets joins the rom's languages, so a Japanese
game translated into English answers a search for English and reaches an
emulator as English. A translation into a language RomM cannot name is still
tagged, and a tag that merely starts with "tr", like "Trainer", is left alone.

The group and patch version the raw tag carries are dropped, since nothing
reads them and keeping them is what splits the facet.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S4mTJZ63Bvafv3stpiGsHC

* feat(metadata): read the spaced form of a GoodTools translation tag

"[T Fre]" separates with a space rather than a sign, and it is the spelling a
real ScreenScraper dump carries: its entry for "Super Mario Bros. (W) [T Fre]"
is flagged as a translation into French. The tag was read only as "T+Fre" or
"T-Fre", so that dump came out untranslated and unlanguaged.

A space carries no meaning of its own, unlike the sign, so this spelling counts
only when the word after it names a language: "(T Rex)" stays an ordinary tag.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S4mTJZ63Bvafv3stpiGsHC

* style(metadata): trim the translation alias comment to two lines

Greptile flagged it against the repo's comment discipline: four lines, and
the product as the actor.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S4mTJZ63Bvafv3stpiGsHC

* feat(metadata): resolve the short forms of a translation tag's language

"[T-En]" already resolved through the filename language vocabulary; the
non-ISO abbreviations "Ge", "Sp", "Du", "Gr" and "Jp" did not, so those
dumps were tagged without a language. Tests now cover both forms.

Also trims three comments and four test docstrings Greptile flagged
against the repo's comment discipline.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S4mTJZ63Bvafv3stpiGsHC

* fix(metadata): stop reading a hyphenated word as a translation

"(T-Rex)" matched the GoodTools superseded form and became a Translation
tag. A superseded patch carries its version and group, so require that,
or a language the vocabulary names, before the bare "T-" form counts.

"[T+Tha]" still tags, since no ordinary word takes that shape.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S4mTJZ63Bvafv3stpiGsHC

* style(metadata): trim the translation regex comment to two lines

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S4mTJZ63Bvafv3stpiGsHC

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 23:03:49 -05:00
Sam Dornan
ddd87ff554 feat(metadata): take region and language from the dump a hash matched (#4664) 2026-09-22 23:47:23 -04:00
Sam Dornan
08852917f9 feat: Offer the desktop shell's emulator from the save/state play page (#4541) 2026-09-22 23:46:40 -04:00
Georges-Antoine Assi
95599dadbe Merge pull request #4687 from tmgast/fix/sigil-nintendo-disc-platform
fix(sigil): bump the pin so GameCube save targets name a .gci on disk
5.3.1
2026-09-22 22:54:27 -04:00
Georges-Antoine Assi
9f49244307 Merge pull request #4710 from andest01/feat/storybook-viewport-data-bp
feat(v2) storybook viewport mirrors vue installBreakpointAttribute
2026-09-22 22:52:38 -04:00
Georges-Antoine Assi
eb5bdc906c refactor(v2): simplify pass on storybook viewport presets
Fold the viewport presets into one map, drop the threshold ranges from
preset names, omit the default isRotated, and cut the duplicated docs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 21:01:05 -04:00
Georges-Antoine Assi
bdc2dbf60d fix(v2): code-review pass on storybook viewport presets
Drop the manual data-bp pin in RTable MobileCardStack (it now uses the
phone viewport global), give each RomM preset its own tier, remove the
no-op install from storybook.test.ts, and correct the related docs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 20:59:05 -04:00
Georges-Antoine Assi
0215577c04 Merge pull request #4694 from rommapp/claude/authz-and-invite-hardening
fix(security): check endpoint ownership and consume invites atomically
2026-09-22 20:49:04 -04:00
Georges-Antoine Assi
6175bac0f7 Merge pull request #4683 from rommapp/claude/scan-published-images
ci: scan the published images, and stop scanning the lockfiles twice
2026-09-22 20:47:08 -04:00
Georges-Antoine Assi
e16520168b ci: review-polish, say the weekly run rescans latest
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 19:26:08 -04:00
Georges-Antoine Assi
bf77205b7a ci: simplify pass, drop the duplicated rescan rationale from build.yml
The why already lives next to the cron in image-scan.yml.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 19:25:31 -04:00
Georges-Antoine Assi
148dd41a51 ci: apply code-review fixes to the image scan workflow
- Set limit-severities-for-sarif, since trivy-action otherwise unsets the
  severity filter for SARIF output and every severity was reported.
- Key the code scanning category by image ref, so a dispatched scan of an
  older tag can't replace the analysis of latest.
- Validate and compact caller-provided JSON before writing it to outputs.
- Correct the build.yml comment: the weekly run rescans latest only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 19:24:09 -04:00
Sam Dornan
cf19c8ae35 fix(backend): clear the remaining mypy errors outside roms_handler (#4723) 2026-09-22 19:00:24 -04:00
Sam Dornan
5421a0211b fix(backend): build streaming response schemas directly instead of dicts (#4719) 2026-09-22 18:24:52 -04:00
Sam Dornan
9a19d94ec5 fix(backend): type DML row counts from Session.execute for mypy (#4718) 2026-09-22 18:24:12 -04:00
Sam Dornan
6dfc955cdf fix(backend): cap music page size at the largest page the jukebox asks for (#4716) 2026-09-22 17:47:49 -04:00
Georges-Antoine Assi
1e03363816 ci: clear the Trunk findings on the image scan workflows
aquasecurity's IP allow list rejects GitHub API calls from hosted
runners, so pinact 403s verifying the trivy-action tag comment. A
.pinact.yaml rule skips verification for aquasecurity actions only once
they are pinned to a full SHA, so an unpinned ref is still flagged.

zizmor (enabled on master) wants the $/ self-repository syntax for the
reusable workflow call, but actionlint 1.7.12 rejects it, so the finding
is suppressed inline for now.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 17:46:55 -04:00
Sam Dornan
5f05e4ee7b fix(hltb): send a browser user agent so HLTB's firewall lets requests through (#4717)
HowLongToBeat's firewall now answers any tool-style "Name/version" user
agent, including RomM/<version>, with a 403 HTML page. That failed the
heartbeat (shown as "Connection failed" in Settings) and the /init session
mint, so scans and manual matches silently got no HLTB data.

Send a fixed browser user agent instead. Every HLTB call goes through
base_headers(), so the session stays bound to the same agent.


Claude-Session: https://claude.ai/code/session_01Q4AcvMx1hNfc94xqEeqjzw

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 16:42:32 -05:00
Georges-Antoine Assi
47fd91904e Merge remote-tracking branch 'origin/master' into claude/scan-published-images
# Conflicts:
#	.trunk/trunk.yaml
2026-09-22 17:28:14 -04:00
Sam Dornan
2dfcc51f4e fix(backend): type fastapi-pagination pages and params for mypy (#4713)
LimitOffsetPage.create is annotated to return LimitOffsetPage but builds
cls, so subclass pages failed return-value checks. A shared
TypedLimitOffsetPage narrows create() to Self, and resolve_params()
results are annotated with each page's params class.

CustomLimitOffsetPage.total keeps its intentional widening to None
(with_total=false) behind a narrow assignment ignore.

The OpenAPI schema is byte-identical before and after.


Claude-Session: https://claude.ai/code/session_01SPpv6W2ygP9tQ61fTQxdYp

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 16:27:48 -05:00
Sam Dornan
034b8e40c7 test(backend): simulate the CHD permission error without chmod (#4712)
test_extract_chd_hash_permission_error removed read permission with
chmod(0o000), but root ignores permission bits, so the read succeeded
and the test failed in root containers (Docker dev environments, cloud
sandboxes). Patch the open inside extract_chd_hash to raise
PermissionError instead, so the handling is exercised for every user.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 16:04:11 -05:00
Sam Dornan
4542998510 fix(backend): make type ignores honest and replace mypy trunk-ignores with fixes (#4711)
* fix(backend): make type ignores match what mypy reports

Third in the staged series clearing the errors #4655 made visible.
Whole-project mypy: 91 errors in 26 files -> 64 in 23.

Twenty `# type: ignore[assignment]` comments in
endpoints/responses/rom.py never suppressed anything. The request-scoped
values `from_orm_with_request` attaches to a Rom (rom_user, has_notes,
user_saves and the rest) are not declared on the model, so mypy reports
`attr-defined`; it does so under 1.19 as well as 2.3, so the code was
wrong when the comments were written rather than drifting since. They
now name the error they were meant to silence.

Seventy-nine ignores across 24 files suppressed nothing at all under
`--warn-unused-ignores`, and are removed. One of them,
`utils/zip_cache.py`, keeps its `attr-defined` code for the private
`zipfile._get_compressor` and drops only `assignment`. The unused set is
identical under mypy 2.3.0 and 2.3.1, and removing them leaves the error
count unchanged under both, so none was quietly needed.

The two `filter` helpers typed as `[QueryT: Select | Update | Delete]`
bound the TypeVar to the union, so `query.filter(...)` returned the union
and could not be assigned back to `QueryT`. Constraining it to the three
types lets mypy check each one separately, and the callers are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SPpv6W2ygP9tQ61fTQxdYp

* fix(backend): replace mypy and ASYNC240 trunk-ignores with real fixes

A `trunk-ignore` only suppresses when Trunk runs the linter. Plain mypy
does not read them, so the 13 on mypy findings were all still errors to
`mypy .` and would fail a whole-project check. Each now has a fix.

endpoints/tasks.py: `common_data` was a plain dict literal unpacked into
eight TypedDict constructors, so mypy saw `dict[str, Any]` and could not
match its keys. It holds exactly the fields of BaseTaskStatusResponse and
is now annotated as one, so the unpacking is checked.

handler/metadata/gamelist_handler.py: both media maps were inferred as
`dict[str, str]`, so indexing the TypedDict with their keys was
unprovable. Their keys are now typed `GamelistMediaKey`, the Literal of
the TypedDict's fields. A misspelt map key is now an error at the entry;
before, only the index site could have noticed, and it was suppressed.

handler/metadata/playmatch_handler.py: `attr` was a bare `str`. A TypeIs
guard narrows it to the five lookup attributes, and the frozenset is
derived from that Literal so the names live in one place. mypy now checks
that each name is a real PlaymatchRomMatch key. It does not check that
each takes an int, since mypy is lenient about value types on a union key;
that still rests on which five names are listed.

endpoints/search.py: the per-source tuples mixed ROM-list and handler
types, which mypy joined to `object`. The dict is now annotated with what
the loop uses: Mapping rows and the MetadataHandler base.

tests/handler/metadata/test_launchbox_handler.py: `Path.stat()` inside an
async test (ASYNC240) now goes through `anyio.Path`, as the rest of the
codebase already does.

Whole-project mypy: 64 errors in 23 files -> 51 in 20, identical under
2.3.0 and 2.3.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SPpv6W2ygP9tQ61fTQxdYp

* fix(backend): keep gamelist media keys in one place

Review pointed out that `GamelistMediaKey` repeated all fourteen fields
of GamelistMetadataMedia. Python has no `keyof`, so any Literal of a
TypedDict's keys is a second declaration of them, and a field added to
the TypedDict would be left out of it without any error.

The three index sites go back to suppressing `literal-required`, now as
`# type: ignore[literal-required]` so plain mypy reads it as well as
Trunk. The TypedDict stays the only declaration of the key set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SPpv6W2ygP9tQ61fTQxdYp

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 16:02:39 -05:00
Zurdi
0a060efddd Merge pull request #4654 from rommapp/fix/gallery-list-table-header
fix(v2): rebuild the gallery list view for phones
2026-09-22 22:48:22 +02:00
Georges-Antoine Assi
076389601a Merge pull request #4682 from andest01/bug/4673-chip-descenders-work
fix(v2): descenders in chips are displayed
2026-09-22 16:39:48 -04:00
Sam Dornan
1e6174c1cd fix(backend): correct three small typing faults mypy now reports (#4709) 2026-09-22 16:22:08 -04:00
Stuart Anderson
36f648d9a9 feat(v2) storybook viewport mirrors vue installBreakpointAttribute 2026-09-22 15:18:20 -05:00
Georges-Antoine Assi
d4261c5d9b fix(v2): show a truncated chip's full text as its title
Drop the redundant line-height on the chip content, since clipping only
the x axis is what keeps descenders visible.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 16:17:56 -04:00
Georges-Antoine Assi
2ae63f1931 Merge pull request #4707 from rommapp/claude/pad-nav-review-followups
fix(v2): pad focus follow-ups to #4681
2026-09-22 16:10:52 -04:00
Georges-Antoine Assi
ca18cdcd3a refactor(v2): simplify the RChip ellipses story frame
pr-ready step 3 (simplify): bind the cell frame as a style object and
drop the outline that doubled the dashed border.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 16:08:29 -04:00
Georges-Antoine Assi
678fa80cdd fix(v2): address code-review findings on RChip truncation
pr-ready step 2 (code-review xhigh --fix): keep chips from shrinking in
non-wrapping flex rows, keep the close button its full size, and tidy
the typography stories.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 16:05:54 -04:00
Sam Dornan
17830e5b7d test: fix the type errors mypy can now see in the test suite (#4708) 2026-09-22 16:01:21 -04:00
Georges-Antoine Assi
ee3a14c097 chore(v2): tidy comments (pr-ready step 4)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 15:53:33 -04:00
Georges-Antoine Assi
cfa9a62e52 refactor(v2): ignore synthetic keys in modality tracking (pr-ready step 3)
useInputModality now skips untrusted keydowns, so useGamepad's synthetic
arrows stay pad input at the source instead of each dispatch site
re-asserting the pad.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 15:53:33 -04:00
Georges-Antoine Assi
780ceb24f4 fix(v2): apply code-review pass (pr-ready step 2)
Defer the Play focus claim to a task so the key that switched modality
keeps its default action, re-claim the pad after d-pad repeats, and share
one playReady computed between each Play button and usePlayFocus.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 15:53:33 -04:00
zurdi
d50fb04a93 fix(v2): follow a touch selection on the window, and drop it with its surface
Addresses Greptile's review of #4654.

The gesture was tracked through the row that took the press, which the
virtualiser recycles mid-drag, and a drag parks its finger over the
chrome at the list's edge rather than over a row. Either way the end
never arrived: the edge-scroll frame loop kept pulling the list and
painting rows with no finger down. It now follows the window from the
press until the lift, which also lets the row and the card drop their
move, end and touchmove wiring.

A gallery going away cancels what is still in flight, so a press whose
timer has not fired cannot select into whatever replaced it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 21:47:51 +02:00
zurdi
25ced0960c test(v2): give PlatformTile's test the i18n this branch made it need
The tile's game count went through `t()` here while master gained a test
that mounts the tile with no i18n plugin, so the merge of the two failed
on `Need to install with app.use`. The test now mocks vue-i18n, as the
other component tests around it do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 21:47:49 +02:00
zurdi
9fb8bafd65 Merge remote-tracking branch 'origin/master' into fix/gallery-list-table-header 2026-09-22 21:40:33 +02:00
zurdi
2c348ed7d3 fix(v2): keep the selection bar's outline on its notch as the count grows
The notch rounded its top with a pill radius, which the browser clamps
to half the width, so every digit widened the curve until it ran the
whole height and the sides never straightened. The outline, and the
fillets in the fill, both meet that straight side: with four digits the
stroke arced well clear of the notch it was tracing.

The corners now take a fixed radius, one constant the fill and the path
share, and the path runs the sides between corner and fillet. Measured
against the painted silhouette at one, two, three and four digits, on a
phone's width too, the stroke now follows it within a pixel.

The geometry moves to selectionBarOutline, where it is tested directly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 21:31:57 +02:00
Zurdi
bb85a45ef5 Merge pull request #4705 from rommapp/feat/changelog-short-pr-links
feat(v2): shorten the changelog's pull request links to #nnnn
2026-09-22 21:27:01 +02:00
Georges-Antoine Assi
76dac916a1 Merge pull request #4681 from rommapp/claude/fix-4397-pad-nav-regressions
fix(v2): restore gamepad navigation on the platforms grid and every player
2026-09-22 15:22:57 -04:00
zurdi
62a44c4435 fix(v2): cap how far the changelog's link rewrite scans
A `[` needs no closing bracket, so on notes carrying unclosed ones the
skip-the-existing-link alternative scanned to the end of the text for
each of them: quadratic, and measurably so, 2s over 100KB of them and
33s over 400KB. Capping the label and the target, far above the longest
link the notes actually carry (134 characters), holds it to a line's
worth of work per bracket: 42ms and 159ms for the same two, and the
same output on every published release.

Raised by @gantoine in review of #4705.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 21:19:16 +02:00
Georges-Antoine Assi
d15cea9659 fix(v2): address Greptile review on #4681
Trim the usePlayFocus module comment to two lines and type the useGamepad
test fixture fully instead of casting through unknown.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 15:09:48 -04:00
Georges-Antoine Assi
79eece9dbe Merge pull request #4680 from andest01/fix/filter-values-null
fix(frontend): tolerate null filter_value lists from the API
2026-09-22 15:07:43 -04:00
Georges-Antoine Assi
c367c279cd test: tighten test typing from Greptile review
Annotate the new filter_values endpoint tests and their helper, and build
the galleryRoms null-coercion test's platform with a typed factory
instead of casting a bare literal.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 14:55:16 -04:00
Georges-Antoine Assi
13b4187daa run generator 2026-09-22 14:36:49 -04:00
Georges-Antoine Assi
be1e5fd308 fix(backend): type filter_values as RomFiltersDict end to end
The ROM list and /roms/filters responses already validate every
filter_values key as a list, so the API never sends nulls. Make that
contract explicit: the handler now returns RomFiltersDict directly
(moved to handler/database/rom_filters.py to avoid an import cycle),
which drops the mypy typeddict-item ignores in the endpoints. Endpoint
tests pin that every key is present and a list, including for a ROM
with no metadata and with with_filter_values=false.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 14:33:42 -04:00
Georges-Antoine Assi
a4dfa9cdad refactor(frontend): inline null coercion in filter setters (simplify pass)
Drop the one-line listOrEmpty wrapper and the setter test the
galleryRoms test already covers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 14:16:01 -04:00
zurdi
a717e2e81a fix(v2): keep the changelog's link rewrite out of code and queries
Addresses Greptile's review of #4705.

The rewrite matched a reference anywhere but right after a link's
bracket, so one written inside code was turned into markdown the preview
then printed verbatim, and one inside a longer link label nested a link
in a link. Code spans, fenced blocks and whole existing links are now
matched first and handed back untouched. A trailing query no longer
splits a reference either: `?` joins the guard that already kept
`/files` and `#issuecomment-1` whole.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 20:15:00 +02:00
Georges-Antoine Assi
1b1ecca0fa test(frontend): exercise null filter_values guards (code-review pass)
Make the null filter_value tests fail without the guards they cover,
and drop the FilterDrawer fallback the store setters make unreachable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 14:14:37 -04:00
Georges-Antoine Assi
9ef1a9addd Merge branch 'master' into fix/filter-values-null 2026-09-22 14:07:38 -04:00