feat(web): redesign responsive settings navigation (#1027)

This commit is contained in:
SSU-WEI HUANG
2026-07-13 08:42:25 +08:00
committed by GitHub
parent b9eed7c071
commit f6ad345339
24 changed files with 1218 additions and 1730 deletions
+11 -3
View File
@@ -1,6 +1,13 @@
import { useCallback } from 'react'
import { useLocation, useNavigate, useRouter } from '@tanstack/react-router'
export function getSettingsBackTarget(pathname: string): string | null {
if (pathname === '/settings') return '/sessions'
if (pathname === '/settings/voice/advanced' || pathname === '/settings/voice/voices') return '/settings/voice'
if (pathname.startsWith('/settings/')) return '/settings'
return null
}
export function useAppGoBack(): () => void {
const navigate = useNavigate()
const router = useRouter()
@@ -14,9 +21,10 @@ export function useAppGoBack(): () => void {
return
}
// Settings page always goes back to sessions
if (pathname === '/settings') {
navigate({ to: '/sessions' })
// Settings uses explicit parent routes so mobile drill-down remains predictable.
const settingsBackTarget = getSettingsBackTarget(pathname)
if (settingsBackTarget) {
navigate({ to: settingsBackTarget })
return
}