feat: copy screen ID to clipboard from Sidebar and ScreensPanel#44
Merged
trmquang93 merged 1 commit intomainfrom Apr 27, 2026
Merged
feat: copy screen ID to clipboard from Sidebar and ScreensPanel#44trmquang93 merged 1 commit intomainfrom
trmquang93 merged 1 commit intomainfrom
Conversation
Surfaces screen IDs in the UI so users can grab them for AI agent prompts without opening the .drawd JSON. The selected-screen Sidebar shows a monospace ID chip under the screen name; clicking it copies the ID and flips in place to "Copied!" for COPY_FEEDBACK_MS. The ScreensPanel right-click menu also gains a "Copy Screen ID" entry as its first item, so users can copy without selecting first. Both affordances are read-only-safe (copying is non-mutating). Mirrors the existing ShareModal clipboard pattern. No new hook/util. Connections, hotspots, documents, and data-models are deferred per backlog 5.2 scope decision (MVP-only-screens).
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.
Summary
Copied!forCOPY_FEEDBACK_MS(2s).⧉ Copy Screen IDas the first entry in the ScreensPanel row context menu, so users can copy a screen's ID without selecting it first.#/docs) with a new### Copying screen IDs for agent promptssubsection under the MCP area, including a> [!TIP]callout noting that connection/hotspot/document/data-model copy is deferred.Closes the MVP scope of backlog item 5.2 — Copy Screen ID to Clipboard (
backlog/items/5.2-copy-screen-id-to-clipboard.json). Connections, hotspots, documents, and data-models are explicitly deferred to a follow-up item.Why
Screen IDs were not surfaced anywhere in the UI, so users working with the MCP server or AI agents had to open the raw
.drawdJSON to reference a screen by ID. This breaks the visual-to-instruction pipeline that Drawd is built for. The chip-as-affordance pattern (mirroring GitHub commit-SHA chips) keeps the UI chrome-free while making IDs both visible and one-click copyable.Implementation notes
navigator.clipboard.writeTextis called directly, mirroring the existingShareModal.jsxpattern.COPY_FEEDBACK_MSfromsrc/constants.jsandCOLORS/FONTSfromsrc/styles/theme.js.Sidebarresets theidCopiedflag viauseEffect([screen.id])so feedback never lingers across screen switches.Test plan
Copied!and reverts after ~2s; paste in a text field to confirm clipboard content matchesscreen.id.Copied!window → verify B shows its own ID immediately (no leftoverCopied!).⧉ Copy Screen ID→ verify clipboard contains that screen's ID and the menu closes.⧉ Copy Screen IDentry is visible and works; other gated entries remain gated.<button>, focusable).#/docs): the new### Copying screen IDs for agent promptssubsection renders with the> [!TIP]callout.npm run lintpasses.npm run buildpasses.npm test— pre-existingmcp-server/Satori failures are unchanged; all other suites pass.