Commit Graph

12689 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Georges-Antoine Assi
d6c314b0cd Merge pull request #4657 from rommapp/claude/persist-tab-title-on-query-nav
fix(frontend): keep the page title across query-only navigations
2026-09-22 13:59:04 -04:00
zurdi
ed3d9a8e11 feat(v2): shorten the changelog's pull request links to #nnnn
GitHub's generated release notes credit each change with the pull
request's full URL, which the changelog dialog printed in full: every
entry wrapped onto a second line of `https://github.com/...`.

Bare pull request and issue URLs are now rewritten the way GitHub
renders them, `#4252` here and `owner/name#12` for another repository,
before the notes reach the markdown preview. A URL that is already a
link, and a deeper page of one (`/files`, `#issuecomment-1`), are left
as they are.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bZ7R3xC73MZu1vTNuatPK
2026-09-22 19:41:40 +02:00
Georges-Antoine Assi
2e881800de Merge remote-tracking branch 'origin/master' into claude/persist-tab-title-on-query-nav
# Conflicts:
#	frontend/src/plugins/router.test.ts
2026-09-22 13:41:35 -04:00
Georges-Antoine Assi
4aff9675b0 Merge pull request #4660 from rommapp/claude/enable-semgrep-zizmor
chore(security): harden Actions and Renovate, credit Socket in the readme
2026-09-22 13:39:55 -04:00
Georges-Antoine Assi
f4de81a038 Merge pull request #4655 from rommapp/claude/pr-review-comments-gylkhy
fix(tooling): repair mypy's exclude regex and align its version with CI
2026-09-22 13:38:46 -04:00
Sam Dornan
bcb203dc18 fix(v2): declare color-scheme with the v2 theme palettes (#4701)
v2's UA-drawn chrome currently follows Vuetify's runtime theme, which injects
`:root { color-scheme: dark }` while a dark theme is active and nothing at the
root for light. That holds only because RomM.vue keeps vuetifyTheme.change() in
sync, and v1 plus Vuetify are slated for deletion: once their stylesheet is
gone the root is undeclared again, where Chrome falls back to light chrome and
a dark v2 UI gets light form controls.

Declare the scheme next to each palette so it travels in the same scope class
the v2 tokens already own, rather than depending on a v1 framework's runtime
theme.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 12:37:34 -05:00
Georges-Antoine Assi
9f907d0068 Merge pull request #4653 from rommapp/claude/session-revocation
fix(security): revoke the target account's sessions on a credential change
2026-09-22 13:34:55 -04:00
Georges-Antoine Assi
763d600bf6 Merge pull request #4643 from andest01/chore/dpdm-circular-deps
fix(frontend): eliminate import cycles and gate them with eslint
2026-09-22 09:33:51 -04:00
Georges-Antoine Assi
e4b341d233 Merge remote-tracking branch 'origin/master' into chore/dpdm-circular-deps
# Conflicts:
#	docs/FRONTEND_ARCHITECTURE.md
2026-09-22 08:59:05 -04:00
Georges-Antoine Assi
728354c157 Merge pull request #4609 from rommapp/claude/css-prefixing-dev-and-prod
build(frontend): prefix CSS in dev as well as production
2026-09-22 08:52:20 -04:00
Georges-Antoine Assi
2d2a8108d5 Merge pull request #4602 from rommapp/claude/njs-vm-init-notice-c4d538
fix(docker): move the bases to Alpine 3.24 and nginx 1.30.5
2026-09-22 08:40:10 -04:00
Georges-Antoine Assi
9a7680778a test(nginx): guard the njs startup notice with a version floor
Addresses Greptile's review: nothing stopped a later NGINX_VERSION pin from
reintroducing the "js vm init njs" notice this PR removes.

njs 0.9.7 dropped the notice, but the njs build is not a function of the nginx
version alone: nginx's apk repo published 1.30.0 against njs 0.9.6 before
rebuilding it against 0.9.7 and 0.9.8, so 1.30.1 is the first release that
never logs it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 08:23:25 -04:00
Georges-Antoine Assi
e2a1a08ce8 Merge branch 'master' into claude/njs-vm-init-notice-c4d538
master refreshed the Alpine 3.23 digest and added the python-runtime
stage; this branch moves the same pins to Alpine 3.24 and nginx 1.30.5.
Kept 3.24 and re-resolved every tag to its current manifest-list digest,
so the base images carry the patches master was reaching for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 08:19:43 -04:00
Georges-Antoine Assi
a5b51e772a Merge pull request #4592 from rommapp/claude/harden-image-and-workflow-permissions
fix(security): patch OS packages in the published image and scope workflow permissions
2026-09-22 08:13:40 -04:00
Georges-Antoine Assi
93681f459c Merge pull request #4596 from LoneAngelFayt/streaming-patches-4
fix(streaming): put every container in a pool, and reach later pools by key
2026-09-22 08:09:52 -04:00
Georges-Antoine Assi
836d88ad64 Merge pull request #4575 from andest01/chore/vite-config-ts
chore: expand ts typecheck to `frontend/scripts/**/*.ts`
2026-09-22 08:09:49 -04:00
Georges-Antoine Assi
9acdca80f1 docs(skills): drop em-dashes from the frontend check list
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 08:05:57 -04:00
Georges-Antoine Assi
b2d5ffb4b4 chore: split the scripts typecheck into its own script
Keep `typecheck` to vue-tsc and move the tsconfig.node.json pass to
`typecheck:scripts`, run as a separate CI step so a failure names the
pass that broke. Drop the JSON-invalid comments from tsconfig.node.json.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 07:41:36 -04:00
Sam Dornan
9d5c38926b fix(router): re-read the rom on every entry to the details route (#4685) 2026-09-21 23:17:33 -04:00
Georges-Antoine Assi
92ae617057 fix(player): give every player's Play button a gamepad entry point
A player's setup screen has no spatial navigation for a d-pad to walk, and
useGamepad maps no button to Tab, so the Play CTA is the only way a pad gets
into the view. JsDos and Ruffle never focused it at all, leaving DOS and
Flash games unstartable on a controller; Pico8 and Stream only checked the
modality at mount, so picking up a pad after a mouse click stranded the user
the same way #4397 described.

The behaviour moves into usePlayFocus, which claims the CTA once the screen
is ready, again on a switch to a directional device, and again when a running
game hands the screen back. PlayerShell owns it for the three players it
renders; Stream and EmulatorJS, which lay themselves out, call it directly
and drop their hand-rolled copies.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 21:26:12 -04:00
Georges-Antoine Assi
ed15aacd69 fix(v2): read left-stick motion as pad input
The stick is translated into synthetic Arrow keydowns, which bubble to
useInputModality and read as a keyboard press. Buttons re-assert the pad
right after dispatching; the stick never did, so a stick-only user settled
in "key" modality and the grid-nav autofocus, which only claims a page for
"pad", never fired. Nothing was focused, so the arrows had nowhere to go.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 21:26:03 -04:00