Show inline message after image has been saved
ClosedPublic

Authored by davidre on May 22 2019, 10:43 AM.

Details

Summary

An inline message with the resulting filename is shown after the screenshot has been successfully saved with a button to open the containing folder. It is also possible to click on the filename to view the image.

Test Plan


Save screenshot and click on the button.The filemanager opens and the saved file is higlighted.

Diff Detail

Repository
R166 Spectacle
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidre created this revision.May 22 2019, 10:43 AM
Restricted Application added a project: Spectacle. · View Herald TranscriptMay 22 2019, 10:43 AM
davidre requested review of this revision.May 22 2019, 10:43 AM
davidre edited the test plan for this revision. (Show Details)May 22 2019, 10:44 AM

+1, I feel like this makes sense, because in this use case you don't get a notification. Or... maybe it should generate a notification?

If we keep this, I'm not sure a link is the appropriate UI. Typically links are used to go to a website in the user's mind so they might not connect it with the locally-saved file. For this, how about a button in the KMessageWidget saying "Show Containing Folder"? This is done by adding a new QAction to the widget.

+1, I feel like this makes sense, because in this use case you don't get a notification. Or... maybe it should generate a notification?

If we keep this, I'm not sure a link is the appropriate UI. Typically links are used to go to a website in the user's mind so they might not connect it with the locally-saved file. For this, how about a button in the KMessageWidget saying "Show Containing Folder"? This is done by adding a new QAction to the widget.

I'm not sure about notification vs. messagewidget. Hmm the notification only has a button to open it in an imageviewer. My intention is that after saving I often want to do something with the file which right now is quite tedious manually navigating to the save location. What about clicking the link open the image and having a button to open the folder?

The notification actually does have a way to show it in the file manager. It's in the context menu, which can be accessed using the hamburger button in the corner of the thumbnail, or right-clicking on the thumbnail.

Thanks never knew that. After thinking about it I prefer the InlineMessage. In my mind it's unusual to show a notification for something which is the normal workflow. The purpose of a notification is to get a user's attention that something has happened.
I had the idea while using KMail yesterday actually. If you save an attachment in KMail an InlineMessage is shown (including the Button you described) and I thought to myself "Why doesn't Spectacle have this".

All right cool, let's do it in Spectacle and add a "Show Containing Folder" button in the message instead of a link.

davidre updated this revision to Diff 58481.May 22 2019, 3:41 PM
davidre edited the test plan for this revision. (Show Details)
  • Show button to open folder
davidre edited the summary of this revision. (Show Details)May 22 2019, 3:46 PM
davidre edited the test plan for this revision. (Show Details)
davidre edited the test plan for this revision. (Show Details)
ngraham requested changes to this revision.May 22 2019, 3:50 PM

The actions aren't deleted when the message goes away, so if you save three images, you get a message with three buttons in it. :) And if you, say, save an image and then upload it to Imgur, the message continues to have the buttons in it.

This revision now requires changes to proceed.May 22 2019, 3:50 PM
davidre updated this revision to Diff 58482.May 22 2019, 3:53 PM
  • Properly remove the actions before showing a new inline message

Almost perfect. I see one remaining issue: when you click "Copy to clipboard", a message appears that times out in a few seconds. Thereafter, all of the "image saved" messages also time out even though they otherwise don't.

Are you sure? The image saved messages should also time out and do for me too. You just have to wait the time specified in line 371 i.e. 10 seconds.

I see another bug however: If a message is displayed that times out after 10 seconds and inside that time frame (let's say after 8 seconds) another inline message is shown (even if it it should be persistent) the widget hides after 2 seconds. But this bug existed before this patch (i.e with sharing and copying to the clipboard).

ngraham accepted this revision.May 22 2019, 4:57 PM

I see another bug however: If a message is displayed that times out after 10 seconds and inside that time frame (let's say after 8 seconds) another inline message is shown (even if it it should be persistent) the widget hides after 2 seconds. But this bug existed before this patch (i.e with sharing and copying to the clipboard).

Right. But that pre-existing problem becomes more severe the more of these messages we add. I guess we can fix that in another patch though.

Do you have commit access yet?

This revision is now accepted and ready to land.May 22 2019, 4:57 PM

I see another bug however: If a message is displayed that times out after 10 seconds and inside that time frame (let's say after 8 seconds) another inline message is shown (even if it it should be persistent) the widget hides after 2 seconds. But this bug existed before this patch (i.e with sharing and copying to the clipboard).

Right. But that pre-existing problem becomes more severe the more of these messages we add. I guess we can fix that in another patch though.

Do you have commit access yet?

Nope, how would I go about it to gain commit access?

This revision was automatically updated to reflect the committed changes.