Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

Better Media Saving Behavior

Open GuardianMajor opened this issue 8 years ago • 4 comments

I have:

  • [x] searched open and closed issues for duplicates
  • [x] read https://github.com/WhisperSystems/Signal-Android/wiki/Submitting-useful-bug-reports

Bug description

One of the features that was missing for a long time but thankfully has been recently implemented was the ability to swipe through the images without having to keep going back to the index and always having it start at the top. Kudos and thanks for that.

However, another element exists that can be greatly improved and probably just got missed; and hopefully can be added. Currently each picture ("media") provides you the save button on the top. However, it never detects that the item has already been saved and you have to just remember it or go check your on device gallery to see if it is already there. Instead, it simply keeps making duplicates of the item and just incrementing it. It would't be too difficult to do a simple if/exists > show view/share icon else/doesn't > show save icon (as it is now). This will spare the need to save multiple duplicates and incrementing it when you can simply provide a visual check that it has already been saved. It is simply better UX and cleaner that way.

Steps to reproduce

  • save an item
  • save it again
  • you have a duplicate with a -1 at the end
  • save it again
  • you now have 3 with a -1 and -2 of the same item
  • repeat and goes on as long as you keep saving

Expected result: Detect that the item has already been saved and either provide a view icon or share icon to visually indicate it has been saved already, otherwise show the save button. A simple file system check for the item will facilitate this.

Thanks in advance.

GuardianMajor avatar Jan 16 '18 22:01 GuardianMajor

I think the current approach is safer because Signal save the media to the common android directory and there's a probability other application will save a different file with the same name.

There is a potential to add extra validation (in addition to file system exists() check) before disabling the save button (maybe comparing the file checksum?). But wouldn't this too much work for the device to just toggle the save button?

nribeka avatar Jan 30 '18 14:01 nribeka

@nribeka Given that the filename used by Signal to save is rather unique, I highly doubt it will ever encounter another app saving with the filename beginning with the word Signal and the exact date/time hash that follows. That being said, checking the file by doing a size/name hash is not that labor intensive or beyond the capability of the app, given that nearly every app out there performing the same function can pull it off without issue, it is not outside the capability of the Signal team, just perhaps their motivation.

GuardianMajor avatar Feb 04 '18 19:02 GuardianMajor

Other apps might've edited that file and saved it with the same name, e.g. when you edit a saved image with your image editor.

I think you shouldn't toggle the save button off. My suggestion is,

upon tapping on save button, if the filename exists, calculate the checksum,
    if the checksum matches > prompt user "File already there, do you want to save another copy?"
        answering "Yes" will save a copy as it does now.
        "No" will do nothing
    else > save as you do currently.

planning on getting involved in the project. Might make a pr soon.

BorhnN avatar Apr 02 '18 16:04 BorhnN

GitHub Issue Cleanup: See #7598 for more information.

automated-signal avatar Apr 03 '18 04:04 automated-signal