xemle / home-gallery

Self-hosted open-source web gallery to view your photos and videos featuring mobile-friendly, tagging and AI powered image discovery
https://home-gallery.org
MIT License
836 stars 64 forks source link

MediaView next/prev change history #123

Closed Nikolape closed 8 months ago

Nikolape commented 9 months ago

Changid so that wney you go to next/prev image/video it's not stored browser history.

Reson my intuition tells me that if I press the back button I should go back to the image wall and not to the previous image like any other photo app.

How it works now: Screencast from 24-02-24 00:20:36.webm

xemle commented 9 months ago

Hi @Nikolape

thank you very much for your valuable PR and your time to enhance HomeGallery. Your basic idea to change the prev/next behavior is a good point.

I have some questions about your changes, which I will post inline to the code...

Nikolape commented 8 months ago

Hi I don't know if you added your questions or I just can't see them?

xemle commented 8 months ago

I see my comments in the github web page. E.g. via https://github.com/xemle/home-gallery/pull/123/files/954166f0220bf78cfa120ff35d88fec832476593

Nikolape commented 8 months ago

image That is all I see Can you show how they are supposed to work

xemle commented 8 months ago

Strange. I see my comment like the following screenshot: image

How can we proceed?

Nikolape commented 8 months ago
navigate(`/view/${shortId}`, {state: {index, listLocation}, replace: true});

This code replaces state of the browser instead of pushing the last state in to history. I've been using home-gallary for the past 2 weeks. And I don't use tags so I don't know of any edge case with tags. I didn't know that HOME and END are usable so i didn't change the code for them but it would be great if changed.

xemle commented 8 months ago
navigate(`/view/${shortId}`, {state: {index, listLocation}, replace: true});

I added this line in 28b2608. Is that OK with you? If so, please close this PR.

And I don't use tags so I don't know of any edge case with tags.

Yes, the vanish tag is a special use case if you list your media by a tag and remove the that search tag from the image. E.g. you have https://demo.home-gallery.org/search/tag:road and you remove the tag road from the single view. Never mind.

I didn't know that HOME and END are usable so i didn't change the code for them but it would be great if changed.

I though it might become handy. ... Anyway. I think your idea is very good and the solution is simple to cover all use cases. Thank you very much for your time and your effort