Skip to content

Fix clipboard copy controls that report success after failure #266

Description

@tsouth89

Problem

CopyIconButton calls navigator.clipboard.writeText(...) without awaiting it, then immediately shows the copied state. If clipboard access is denied or the write rejects, Ceiling still tells the user the value was copied.

The idle accessible name also uses ActionCopyError, so a screen reader announces “Copy error” before the user has tried to copy anything.

Where

  • apps/desktop-tauri/src/components/MenuCard.tsx (CopyIconButton)
  • Used for provider errors in MenuCard.tsx
  • Used for login/device codes in settings/tokens/TokenAccountsPanel.tsx and settings/providers/sections/QuickActionsSection.tsx

Expected behavior

  • Await the clipboard write.
  • Show the copied state only after the promise resolves.
  • Expose a short failure state if the write rejects.
  • Add/use a neutral localized “Copy” label for the idle button.
  • Keep the current copied-state timeout after a successful write.

Tests

Add focused component tests for resolved and rejected clipboard promises, and assert the idle/success/failure accessible names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityAccessibility (a11y) improvements and fixesbugSomething isn't workinggood first issueGood for newcomersjavascriptPull requests that update javascript code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions