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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user