From a3c3ce4f5192bda6d049be836e563ef69c998962 Mon Sep 17 00:00:00 2001 From: Quang Tran <16215255+trmquang93@users.noreply.github.com> Date: Mon, 27 Apr 2026 23:13:19 +0700 Subject: [PATCH] feat: copy screen ID to clipboard from Sidebar and ScreensPanel 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). --- src/components/ScreensPanel.jsx | 25 ++++++++++++++++++ src/components/Sidebar.jsx | 46 +++++++++++++++++++++++++++++++-- src/pages/docs/userGuide.md | 10 +++++++ 3 files changed, 79 insertions(+), 2 deletions(-) diff --git a/src/components/ScreensPanel.jsx b/src/components/ScreensPanel.jsx index 3e1610f..4990f12 100644 --- a/src/components/ScreensPanel.jsx +++ b/src/components/ScreensPanel.jsx @@ -465,6 +465,31 @@ export function ScreensPanel({ overflow: "hidden", }} > + +
+ {/* TBD toggle */}
diff --git a/src/pages/docs/userGuide.md b/src/pages/docs/userGuide.md index 5f32b0c..ae685df 100644 --- a/src/pages/docs/userGuide.md +++ b/src/pages/docs/userGuide.md @@ -873,6 +873,16 @@ When the MCP server starts, it opens a tiny HTTP listener on `localhost:3337`. T If the user hasn't interacted with the app in the last 60 seconds, the tool returns `{ selection: null, reason: "no_recent_selection" }` so the agent knows to ask instead of acting on stale state. +### Copying screen IDs for agent prompts + +When you ask an AI agent to "edit screen `s_xyz`" or "add a hotspot to `s_xyz`", you'll need that screen's ID. Drawd surfaces it in two places: + +- **Sidebar** — Open a screen's inspector. The monospace ID chip under the screen name is clickable; one click copies it to your clipboard. The chip flips to `Copied!` to confirm. +- **Screens panel** — Right-click any screen row and choose `⧉ Copy Screen ID`. You don't need to select the screen first. + +> [!TIP] +> Connection, hotspot, document, and data-model IDs are not yet copyable from the UI. For those, refer to the `.drawd` JSON or use the MCP server's `list_*` tools. + ### Pre-loading a flow Start the MCP server with an existing `.drawd` file pre-loaded: