Skip to content

Improve back button behavior when switching mod page tabs #4335

@PoultryPants

Description

@PoultryPants

Please confirm the following.

  • I checked the existing issues for duplicate feature requests
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions