feat: copy saved file path to clipboard after local save

After writing the screenshot to disk, copy its path to the clipboard so
it can be pasted immediately, matching the upload and summary flows. The
save status now shows the copied path. A clipboard error does not fail
the save itself.
This commit is contained in:
2026-07-07 16:37:47 +08:00
parent 85d5fcc722
commit 3aad93e7e8
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -61,6 +61,14 @@ func (s *CaptureActionsService) SaveImage(_ context.Context, pngBytes []byte, di
s.notifyFailure("save failed: " + err.Error())
return "", err
}
// Copy the saved path to the clipboard so the user can paste it right
// away, mirroring how the upload/summary flows copy their result. A
// clipboard failure must not fail the save itself.
if s.Clipboard != nil {
if err := s.Clipboard.WriteText(path); err != nil {
s.notifyFailure("clipboard write failed: " + err.Error())
}
}
if s.Notifier != nil {
s.Notifier.NotifySuccess(path)
}