Commit Graph

12773 Commits

Author SHA1 Message Date
zurdi
229d4ccdee fix(v2): drop asset tooltips and fit three state cards at 1440px
The save and state tooltips only repeated the filename and the exact
time, which every row, tile and preview now shows (and the group head
already flags a core that cannot load). Stream's save summary renders
its size and time through AssetChips and AssetTimestamp like the other
asset views, which retires play.save-data-detail and rom.created.

Flow cells start at 260px: three per row on a 1440px screen instead of
two oversized ones, four on 1920px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 17:03:13 +02:00
zurdi
efe52205ba refactor(v2): apply the simplify pass
AssetTimestamp's align and inline props only ever moved together, so one
`stacked` prop (relative over exact, flush right, for a trailing time
column) replaces both; side by side is now the default. Drops the unused
inline + end rule, the list layout's own alignment override, a dead
flex reset on grid tiles, and the duplicated inline test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 16:50:19 +02:00
zurdi
e914a8301a fix(v2): apply the code-review pass
Keep an end-aligned timestamp flush right when it goes inline, put every
tile layout but the list's fixed time column on the inline timestamp, and
test which layouts get it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 16:46:49 +02:00
zurdi
3965463590 style(v2): widen state cards and show one timestamp everywhere
State cards in the flow grid were narrow enough that labels, chips and the
timestamp stacked them taller than wide. Cells now start at 300px (shrinking
on a phone rather than overflowing), which also gives the screenshot room.

The relative and exact time now render through AssetTimestamp everywhere:
side by side on state cards, the launch view preview and phone save rows,
where the exact moment is no longer hidden. The preview drops its own
clock icon and dot separator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 16:44:01 +02:00
Sam Dornan
b5e50a14cc feat(metadata): tag a dump from the flags ScreenScraper raises on it (#4666) 2026-09-23 07:14:46 -04:00
Zurdi
e2893a2097 Merge pull request #4725 from rommapp/feat/save-state-multiselect
feat(v2): multi-select saves and states
2026-09-23 12:32:47 +02:00
zurdi
abdaf1bea4 fix(v2): type to confirm a save or state delete, and refresh a partial one
The v2 patterns rule asks for type-to-confirm on anything that touches the
filesystem, and deleting a save or state removes the file from disk. Every
delete in the tab now takes it, single and bulk alike, through one
`rom.delete-keyword` so the three call sites share a home.

`delete_saves` walks its list and raises on the first id it cannot find, so
a rejected bulk delete can still have removed the assets ahead of it. The
error path now refreshes too, instead of leaving rows on screen that are
already gone.

Addresses the Greptile review on #4725.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 12:17:10 +02:00
zurdi
c5007fe4ad fix(v2): keep a selection through a rom refresh
A shallow watch source makes Vue fire the watcher on every dependency
trigger, so `watch([subTab, () => props.rom.id], ...)` ran on each refresh
and wiped the selection right after a bulk favorite or label write. Both
tabs now read their sources through getters, with a test for each
direction: a replaced rom object keeps the selection, a different rom
drops it.

The checked tile in a state strip keeps its tint under the pointer, the
`--static` hover reset having outranked a single class. `reportBulk` is
now `reportAndRefreshBulk`, the bulk delete body says what leaves the
filesystem in all 18 locales, and the firmware tab's move onto
`useIdSelection` gets the selection tests it had none of.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 10:42:07 +02:00
zurdi
4000ccb173 refactor(v2): apply the simplify pass
Fold gating replaces the expand-on-select-all hook: a checkable list never
folds, so select-all cannot reach a row the user could not see. The fold
control and `useGroupFold.openAll` go with it, along with the `defineExpose`
on both list components.

The favorite write is one helper for the single and bulk paths, the fourth
copy of the checkbox pattern (DeleteFirmwareDialog) moves onto
`useIdSelection`, `useIdSelection` drops its `idOf` argument for an
`{ id: number }` bound, and `files-selected-of` and `assets-selected-of`
merge into one `selected-of` key across the 18 locales.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 10:20:12 +02:00
zurdi
a73a4be435 fix(v2): unfold every slot before select-all reaches it
A slot folds its older versions out of sight, showing only the newest
and any favorites. Select-all took those hidden versions too, so a bulk
delete could remove rows that never showed a checkbox.

Select-all now opens every group first, so what it selects is what the
user can see. Clearing still just clears.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 10:07:20 +02:00
zurdi
42a7715755 fix(v2): apply the code-review pass
A bulk write had no in-flight guard, so a second click on the heart
re-fanned the whole batch, computed its direction from pre-refresh state
and raced the refresh. Delete also cleared the selection before the
request, so a failed delete left the rows on screen unchecked.

The firmware toolbar still counted raw ids while its actions operated on
the list-intersected selection, so a row dropped by a refresh could
leave the count and the enabled state lying.

The selection set moves to shallowRef: a plain ref deep-wraps a Set in a
reactive proxy, which both costs a proxy on every read and made the
docstring's stated reason for cloning wrong.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 10:03:29 +02:00
Zurdi
2a479fe796 Merge pull request #4714 from rommapp/feat/save-state-favorites-labels
feat(saves): favorite and label saves and states
2026-09-23 09:36:48 +02:00
zurdi
effb33dbe9 refactor(v2): one home for checkbox selection, and fix the a11y lint
The `ref<Set<number>>` plus clone-and-swap plus all/some computeds had
been written three times: the Files tab, the Firmware tab, and the Save
data tab this branch added. `useIdSelection` now owns it, and all three
call it.

It keeps the stale-id defence the Files tab had and the other two
lacked: the count comes from intersecting with the live list, so an id
left behind by a delete elsewhere cannot inflate it. The set is replaced
rather than mutated, since Vue does not track `Set` writes.

The toolbar's count moves onto RCheckbox's own `label`, which is what
associates the two. Wrapping the checkbox in a bare `<label>` failed
vuejs-accessibility/label-has-for in CI, because the rule cannot see
that the component renders an input. The Firmware tab already did it
this way.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 09:14:09 +02:00
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
zurdi
8e07bcbb90 feat(v2): multi-select saves and states
Cleaning up a slot meant deleting one save at a time, confirming each.
Owned saves and states now carry a checkbox and a select-all row, the
way the Files tab already works, and the selection can be favorited,
labelled or deleted in one go.

The checkbox rides a new `checkable` prop rather than the existing
`selectable`, which already means the player's single-asset picker. A
save and a state can share an id and both panels stay mounted, so each
kind keeps its own set, and switching subtab or ROM clears them.

Delete goes through the bulk routes that already take arrays. Favorite
and labels have no bulk route, so they fan out and report what landed.
A bulk label edit adds to each asset rather than replacing, so it can
never wipe a label it never showed.

Community items stay read-only: nothing there is the user's to change.

Closes Norna RomM #31

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 01:15:48 +02:00
Sam Dornan
cf19c8ae35 fix(backend): clear the remaining mypy errors outside roms_handler (#4723) 2026-09-22 19:00:24 -04:00
zurdi
d56873945c fix(v2): address the Greptile review
Escape closes the labels dialog while a save is in flight, so the
completing request closed whichever editor the user had opened since,
discarding those edits. It now clears the target only if it is still the
one it opened.

The dialog's header also still described suggestions as coming from the
whole ROM, which stopped being true when they narrowed to the user's own
assets.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 00:48:33 +02:00
zurdi
4d7e994fe6 fix(v2): match the tile's heart to the preview's, top left
Both now mark a state's screenshot in the same corner.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 00:45:02 +02:00
zurdi
f849702976 fix(v2): drop the selection check, and give the stage corners one job each
The brand border, the tinted wash and the brand-coloured name already
say which row or tile is picked, so the check icon was a fourth voice
saying it again. Removing it from the rows, the tiles and the list
layout also frees the corner the heart was stepping around.

With that gone the state preview's heart moves to the top left, leaving
the clear button alone on the right, and both hand-tuned dodge offsets
disappear with it.

A state's name now wraps instead of truncating: it sits under a
full-width stage with room for it, unlike a save's in a dense row. The
play rows also lose the trailing grid track that only ever carried the
management buttons.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 00:40:13 +02:00
zurdi
0bfe5c1d16 fix(v2): keep the clear button's hit area on the button
Scoping the absolute placement to the stage took the last `position`
off the button itself, and the ::before that widens the tap target to
44px is absolutely placed. With no positioned ancestor left it resolved
against the page and stretched to cover it, swallowing clicks well away
from the control.

The base rule is `relative` again; the stage still overrides it with
`absolute`, which anchors the pseudo-element just as well.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 00:31:43 +02:00
zurdi
e2c60f8992 polish(v2): quieten the chips, and cover the label normalizer
Labels and the file size read as plain chips now: the tag and weight
glyphs said nothing the text did not. In the resume preview the size
also outranked the labels and the slot while being the least telling
fact about a save, so it drops to the same quiet treatment the list
rows already give it.

`normalize_asset_labels` gains direct unit tests. It is a pure function,
so this covers the trimming, the case-insensitive dedupe and both caps
without a database, where the endpoint tests need one.

`AssetList` gains two regression tests for the fold count, which the
simplify pass rewrote: one asserts only the truly hidden version is
counted, the other that no fold is offered when every version is pinned
on screen. The i18n stub now keeps the pluralisation count so a wrong
one fails.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 00:26:33 +02: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
zurdi
ecaa883400 refactor(v2): apply the simplify pass
The folding rule was written three times in two phrasings: as a filter,
as its own inverse inside the auto-open check, and as an arithmetic
difference for the chevron count. A slot band now partitions into
`pinned` and `hidden` once where it is built, so the rule has one home
and the filter stops re-running per render.

Also:
- A band carries its newest asset instead of the id, so ranking no
  longer scans the band to find it again inside a sort comparator.
- `HIDDEN_ASSET_ANNOTATIONS` derives from `AssetAnnotations`, so a third
  annotation field cannot be added without also being masked.
- `normalize_asset_labels` keys the dedupe off a dict, folding each label
  once, and rejects an oversized set as soon as it crosses the cap
  instead of after walking the whole body.
- The clear button's absolute placement moved onto the stage that wants
  it, so the inline variant no longer un-sets it.
- Two duplicated label ternaries became computeds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 00:16:32 +02:00
zurdi
8f36b943d4 fix(v2): apply the code-review pass
A shared save or state no longer carries its author's annotations. The
write routes were owner-gated but the read path was not, so a label
naming a private run rode along into every other user's community list.

Also:
- The fold button counted every version past the first, but folding now
  keeps favorites visible too, so it over-reported and could offer to
  unfold a band with nothing hidden.
- The labels dialog passed its caption through a slot RComboboxField
  does not define, leaving the field with no visible or accessible name.
- In the list layout the heart sat inside the truncating name, so a long
  filename clipped it away.
- Label suggestions came from every visible asset, offering other users'
  labels; they now come from the user's own.
- aria-pressed vanished when is_favorite was absent, the dialog emitted
  its live array, and the phone layout carried a dead duplicate block.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-23 00:06:29 +02: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
zurdi
dc084fad31 fix(v2): place the favorite heart per surface, and unpack the save preview
The heart sat immediately before the labels, reading as one more chip. It
now belongs to whatever shows it: beside a save's name, over the top
right of a state's screenshot. AssetAnnotations splits into AssetLabels
and AssetFavoriteMark so each surface places the mark itself.

Also here:
- A state card wraps its filename instead of truncating it. The compact
  list row keeps its single line.
- A selected tile kept its brand border and wash under the pointer.
  `:hover` outranks a lone class, so the selected rule has to match it.
- The inline clear button inherited the stage variant's absolute offsets
  while in flow, which pushed it off centre.
- On phones the save preview reads like a save row: thumbnail and name,
  then labels, facts and the timestamp each across the full width.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 23:46:20 +02: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
zurdi
20b495ba31 fix(v2): unpack the resume preview, and drop the core from saves
The preview piled the heart, every label, the slot, a relative time, the
size and the core into one wrapping row, then repeated the timestamp
underneath. It now reads in three bands: the owner's marks, the file's
own facts, and one time line carrying both the relative and the exact
stamp.

A save loads in any core, so naming one on a save is noise; a state only
loads in the core that wrote it, so that tag stays.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 23:30:00 +02: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
zurdi
85d2b6e2c6 feat(saves): favorite and label saves and states
A filename and a timestamp cannot tell apart a 100% run from a speedrun
seed, so saves and states carry two owner-only annotations: a favorite
heart that sorts them ahead of their band, and a set of free-text labels.

Backend adds `is_favorite` and a JSON `labels` to both tables, with
`PUT /{saves,states}/{id}/{favorite,labels}` mirroring the existing
visibility toggle. Labels are trimmed, de-duplicated case-insensitively
and capped. Both routes write with `touch=False`, so annotating a save
leaves `updated_at` alone: it is not a write to the bytes, and device
sync reads that column to decide staleness.

In v2 the Save data tab grows a heart and a labels button per row, the
labels dialog suggests the labels already used on the ROM, and favorites
lead their slot or core without ever folding the newest version away.
The heart glyph shows only on the launch screens, where the toggle that
would otherwise say it is not there. Phones give the row four bands:
name, labels, facts, buttons.

Closes #942

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 23:03:25 +02: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