-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser back functionality #819
Comments
hi,
a while ago a spent a lot of time on this (maybe I even did a write up)
unfortunately I could not find any working solution to fix this.
…On Mon, Jan 22, 2024 at 5:32 PM rcsas ***@***.***> wrote:
I'm always frustrated when I hit the browser back button (or back gesture
on mobile), and pigallery2 takes me back to the last page I visited.
For example, I select an album from the main gallery page, then open
picture 10, and move forward to picture 15, one by one. If I go back using
the browser button or gesture, it takes me to the previous images I've
seen. So in reverse sequence it whould go to image 14, 13, 12 11, 10, then
the album page and then the gallery main page.
What I'd like it to do is to navigate upwards in the hierarchy and not
back.
If viewing a picture, I'd like it to close the picture viewer and show me
the album I was browsing, at the picture position.
If browsing an album, I'd like it to take me back to the list of albuns
(or the search results), ideally scrolling to the position where the album
is and not showing the top of the albuns page.
I've seen some sites behaving like this. I think that essentially, when
opening the image, the URL won't change, but the image is opened in an
internal container in the page.
Don't know it there are other ways to manipulate the browser back
functionality
—
Reply to this email directly, view it on GitHub
<#819>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZKA5V3NS6QQBTBY6EWE33YP2IAPAVCNFSM6AAAAABCFQDZJ6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4TIMRZGUZTIMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Had the same problem, very much looking forward to this new feature! |
Hi, I found a solution to this issue last year, at the time I hadn't seen any issues for it, I assumed I was the only person annoyed by this and never bothered to formalize my code change into a pull request. It took me a long time to research but eventually I discovered that angular has a not very well documented optional parameter To support the requested behavior you only need three code changes on two files:
To:
Function From
To
and in Function From
To
I figure you could make this a user setting and pass that variable as the skipLocationChange value, just incase you want to keep functionality backwards compatible. |
I know its technically possible, but I remember I run into some logical issue. I spent multiple days on this issue when I was updating the UI. Let me try to reconstruct: folder structure:
You navigate (
Technical limitations:
|
In the example provided if you took my code changes suggestions as is, clicking on the image (flows 2 and 3) wouldn't push a new navigation state to the browser navigation stack.
But it is entirely possible I am misunderstanding your example. I think the critical part you want is the ability to view an image and copy and paste the URL to share it. Therefore, yes you are correct, that this cannot be solved given those requirements, but I would question if everyone shares in having those same technical requirements. This is why I believe that if you chose to implement this feature you should provide it as an optional user setting so that those who want image viewing to update browser history can have it, while those who do not can live with the side effects. Ultimately this is your project and you are free to develop it to your use cases. |
Now I remember, my issue was that I want to represent the image in the URL. Just had an other observation: I was playing around with Facebook and it seems that they managed to properly implement it (not yet sure how tho).
|
I am also deeply troubled by this issue and look forward to its resolution |
Coincidentally, I'm running into this issue as well, hopefully the next version will improve him ... |
I had a little time to delve into this again. I found that there was a different optional argument you can pass that seems to create the behaviour you are asking for. I've made a branch on my fork where you can see the code change. |
(I only have problems so far, not solutions :) ) Looking at the gif you
provided: My problem is that hitting the back button, the app should
navigate back to the timestamp folder (ie.: to the screen where you have
previously been before entering the preview mode). But it now navigates
back to the root folder.
…On Thu, 10 Oct 2024 at 03:47, Anthony Marcheselli ***@***.***> wrote:
I had a little time to delve into this again. I found that there was a
different optional argument you can pass that seems to create the behaviour
you are asking for. I've made a branch on my fork where you can see the code
change
<master...roastedGhosty:pigallery2:historyFix>
and also have made a little gif to show how it works.
firefox_GoDNIcs2lb.gif (view on web)
<https://github.com/user-attachments/assets/b038c66b-fb05-4f9d-a6f6-6e2b8f014ed4>
—
Reply to this email directly, view it on GitHub
<#819 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZKA5U6JRPSNPOBXXJ3C43Z2XMBLAVCNFSM6AAAAABCFQDZJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBTG4ZTEMRVGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It now keeps the gallery as part of the navigation state. Code Change |
Looks nice! @bpatrik can you see if this serves your needs and if so, merge it? It certainly seems to serve mine |
I'm always frustrated when I hit the browser back button (or back gesture on mobile), and pigallery2 takes me back to the last page I visited.
For example, I select an album from the main gallery page, then open picture 10, and move forward to picture 15, one by one. If I go back using the browser button or gesture, it takes me to the previous images I've seen. So in reverse sequence it whould go to image 14, 13, 12 11, 10, then the album page and then the gallery main page.
What I'd like it to do is to navigate upwards in the hierarchy and not back.
If viewing a picture, I'd like it to close the picture viewer and show me the album I was browsing, at the picture position.
If browsing an album, I'd like it to take me back to the list of albuns (or the search results), ideally scrolling to the position where the album is and not showing the top of the albuns page.
I've seen some sites behaving like this. I think that essentially, when opening the image, the URL won't change, but the image is opened in an internal container in the page.
Don't know it there are other ways to manipulate the browser back functionality
The text was updated successfully, but these errors were encountered: