Skip to content

Show minimal user feedback when a code-block Copy action fails #345

Open

Description

@yaacovcorcos

Problem

The message Copy button uses the shared clipboard helper and anchored feedback. The Markdown code-block Copy action calls navigator.clipboard.writeText directly; its failure callback in ChatMarkdown.tsx only logs to the console. A user can click Copy, have nothing copied, and receive no visible explanation.

Relevant code: apps/web/src/scient/presentation/CodeBlockActions.tsx, apps/web/src/components/ChatMarkdown.tsx, apps/web/src/hooks/useCopyToClipboard.ts, and apps/web/src/components/ui/anchoredCopyToast.ts.

This is an independent code-path gap, not the cause of the reported composer paste failure; that Copy action succeeded and the exact text reached the clipboard.

Desired behavior

Use Scient's existing reliable text-copy path and restrained anchored feedback where appropriate. On failure, show a small transient message near the Copy control, not a page-wide error. Keep the brief Copied success state and avoid duplicate notifications.

Validation

Test API success, unavailable/rejected API with fallback, complete failure, and unmount during an in-flight copy. Confirm the visible state matches actual clipboard success. Scope this to affected text-copy actions; do not rewrite unrelated binary or structured clipboard flows without evidence.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions