Improve back button behavior when switching mod page tabs
Please confirm the following.
- [x] I checked the existing issues for duplicate feature requests
- [x] I have checked that this feature request is not on our roadmap
What parts of Modrinth is your feature request related too?
Website
Is your suggested feature related to a problem? Please describe.
When browsing a mod, switching between tabs (Overview, Versions, Gallery, etc.) adds entries to the browser’s history. This makes the back button step through each tab before finally returning to the mods list. For users it feels unintuitive because if I opened a mod from the mods list, I usually expect the back button to take me back there directly.
Describe the solution you'd like
Use the History API’s replaceState instead of pushState when switching between tabs cuz this way the URL still tells the user the selected tab (so users can share/bookmark links) but it won’t create extra history entries. Then pressing back would then go straight to the previous page like /mods instead of each tab inbetween.
Describe alternatives you've considered
If you leave it how it is but this fills up all your history and makes browsing through multiple mods slower. Another alternative would be to add an explicit “Back to mods list” button on the mod page, but making back button behavior intuitive is simpler and more standard.
Additional context
No response
I don't think this is how people would expect it to work, I think that would confuse and annoy people
Well idk I guess that’s your opinion. I do personally believe this makes more sense. Even if it makes less sense, it definitely makes the page quicker to navigate. You can already switch between the sections of a mod page with one click since the description / gallery / changelog text is always available at the top of the page. Often I find myself taking a look at a mod, and I want to see a few different pictures of it and see what version it’s available for. Then I find I don’t want to use it, or I do and I downloaded it, and I want to go back to whatever list of mods I was browsing through. Right now I need to spam the back button on my mouse to get there, whereas I think it would make a lot more sense if just one click took me there. There is no other easy way to leave a mods page and go back to a list other than to go back, or to go find whatever list you where looking through all over again.
I don't think this is how people would expect it to work, I think that would confuse and annoy people
I collected some suggestions and was about to report this issue when I found this one. Can I submit a PR to improve this experience? I think it would be more comfortable to get clear feedback when clicking the back button.