Skip to content

fix(tui): drop the redundant copy toast when the inline "copied" flash shows#3539

Merged
dgageot merged 1 commit into
docker:mainfrom
dgageot:fix/tui-copy-double-feedback
Jul 8, 2026
Merged

fix(tui): drop the redundant copy toast when the inline "copied" flash shows#3539
dgageot merged 1 commit into
docker:mainfrom
dgageot:fix/tui-copy-double-feedback

Conversation

@dgageot

@dgageot dgageot commented Jul 8, 2026

Copy link
Copy Markdown
Member

Clicking a copy button in the TUI — the "⎘ copy" label on an assistant message or the copy icon on a code block — was showing two pieces of feedback at once. The inline "copied" flash (introduced in a recent commit) would appear, and simultaneously the pre-existing "Text copied to clipboard." toast would fire. Because toasts stack and linger for 10 seconds, repeated clicks could pile them up noticeably.

The fix splits copyTextToClipboard in clipboard.go into two functions: copyTextToClipboardSilent (which writes to the clipboard and emits tea.SetClipboard only) and a thin wrapper that adds the toast on top. The two click handlers in messages.go that already have an inline flash are switched to the silent variant. The drag-selection and keyboard "c" copy paths keep the toast since they have no other visual confirmation.

@dgageot
dgageot requested a review from a team as a code owner July 8, 2026 14:56

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The change cleanly splits copyTextToClipboard into a silent variant (no toast) and a thin wrapper that preserves the toast, then routes the two inline-flash click handlers through the silent path. The logic is correct and the pre-existing drag-selection / keyboard copy paths are unaffected.

@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Jul 8, 2026
@dgageot
dgageot merged commit 769869b into docker:main Jul 8, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants