Problem
src/pages/profile/[id].tsx:49 stores the active profile tab in React state:
const [activeTab, setActiveTab] = useState<ProfileTab>("command-center");
On refresh, the user is always sent back to "command-center" — even if they were viewing Settings, Arsenal, or Service Record. Tabs also cannot be deep-linked (e.g., sharing "view my arsenal").
Expected behavior
Active tab is reflected in the URL (e.g., /profile/abc?tab=arsenal) and survives page reload, back/forward navigation, and sharing.
Acceptance criteria
Suggested approach
const router = useRouter();
const tabFromUrl = router.query.tab as ProfileTab | undefined;
const activeTab: ProfileTab = VALID_TABS.includes(tabFromUrl) ? tabFromUrl : "command-center";
Keep a shallow-routing helper so tab changes don't re-run getServerSideProps.
Problem
src/pages/profile/[id].tsx:49stores the active profile tab in React state:On refresh, the user is always sent back to "command-center" — even if they were viewing Settings, Arsenal, or Service Record. Tabs also cannot be deep-linked (e.g., sharing "view my arsenal").
Expected behavior
Active tab is reflected in the URL (e.g.,
/profile/abc?tab=arsenal) and survives page reload, back/forward navigation, and sharing.Acceptance criteria
router.query.tab, defaulting to"command-center"when absent.router.push({ query: { ...router.query, tab } }, undefined, { shallow: true })./profile/{id}?tab=settingswork.?tab=values fall back to default gracefully (no crash).Suggested approach
Keep a shallow-routing helper so tab changes don't re-run
getServerSideProps.