Skip to content

fix(dashboard): route all copy actions through the HTTP-safe clipboard helper (Paperclip port) - #80840

Merged
teknium1 merged 1 commit into
mainfrom
paperclip-port/http-safe-clipboard
Aug 17, 2026
Merged

fix(dashboard): route all copy actions through the HTTP-safe clipboard helper (Paperclip port)#80840
teknium1 merged 1 commit into
mainfrom
paperclip-port/http-safe-clipboard

Conversation

@teknium1

@teknium1 teknium1 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

All dashboard copy actions now work on plain-HTTP self-hosted deployments — every direct navigator.clipboard.writeText call in web/src is routed through the existing HTTP-safe copyTextToClipboard helper, 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.isSecureContext is false, navigator.clipboard is undefined, and every copy button silently no-ops. Our dashboard had the identical gap — web/src/lib/clipboard.ts already shipped the fallback (selection-based document.execCommand("copy")), but only OAuthLoginModal used 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 result
  • web/src/pages/SystemPage.tsx: debug-share copy actions → helper
  • web/src/pages/WebhooksPage.tsx: webhook URL/secret CopyButton → helper
  • web/src/lib/clipboard-usage.test.ts (new): source-scan regression test rejecting any direct navigator.clipboard.write* outside lib/clipboard.ts (mirrors Paperclip's guard; reads exempt)

Ours vs theirs

Paperclip #10875 This port
Shared helper already existed, bypassed same situation (web/src/lib/clipboard.ts)
Scope core UI + plugin SDK bridge dashboard web/src (Desktop already has an Electron IPC clipboard shim, not affected)
Regression guard source-level test same, adapted to vitest + our tree

Validation

Check Result
vitest run clipboard-usage.test.ts clipboard.test.ts 5/5 pass
Sabotage run (direct write added) guard test fails as intended
tsc --noEmit (web/) clean

Infographic

http-safe-clipboard

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on eef28ee — Port from paperclipai/paperclip#10875: route all dashboard c

⚠️ Warnings

CI timings · View report · View job

Wall time 24m12s vs 8m (+202.5%). 6 job(s) slower, 13 faster,

  • OSV scan / Scan lockfiles / osv-scan: +53.0s
  • JS & TS checks / apps/desktop / check:test:ui:shard-2of3: -47.0s
  • JS & TS checks / apps/desktop / check:test:ui:shard-1of3: +42.0s
  • JS & TS checks / apps/desktop / check:test:ui:shard-3of3: +34.0s
  • JS & TS checks / apps/desktop / check:lint: -11.0s

OSV vulnerability scan · View job

5 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/dashboard Web dashboard / control panel UI (dashboard/, landing) labels Aug 7, 2026
…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
teknium1 force-pushed the paperclip-port/http-safe-clipboard branch from 6277016 to eef28ee Compare August 17, 2026 02:54
@teknium1
teknium1 merged commit c59c1de into main Aug 17, 2026
39 checks passed
@teknium1
teknium1 deleted the paperclip-port/http-safe-clipboard branch August 17, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants