feat: support navigating to primary pages via URL query parameter

Allow users to open a specific primary page by visiting /?page=explore,
/?page=settings, etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
codytseng 2026-02-09 22:11:26 +08:00
parent 71dc0bb4fc
commit 2b97adfdca

View file

@ -139,6 +139,10 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
navigatePrimaryPage('relay', { url })
}
}
const page = searchParams.get('page')
if (page && page in PRIMARY_PAGE_MAP) {
navigatePrimaryPage(page as TPrimaryPageName)
}
}
const onPopState = (e: PopStateEvent) => {