feat: use router.replace for project filters to prevent history pollution (#5378)

* fix(navigation): use replaceState for project filters to prevent history pollution

* fix: add replace prop to NavTabs and enable it on project and discover pages

* style: run pnpm run fix on affected files

* enable NavTabs replace prop on collection, user, and org pages

---------

Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
This commit is contained in:
Mingxuan Ding
2026-03-10 04:09:44 +08:00
committed by GitHub
parent 4cfac2c8a2
commit 5a51a755eb
6 changed files with 37 additions and 27 deletions

View File

@@ -11,6 +11,7 @@
v-show="link.shown ?? true"
:key="link.href"
ref="tabLinkElements"
:replace="replace"
:to="query ? (link.href ? `?${query}=${link.href}` : '?') : link.href"
class="button-animation z-[1] flex flex-row items-center gap-2 px-4 py-2 focus:rounded-full"
:class="getSSRFallbackClasses(index)"
@@ -71,6 +72,7 @@ interface Tab {
const props = withDefaults(
defineProps<{
replace?: boolean
links: Tab[]
query?: string
mode?: 'navigation' | 'local'