UX: Close image viewer on browser back #1514

Closed
opened 2026-02-20 00:14:01 -05:00 by deekerman · 8 comments
Owner

Originally created by @agramner on GitHub (Aug 1, 2022).

Originally assigned to: @lastzero, @heikomat on GitHub.

Is your feature request related to a problem? Please describe.

I mostly use PhotoPrism as PWA on mobile (Chrome Android) and one usage pattern I always do wrong (and annoys me) is:

  1. I'm scrolling the gallery, looking at my pictures and find a picture I want to take a closer look at
  2. I'm pressing the picture and the image viewer opens
  3. After I'm done looking at the picture I press the native back button on my phone
  4. I expect the image viewer to close but it doesn't.
  5. I press the close button in the top right corner instead
  6. I find the back action just navigated away from where I was in the gallery page and I need to start over scrolling the gallery (or do a new search)

I do this all the time and I guess it's because the (Samsung) gallery app on my phone closes the image viewer on back button.

Describe the solution you'd like

I think most users would expect the image viewer to close when pressing the back button

Describe alternatives you've considered

Maybe move the close button and/or change the icon to a back arrow

Additional context

Maybe a URL hash part (for example #imageviewer) could be added to the URL when the image viewer is opened

Originally created by @agramner on GitHub (Aug 1, 2022). Originally assigned to: @lastzero, @heikomat on GitHub. **Is your feature request related to a problem? Please describe.** I mostly use PhotoPrism as PWA on mobile (Chrome Android) and one usage pattern I always do wrong (and annoys me) is: 1. I'm scrolling the gallery, looking at my pictures and find a picture I want to take a closer look at 2. I'm pressing the picture and the image viewer opens 3. After I'm done looking at the picture I press the native back button on my phone 4. I expect the image viewer to close but it doesn't. 5. I press the close button in the top right corner instead 6. I find the back action just navigated away from where I was in the gallery page and I need to start over scrolling the gallery (or do a new search) I do this all the time and I guess it's because the (Samsung) gallery app on my phone closes the image viewer on back button. **Describe the solution you'd like** I think most users would expect the image viewer to close when pressing the back button **Describe alternatives you've considered** Maybe move the close button and/or change the icon to a back arrow **Additional context** Maybe a URL hash part (for example #imageviewer) could be added to the URL when the image viewer is opened
deekerman 2026-02-20 00:14:01 -05:00
Author
Owner

@ark- commented on GitHub (Aug 2, 2022):

Agreed, I swipe backwards on iPhone (equivalent to back on Android) and the same happens to me. Instead I have to swipe down.

Issue #1307 is looking to revamp the photo viewer. So perhaps this should be rolled into that work?

@ark- commented on GitHub (Aug 2, 2022): Agreed, I swipe backwards on iPhone (equivalent to back on Android) and the same happens to me. Instead I have to swipe down. Issue #1307 is looking to revamp the photo viewer. So perhaps this should be rolled into that work?
Author
Owner

@lastzero commented on GitHub (Aug 2, 2022):

You're welcome to send a pull request while we are on vacation! I think we had history mode turned on but it interfered with the new (faster) scrolling, which is why I've turned it off recently. Handling the events manually instead of using the built-in handler should work. Just didn't have any time for that so far.

@lastzero commented on GitHub (Aug 2, 2022): You're welcome to send a pull request while we are on vacation! I think we had history mode turned on but it interfered with the new (faster) scrolling, which is why I've turned it off recently. Handling the events manually instead of using the built-in handler should work. Just didn't have any time for that so far.
Author
Owner

@agramner commented on GitHub (Aug 13, 2022):

Ok I see. May try to fix this if I have some time over.

@agramner commented on GitHub (Aug 13, 2022): Ok I see. May try to fix this if I have some time over.
Author
Owner

@lastzero commented on GitHub (Aug 13, 2022):

Awesome, thank you! It's probably related to this issue:

See the code I referenced in https://github.com/photoprism/photoprism/issues/2597#issuecomment-1211188162.

@lastzero commented on GitHub (Aug 13, 2022): Awesome, thank you! It's probably related to this issue: - #2597 See the code I referenced in https://github.com/photoprism/photoprism/issues/2597#issuecomment-1211188162.
Author
Owner

@heikomat commented on GitHub (Aug 13, 2022):

Ok I see. May try to fix this if I have some time over.

@agramner I'm highly interested in fixing history mode, and am the one who implemented the virtualization that was the cause to disable it.

But like you, my time is tight, so I just haven't had the possibility to do so.
I'll probably have some time the coming Friday (19.08.).

If you find the time to implement fixes before I do, please feel free to ask anything you'd like to know about the virtualization. I'm happy to help you out where I can

@heikomat commented on GitHub (Aug 13, 2022): > Ok I see. May try to fix this if I have some time over. @agramner I'm highly interested in fixing history mode, and am the one who implemented the virtualization that was the cause to disable it. But like you, my time is tight, so I just haven't had the possibility to do so. I'll probably have some time the coming Friday (19.08.). If you find the time to implement fixes before I do, please feel free to ask anything you'd like to know about the virtualization. I'm happy to help you out where I can
Author
Owner

@agramner commented on GitHub (Aug 13, 2022):

@heikomat Aah ok, nice work with the scroll performance! A really great improvement of a key feature.

To be honest. I probably won't have that much time the coming weeks but if I decide to have a go at this I'll probably have some questions for you 🙂.

@agramner commented on GitHub (Aug 13, 2022): @heikomat Aah ok, nice work with the scroll performance! A really great improvement of a key feature. To be honest. I probably won't have that much time the coming weeks but if I decide to have a go at this I'll probably have some questions for you 🙂.
Author
Owner

@dror3go commented on GitHub (Sep 16, 2022):

Looks good!

@dror3go commented on GitHub (Sep 16, 2022): Looks good!
Author
Owner

@ark- commented on GitHub (Sep 17, 2022):

Working nicely for me too, thank you :)

@ark- commented on GitHub (Sep 17, 2022): Working nicely for me too, thank you :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#1514
No description provided.