Conversation
Each issue row's ID cell gets a copy button (clipboard API with execCommand fallback), shown on hover and always on touch. Click copies the ID with stopPropagation so the detail panel doesn't toggle, and shows a check for 1.2s. The canvas iframe is cross-origin, so CanvasPane grants allow=clipboard-write. The copied id is stripped of control chars to prevent pastejacking, and the fallback textarea is cleaned up via finally. Adds 3 E2E tests using a web-first assertion for the feedback class.
Assume a modern browser/Electron host where navigator.clipboard.writeText is available on the loopback (secure-context) canvas origin after a user click. Collapses copyTextToClipboard to a single Clipboard API call (keeping control-char sanitization) and removes the unused failure-feedback path. Net -28 lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Beadspace canvas dashboard shows each issue's ID in the table, but there was no quick way to grab it — you had to manually select the text. Copying an ID (e.g. to paste into a
bdcommand or a commit message) is a frequent action and deserved a one-click affordance.Changes
src/Server/BeadspaceTemplate.html— a copy-to-clipboard button next to every issue ID:col-idcell; the icon swaps to a green check for 1.2s on success.copyTextToClipboardusesnavigator.clipboard.writeTextwith adocument.execCommand('copy')textarea fallback for environments where the async API is unavailable.e.stopPropagation()so copying does not toggle the row's detail panel.\u0000-\u001F\u007F) before being written, preventing clipboard/pastejacking injection.finally, so a throwingexecCommandcan't leak detached DOM nodes.aria-label,title, and a:focus-visibleoutline.src/Client/CanvasPane.fs— addsallow="clipboard-write"to the canvas iframe. The dashboard runs cross-origin (127.0.0.1:5002) inside the app, so the Clipboard API needs this Permissions-Policy delegation.src/Tests/BeadspaceCanvasTests.fs— three Playwright E2E tests:copiedfeedback class to avoid a TOCTOU flake against the self-clearing timer).stopPropagationchange).Tests
dotnet test— BeadspaceCanvas E2E suite: 14/14 passing (includes the 3 new tests; the clipboard-read assertion confirms the copy works end-to-end).dotnet build src/Client/Client.fsproj— succeeds, 0 warnings.