* 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>
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>
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>
- 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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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
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
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
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
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>
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>
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>
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>
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
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>