* fix(v2): copy logs through useClipboard
The log viewer called navigator.clipboard directly. Over plain HTTP (the
common self-hosted setup) that API is undefined, so every copy threw and
showed a generic "Failed to copy logs". Route both copy actions through
useClipboard, which applies the secure-context guard and shows the shared
error that explains HTTPS is required. Drop the now-unused logs.copy-error
key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ThJorfHgTUwsZ9yXHqx17J
* fix(v2): fall back to the link dialog when FilesTab can't copy
FilesTab's copy-link buttons called navigator.clipboard directly, so over
plain HTTP every copy threw and showed "download link copy failed". Check
for a usable Clipboard API first and, when it's missing or the write is
rejected, open CopyDownloadLinkDialog so the link can be copied by hand,
matching useGameActions. Drop the now-unused rom.download-link-copy-failed
key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ThJorfHgTUwsZ9yXHqx17J
* fix(v2): address review feedback on clipboard fallbacks
- useClipboard shows a neutral "Couldn't copy to clipboard" when the write
itself is rejected; the HTTPS hint stays for a missing Clipboard API.
- FilesTab drops the empty catch in favour of a boolean result.
- Cover the selection-toolbar copy link with multiple files selected.
- Trim test comments that restated the test names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ThJorfHgTUwsZ9yXHqx17J
* fix(v2): translate clipboard-write-failed and trim FilesTab comment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ThJorfHgTUwsZ9yXHqx17J
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Every sync:conflict emitter now sends rom_name, so the v2 toast names the
game without hunting through frontend caches. Push-pull emits from the
conflict branch with the matched save's rom_id and comparison reason
instead of rom_id=0. All emit_sync_* helpers go through
socket_handler.emit_to_user, so a broker failure is logged rather than
counted as a failed sync.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With the emits off the response path, the semaphore and gather fan-out
bought nothing. The conflict tests share the module-level negotiate helper
and an emit patch, and the toast tests share their install and fire setup.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
asyncio.run in the threadpool drove the process-wide socket write manager
from a throwaway loop, racing the main loop and leaking Redis pools. The
events now go out after the response on the app loop. Also logs timeouts
distinctly, corrects the connection comments, and unmounts test hosts.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The audit read endpoint keeps the access decision but hands the
category filter to the DB handler, which expands it to actions.
- Trim the log viewer's header comment to two lines and drop its
em-dashes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Record a firmware or rom delete once its row is gone, with whether the
file actually left the disk, even when cleaning up after it fails.
- Record a download only once there's a response to send, so a missing
file or a failed zip isn't logged.
- Release a download's, sign-in's or reset request's dedupe claim when its
event can't be stored, so a retry records it.
- Count the games a collection actually gained or lost.
- Queue the reset-request event before the email, which stops the tasks
after it when it fails.
- Let an event's data be a lookup, run inside the recorder's error
handling, for the hide, unhide and permission events.
- Follow a query change while the Events tab stays open, and don't show a
load error once it has closed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Event log: watch the scroller's own container and web font loads through
vueuse, re-measure only for a font the rows use, and keep the measurers
when only the width changes.
- Measure each word once on one shared canvas, and stop counting lines at
the clamp.
- Set the row geometry once on the list, from one source for the padding
and gap, instead of on every row.
- Share the file-and-size detail between downloads and player loads, read
the collection cover change off the saved data, and use recorded_events()
in the play-session test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Re-measure the phone event rows whenever a web font finishes loading,
and when a scrollbar narrows the rows, not only at mount.
- Log only the kind of an audit claim key when Redis fails, since a
failed sign-in's key holds the text typed as the username.
- Make play-session ingest take the caller's permissions explicitly, so
no caller skips the hidden-rom check by leaving them out.
- Read an empty collection cover URL as no cover, as the other fields do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- On a phone each event lists its title, detail, author and where from,
in that order; the title and detail wrap to two lines, and the list
sizes every row from how its text wraps at the row's width and fonts.
- The event's icon sits on a solid disc of its category's color.
- The event search runs once typing pauses, like the gallery's, instead
of waiting for a Search button; Enter still searches straight away.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A failed login keeps the attempted username only when it names an
account, so a password typed into the username box is never stored.
- Gunicorn trusts X-Forwarded-For only from loopback and private ranges
(FORWARDED_ALLOW_IPS, documented in env.template), so a client can no
longer choose the address the audit log and rate limits see.
- A player's fetch (purpose=play) is recorded as rom.player_load instead
of being skipped, so the marker can't hide a download.
- Play-session ingest treats a rom hidden from the caller as unknown, so
its session and rom.play event don't name it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Trim comments to what the code can't say, type the remaining test
fixtures, and document the audit_events table, GET /api/audit-events
and the cleanup_audit_log task in the backend architecture guide.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- record() takes the request as its actor, and a target can be a
function: the lookups that name it now run inside the recorder's error
handling, and for downloads only once the dedupe lets them record.
That also restores the minimal visibility query on the file route.
- One changed_fields/change pair for rom, user, collection and platform
edits, one collection helper, AuditActor.anonymous, a shared
count_in_window and current_device_id, one test helper for recorded
events and one fixture for audit events.
- The describers share simple/counted/visibility builders and the
eventData readers with notifications, join lists per locale, and treat
any *.delete as unlinked.
- EventLog builds one item list with the phase folded in, keeps each
event's sentence across pages, formats days once, and loads users
through the users store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Hide events on roms of a hidden platform from non-admins.
- Pin later pages to the highest matching id the API returns, not the
first row's: rows are ordered by when they happened, so a play synced
late has a higher id than newer events and was dropped.
- Cap recorded failed sign-ins per address, dedupe reset requests and
record them in the background with the email, and hash claim keys.
- Keep another user's private collection by id only in bulk downloads.
- Check a Range start without int(), which raises past 4300 digits.
- Clear the list when a reload fails, load more only once it's shown,
report a cover change only when the user made one, label only rom and
platform unhides, accept an actor kind the API doesn't know.
- One client IP helper, date-fns for today and yesterday, one time
formatter for the list, no em-dashes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The log tab is as wide as its longest line, so a phone can scroll to the
end of one; the toolbar stays pinned to the left edge meanwhile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Logs now opens on Events (admins only), with the backend log a tab away
at ?tab=logs. Events reads as a timeline: grouped by day, the time and a
category-tinted icon on a rail, then the sentence and who, what, where.
Both tabs scroll as one piece under fixed tabs: the toolbar scrolls away
with the rows, and the log shows its newest line on top, holding still
while you read further down. The event list is windowed and pulls the
next page in as its end comes into view.
An admin keeps the page when DISABLE_LOGS_VIEWER turns the log off. The
settings content also sits closer under the nav bar on phones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each event is one row: an icon tinted by its category (red when
something failed), the sentence, its detail, then who, the device and
the address on one line, with the time on the right. No column labels,
so a phone reads it like the notifications inbox.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings › System › Audit log lists what every user, and RomM itself,
did, newest first: who, what (a sentence built from the event, linking
to its target while it exists), when, and the device and address it
came from. Filters for user, category, date range and a search live in
the URL; later pages stay pinned to the first so new events don't shift
them. Only admins see the entry, and the route guard turns away anyone
else, including a group granted users.read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ROM, file or bulk download is recorded once per caller within ten
minutes, and only when a transfer starts from the first byte, so range
requests and retries don't multiply it. In-browser players mark their
fetch with purpose=play, and the session they report becomes a rom.play
event instead. Feeds and QR links still count as downloads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A kept tag only fills an empty region or language slot: the row's
value may come from a source the scan didn't ask either (a gamelist),
and a hash source's old answer mustn't replace it. Fresh answers still
work as before.
- A rehash that drops the Hasheous match now does so before the tags are
resolved, so the ROM doesn't take tags from the match it's losing.
- One reader for this scan's blob and the stored one, every tag field
recorded (empty lists included), and one ordered list of claims instead
of a dict plus a list.
- The applied sources and the hash sources are ordered in one pass, since
each pass rereads config.yml, instead of adding a read per ROM.
- Tests: one fixture per lookup, the blob assertion folded into the
translated-dump test, and new ones for the gamelist case and the
dropped Hasheous match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The regions, languages and tags a hash-matched source (ScreenScraper,
Hasheous) gave a ROM were only known while that source answered. A scan
that didn't ask it, such as an UPDATE with only IGDB selected or an
UNMATCHED scan of a ROM Hasheous already matched, rebuilt the tags from
the filename and the sources it did ask, and dropped them: the row can't
say which of its tags came from where.
Each hash source now keeps the tags its dump gave in its own blob
(dump_regions, dump_languages, dump_tags), and a scan that doesn't hear
from a source the ROM still carries the id of reads them from there. A
complete rescan still clears the id and blob of a source it drops, so
those tags go with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A queued delivery checks the channel is still confirmed before it
sends, so mail doesn't reach an address swapped in since it was queued.
- A redirect counts as a failed delivery, naming where it pointed, since
redirects aren't followed and it used to be recorded as sent.
- The per-user channel cap is counted and inserted under a lock on the
user's row, so concurrent adds can't go past it.
- The Channels tab drops a reload that raced a change made meanwhile,
reverts only `enabled` when a toggle is refused, and holds the delete
button while its request runs.
- Trim the migration's docstring to one sentence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Addresses Greptile on #4739:
- The gamepad focus halo is an outward box-shadow, so pulling only the
outline inward still left it clipped at the scroller's edge. Key and
pad focus now paint as an inset ring, as AssetGroupHead already does
for the same clip.
- Trim the IndexShell list bleed comment to two lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The platforms and collections index lists had the same gap the gallery
list had: on desktop the rows sat inside the shell's gutter while the
pinned column header's glass ran edge to edge. IndexShell now publishes
its list bleed at every breakpoint, not only on phones and tablets, and
the column rows and headers take that gutter back as padding, so the
columns line up with the toolbar on both sides. With no AlphaStrip here
the bleed is symmetric.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The shell bleeds the column header itself, as it already does in
compact mode, so GameListHeader needs no modifier of its own. Its
min-width lives in the same desktop rule, so the compact placeholder
value for `--r-list-min-w` goes.
- The list min-width no longer counts the rows' leading padding, which
sits in the gutter they bleed into.
- A bled row keeps at least its `--r-space-3` leading padding.
- The row's focus ring is the global one pulled inside by its width,
so it keeps its modality gating and per-modality width.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Now that desktop list rows run to the scroller's left edge, the generic
outset focus ring lost its left side to the scroller's clip. Paint it
inset, as the platform and collection rows already do. Also drop a
`left: 0` on the pinned header glass that changed nothing, since the
scroller clips that overhang anyway.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A channel's min_level is its own enum (info, warning, error), so the
API refuses `success` and neither the list nor the dialog maps it.
- One home each for the admin-reaches-the-LAN rule (the DB handler now
returns the owner's role) and for describing a failed delivery.
- One webhook config builder for create and update, which drops the
secret of a Discord webhook on both.
- SMTP_SECURITY outside starttls/tls/none leaves email off, so the
heartbeat says so, with a warning at startup.
- The attempts counter gets its TTL in the same round trip as INCR.
- Deliveries group channels by user and serialize a notification only
when a channel wants it.
- The v2 side reuses errorMessage (now with a fallback) instead of its
own detail parsing, mirrors the backend length limits as constants,
shares one channel test factory, and derives `created` on save from
the list instead of carrying it on the event.
- Drop RBadge's inline override, which nothing needs now that an inline
badge gets no anchor class, and trim docstrings to one sentence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In desktop list mode the rows sat inside the scroller's left gutter
while the pinned column header's glass ran edge to edge, leaving a gap
on the left of every row. The rows, their loading placeholders and the
column header now bleed out to the left edge and keep that gutter as
their leading padding, so the first column lines up with the toolbar.
The right gutter stays for the AlphaStrip.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Bound a webhook delivery: 15 s in all, and only the first KiB of a
refusal's body is read, so a hostile endpoint can't hold the API or a
worker with an endless or slow reply.
- Key the confirmation-code cooldown per user and per address instead of
per channel, which a delete and re-create reset, so a user can't mail
an address without limit.
- Don't carry a stored secret to another origin or format: it has to be
given again (Discord, which uses none, drops it), so a changed URL
can't be used to read an ntfy token or HMAC key.
- Refuse a webhook URL whose port isn't a number; one got saved and then
broke the channel list with a 500.
- Refuse an unknown SMTP_SECURITY instead of logging in over plaintext.
- Tell the reset form whether reset links are really emailed, which also
needs a shareable ROMM_BASE_URL (heartbeat NOTIFICATIONS.EMAILS_RESET_LINKS).
- Say a code went out only when the address is new to the channel.
- Match a channel's address whole, so a trailing newline isn't kept.
- Test that forgot-password answers alike and sends the link afterwards,
and document the new cache keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit carried only the renames of this change, when staging
the rest failed on a path the rename had already moved. This is the change
itself.
A reset link only ever went to the server log, for an admin to pass on. It
now goes to the user's email address when SMTP is set up, the user has one
and ROMM_BASE_URL is shareable, falling back to the log otherwise or when the
server refuses the message. The link is built from ROMM_BASE_URL alone, never
the request's Host, so a forged header can't aim it at another server; it
goes out after the response, so its timing doesn't reveal whether the
username exists; and a user's inbox gets at most one a minute.
The SMTP sender moves from the notification channels to
handler/email_handler.py now that it has a second caller. The v2 reset form
says the link is on its way when the server sends email.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An inline badge still got its anchor class, whose transform comes later in
the stylesheet than `.r-badge--inline` and so won: the unread count in the
settings sidebar and the user menu sat half a badge up and to the right.
An inline badge now gets no anchor class.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The save and state test fixtures cast partial literals to SaveSchema and
StateSchema, hiding missing required fields from vue-tsc. saveFixture and
stateFixture fill every required field, and each test's own helper now
only sets what it cares about.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Addresses Greptile's review on #4736: the save fixture now spells out
every required SaveSchema field instead of casting a partial literal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The list sits straight on the tab, without a section card around it, and
Add channel goes under it on the left, as Add does under the users table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An empty required field showed the browser's own validation bubble ("Please
fill out this field"), in the system's language and not the app's. RForm now
sets `novalidate`, RTextField marks the field with `aria-required` instead of
`required`, and an empty required field says so in an RTooltip whose text is
a new `required` chrome label backed by `common.required`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
A Channels tab, for every user, lists their webhooks and email addresses
with their filters and last delivery or error, and lets them add, edit,
test, turn off and delete each one. An email address is confirmed with the
code sent to it, right in its row. The form offers email only when the
server has SMTP set up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>