fix(dashboard): route all copy actions through the HTTP-safe clipboard helper (Paperclip port) - #80840
Merged
Merged
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on eef28ee — Port from paperclipai/paperclip#10875: route all dashboard c
|
…ns through the HTTP-safe clipboard helper Self-hosted dashboards served over plain HTTP on a LAN have no navigator.clipboard (insecure context), so every direct writeText call silently failed. web/src/lib/clipboard.ts already ships the HTTP-safe copyTextToClipboard fallback but only OAuthLoginModal used it; ChatPage (OSC 52 + Ctrl/Cmd+Shift+C), ProfilesPage, SystemPage, and WebhooksPage all bypassed it. Route them through the helper and add a source-level regression test that rejects any new direct clipboard write outside lib/clipboard.ts (clipboard reads are exempt: no legacy fallback exists). Sabotage-verified: the guard test fails when a direct write is introduced.
teknium1
force-pushed
the
paperclip-port/http-safe-clipboard
branch
from
August 17, 2026 02:54
6277016 to
eef28ee
Compare
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
All dashboard copy actions now work on plain-HTTP self-hosted deployments — every direct
navigator.clipboard.writeTextcall inweb/srcis routed through the existing HTTP-safecopyTextToClipboardhelper, with a source-level regression test locking the pattern in.Ported from paperclipai/paperclip#10875, which fixed the same bug class in their board UI: operators open self-hosted control planes over plain HTTP on a LAN,
window.isSecureContextis false,navigator.clipboardis undefined, and every copy button silently no-ops. Our dashboard had the identical gap —web/src/lib/clipboard.tsalready shipped the fallback (selection-baseddocument.execCommand("copy")), but onlyOAuthLoginModalused it.Changes
web/src/pages/ChatPage.tsx: OSC 52 terminal copy + Ctrl/Cmd+Shift+C direct copy →copyTextToClipboard(paste/read paths untouched — no legacy read fallback exists)web/src/pages/ProfilesPage.tsx: profile setup-command copy → helper, toast on real resultweb/src/pages/SystemPage.tsx: debug-share copy actions → helperweb/src/pages/WebhooksPage.tsx: webhook URL/secret CopyButton → helperweb/src/lib/clipboard-usage.test.ts(new): source-scan regression test rejecting any directnavigator.clipboard.write*outsidelib/clipboard.ts(mirrors Paperclip's guard; reads exempt)Ours vs theirs
web/src/lib/clipboard.ts)web/src(Desktop already has an Electron IPC clipboard shim, not affected)Validation
vitest run clipboard-usage.test.ts clipboard.test.tstsc --noEmit(web/)Infographic