Skip to content

Confirm screenshot Copy to Clipboard visually#698

Open
kud wants to merge 4 commits into
gnachman:masterfrom
kud:fix/screenshot-copy-feedback
Open

Confirm screenshot Copy to Clipboard visually#698
kud wants to merge 4 commits into
gnachman:masterfrom
kud:fix/screenshot-copy-feedback

Conversation

@kud

@kud kud commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Problem

The screenshot window's Copy to Clipboard button gives no UI feedback. It writes the image to the pasteboard and returns — no panel close, no label change, nothing. Because the sibling Save button looks like it worked only by closing the panel, Copy reads as a dead button even though the clipboard is correctly populated.

Fix

Add a transient confirmation: on copy, the button briefly becomes a green checkmark + "Copied!" for ~1.2 s, then reverts to its normal title. Wired into both copy paths (copyClicked(_:) and copyToClipboardFromFile(_:)), so it fires regardless of which one handles the image.

Implementation notes:

  • A copyFeedbackGeneration counter invalidates a prior revert timer, so a rapid second copy can't leave the label stuck or revert early.
  • The checkmark uses SFSymbol.checkmarkCircleFill.rawValue rather than a raw SF Symbol string literal, per the project's convention.
  • Not called from the multi-part path — Copy is disabled when cachedNumberOfParts > 1.

Notes

  • Release note added to docs/notes-3.7.txt.
  • Verified with a Development build (tools/build.sh) — compiles clean.

@kud
kud force-pushed the fix/screenshot-copy-feedback branch from 92a7ba7 to 5f451d5 Compare July 5, 2026 00:20
The Copy to Clipboard button wrote the image to the pasteboard
but gave no UI feedback, unlike Save (which closes the panel),
so the button read as dead even though the copy succeeded.

Flash a green “Copied!” confirmation on the button for ~1.2s
in both the standard and streaming copy paths, reverting via a
generation-guarded timer so a rapid second copy can’t stomp it.
@kud
kud force-pushed the fix/screenshot-copy-feedback branch from 5f451d5 to 9a5ea90 Compare July 11, 2026 14:21
@kud

kud commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Heads-up: the failing xcode-tests here isn't from this change. master's own Tests workflow has been red since ~11 Jul — ModernTests/WorkgroupAutoSendClippingsTests.swift no longer compiles because a call to iTermWorkgroupPeerPort.clippingsToAutoSend(...) is missing the newly-added mainSessionState: argument. This PR only touches sources/Screenshots/iTermScreenshotPanel.swift (+ release notes), so the red is inherited from the base branch, not caused here. Happy to rebase once mainline is green.

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