Skip to content

fix(site/src): keep copy confirmation until the user's next interaction - #32319

Open
chrifro wants to merge 2 commits into
mainfrom
a11y/content-disappears
Open

chrifro wants to merge 2 commits into
mainfrom
a11y/content-disappears

Conversation

@chrifro

@chrifro chrifro commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Copy confirmations (the tick icon and the "Copied" status) disappeared after a 1 second timer, which fails WCAG 2.2.1 Timing Adjustable. useClipboard now keeps showCopiedSuccess true until the user's next pointer press or key press anywhere on the page, which is the "leave the content on screen until dismissed by the user" fix the audit recommends. Every copy control that uses the hook gets the fix.

TemplateEmbedPageView disabled its copy button while the confirmation showed. Now that the confirmation can stay up indefinitely, the button would have stayed disabled, so it no longer disables.

Closes DEQ-95
Closes DEQ-407
Closes DEQ-494

Ticket UI surface Screenshots
DEQ-95 Account menu deployment ID copy item; Agents "Copy message" button (CopyButton); "Notifications are blocked" error toast before/after
DEQ-407 Workspace page: copy workspace name, agent logs copy, Connect via SSH copy (CopyButton, AgentRow) before/after
DEQ-494 Account menu deployment ID copy item before/after

The DEQ-95 toast was already fixed on main by #30420, which keeps error toasts open until dismissed. This PR covers the tick icon.

Dropped review findings

  • Tooltips that show "Copied!" in place of the action label (CopyableValue, UserDropdownContent, AgentRow, RemoteDiffPanel) keep that text until the next click or key press, so hovering the control again still shows "Copied!". Accessible names don't change. Also dismissing on pointerleave or blur would be a product decision, and the tickets ask for persistence, so I left this unchanged.
Grouping and decision log
  • All three tickets share one root cause: CLIPBOARD_TIMEOUT_MS in site/src/hooks/useClipboard.ts reset showCopiedSuccess after 1 second. Every reported tick icon reads that flag, so one fix in the hook replaces several call-site patches.
  • Dismissal listens for pointerdown and keydown on document in the capture phase, so components that stop propagation (Radix menus) still dismiss it. The event that starts a copy has already been dispatched by the time the listener is attached, so the confirmation does not dismiss itself.
  • I chose dismiss-on-next-interaction over a user-adjustable timeout (the audit's option 2). That option needs a setting and is overkill for a check mark.
  • Tests: timer-based useClipboard tests were replaced. The persistence and dismissal behavior is covered through CopyButton (key press and pointer press), and these tests fail on main. One vacuous "no success timer after unmount" test was removed because no timer exists anymore.
  • Self-review: frontend-review FE1 to FE10 pass. The frontend-deep-review findings were fixed: a dead timer flush, a stale JSDoc bullet, onTestFinished instead of try/finally, and the disabled embed button. In frontend-accessibility, axe-core 4.11 runs on the UserDropdown and WorkspaceTopbar stories in the copied state. They report only the page-level rules that isolated stories ignore, and the results match main.
  • Size: 22 non-test lines, all under site/.

🤖 Generated by Coder Agents on behalf of @chrifro.

@chrifro
chrifro temporarily deployed to main November 17, 2026 14:05 — with GitHub Actions Inactive
@chrifro
chrifro temporarily deployed to main November 17, 2026 14:05 — with GitHub Actions Inactive
@linear-code

linear-code Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

DEQ-494

DEQ-407

DEQ-95

@chrifro
chrifro temporarily deployed to main November 17, 2026 14:06 — with GitHub Actions Inactive
@chrifro
chrifro marked this pull request as ready for review November 17, 2026 14:16
@chrifro
chrifro temporarily deployed to main November 17, 2026 14:16 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
main — 4babd4df Deployed Nov 17, 2026 by chrifro via cla #258674
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant