Files
romm/frontend
Sam Dornan b2833e5e66 fix(v2): handle copy to clipboard over plain HTTP in logs and files tab (#4757)
* 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>
2026-09-24 14:09:01 -05:00
..
2026-05-30 20:53:52 -04:00
2026-07-26 14:14:07 -04:00