UI: real clipboard copy + "Copied" bubble (works over HTTP) #13

Merged
Cordy merged 1 commit from feat/ui-copy-fallback into main 2026-07-24 20:42:45 +00:00
Owner

Fixes the "copy" button only selecting the text. Root cause: navigator.clipboard is only available in a secure context (HTTPS/localhost); over plain HTTP (the dogfood at .249) it's undefined, so the old handler fell into catch and merely selected the field.

  • New copyText(text, btn) helper: uses navigator.clipboard when available, falls back to a document.execCommand("copy") textarea (works over HTTP), and shows a transient "Copied" bubble tooltip above the button (the requested feedback).
  • Routes all three copy buttons through it (app-password secret, share-link URL, shares-list "copy link") — same latent bug, one fix.
  • Pure web/static/index.html change (CSS .copied-bubble + JS helper + rewired handlers); no behavior change elsewhere.
Fixes the "copy" button only selecting the text. Root cause: `navigator.clipboard` is only available in a **secure context** (HTTPS/localhost); over plain HTTP (the dogfood at `.249`) it's undefined, so the old handler fell into `catch` and merely selected the field. - New `copyText(text, btn)` helper: uses `navigator.clipboard` when available, falls back to a `document.execCommand("copy")` textarea (works over HTTP), and shows a transient **"Copied" bubble** tooltip above the button (the requested feedback). - Routes all three copy buttons through it (app-password secret, share-link URL, shares-list "copy link") — same latent bug, one fix. - Pure `web/static/index.html` change (CSS `.copied-bubble` + JS helper + rewired handlers); no behavior change elsewhere.
ui: real clipboard copy (execCommand fallback over HTTP) + "Copied" bubble on all copy buttons
All checks were successful
ci / test-and-build (pull_request) Successful in 19s
f40e70f78c
Cordy merged commit dd59b9c3db into main 2026-07-24 20:42:45 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#13
No description provided.