feat: Add /hq route, nav item, and update root redirect
- Create apps/web/src/routes/hq.tsx with HeadquartersPage shell component - Add "HQ" as first entry in AppLayout.tsx navItems array - Change root redirect from /initiatives to /hq - Regenerate routeTree.gen.ts with the new /hq route Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { trpc } from '@/lib/trpc'
|
|||||||
import type { ConnectionState } from '@/hooks/useConnectionStatus'
|
import type { ConnectionState } from '@/hooks/useConnectionStatus'
|
||||||
|
|
||||||
const navItems = [
|
const navItems = [
|
||||||
|
{ label: 'HQ', to: '/hq', badgeKey: null },
|
||||||
{ label: 'Initiatives', to: '/initiatives', badgeKey: null },
|
{ label: 'Initiatives', to: '/initiatives', badgeKey: null },
|
||||||
{ label: 'Agents', to: '/agents', badgeKey: 'running' as const },
|
{ label: 'Agents', to: '/agents', badgeKey: 'running' as const },
|
||||||
{ label: 'Inbox', to: '/inbox', badgeKey: 'questions' as const },
|
{ label: 'Inbox', to: '/inbox', badgeKey: 'questions' as const },
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
import { Route as rootRouteImport } from './routes/__root'
|
import { Route as rootRouteImport } from './routes/__root'
|
||||||
import { Route as SettingsRouteImport } from './routes/settings'
|
import { Route as SettingsRouteImport } from './routes/settings'
|
||||||
import { Route as InboxRouteImport } from './routes/inbox'
|
import { Route as InboxRouteImport } from './routes/inbox'
|
||||||
|
import { Route as HqRouteImport } from './routes/hq'
|
||||||
import { Route as AgentsRouteImport } from './routes/agents'
|
import { Route as AgentsRouteImport } from './routes/agents'
|
||||||
import { Route as IndexRouteImport } from './routes/index'
|
import { Route as IndexRouteImport } from './routes/index'
|
||||||
import { Route as SettingsIndexRouteImport } from './routes/settings/index'
|
import { Route as SettingsIndexRouteImport } from './routes/settings/index'
|
||||||
@@ -29,6 +30,11 @@ const InboxRoute = InboxRouteImport.update({
|
|||||||
path: '/inbox',
|
path: '/inbox',
|
||||||
getParentRoute: () => rootRouteImport,
|
getParentRoute: () => rootRouteImport,
|
||||||
} as any)
|
} as any)
|
||||||
|
const HqRoute = HqRouteImport.update({
|
||||||
|
id: '/hq',
|
||||||
|
path: '/hq',
|
||||||
|
getParentRoute: () => rootRouteImport,
|
||||||
|
} as any)
|
||||||
const AgentsRoute = AgentsRouteImport.update({
|
const AgentsRoute = AgentsRouteImport.update({
|
||||||
id: '/agents',
|
id: '/agents',
|
||||||
path: '/agents',
|
path: '/agents',
|
||||||
@@ -68,6 +74,7 @@ const InitiativesIdRoute = InitiativesIdRouteImport.update({
|
|||||||
export interface FileRoutesByFullPath {
|
export interface FileRoutesByFullPath {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/agents': typeof AgentsRoute
|
'/agents': typeof AgentsRoute
|
||||||
|
'/hq': typeof HqRoute
|
||||||
'/inbox': typeof InboxRoute
|
'/inbox': typeof InboxRoute
|
||||||
'/settings': typeof SettingsRouteWithChildren
|
'/settings': typeof SettingsRouteWithChildren
|
||||||
'/initiatives/$id': typeof InitiativesIdRoute
|
'/initiatives/$id': typeof InitiativesIdRoute
|
||||||
@@ -79,6 +86,7 @@ export interface FileRoutesByFullPath {
|
|||||||
export interface FileRoutesByTo {
|
export interface FileRoutesByTo {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/agents': typeof AgentsRoute
|
'/agents': typeof AgentsRoute
|
||||||
|
'/hq': typeof HqRoute
|
||||||
'/inbox': typeof InboxRoute
|
'/inbox': typeof InboxRoute
|
||||||
'/initiatives/$id': typeof InitiativesIdRoute
|
'/initiatives/$id': typeof InitiativesIdRoute
|
||||||
'/settings/health': typeof SettingsHealthRoute
|
'/settings/health': typeof SettingsHealthRoute
|
||||||
@@ -90,6 +98,7 @@ export interface FileRoutesById {
|
|||||||
__root__: typeof rootRouteImport
|
__root__: typeof rootRouteImport
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/agents': typeof AgentsRoute
|
'/agents': typeof AgentsRoute
|
||||||
|
'/hq': typeof HqRoute
|
||||||
'/inbox': typeof InboxRoute
|
'/inbox': typeof InboxRoute
|
||||||
'/settings': typeof SettingsRouteWithChildren
|
'/settings': typeof SettingsRouteWithChildren
|
||||||
'/initiatives/$id': typeof InitiativesIdRoute
|
'/initiatives/$id': typeof InitiativesIdRoute
|
||||||
@@ -103,6 +112,7 @@ export interface FileRouteTypes {
|
|||||||
fullPaths:
|
fullPaths:
|
||||||
| '/'
|
| '/'
|
||||||
| '/agents'
|
| '/agents'
|
||||||
|
| '/hq'
|
||||||
| '/inbox'
|
| '/inbox'
|
||||||
| '/settings'
|
| '/settings'
|
||||||
| '/initiatives/$id'
|
| '/initiatives/$id'
|
||||||
@@ -114,6 +124,7 @@ export interface FileRouteTypes {
|
|||||||
to:
|
to:
|
||||||
| '/'
|
| '/'
|
||||||
| '/agents'
|
| '/agents'
|
||||||
|
| '/hq'
|
||||||
| '/inbox'
|
| '/inbox'
|
||||||
| '/initiatives/$id'
|
| '/initiatives/$id'
|
||||||
| '/settings/health'
|
| '/settings/health'
|
||||||
@@ -124,6 +135,7 @@ export interface FileRouteTypes {
|
|||||||
| '__root__'
|
| '__root__'
|
||||||
| '/'
|
| '/'
|
||||||
| '/agents'
|
| '/agents'
|
||||||
|
| '/hq'
|
||||||
| '/inbox'
|
| '/inbox'
|
||||||
| '/settings'
|
| '/settings'
|
||||||
| '/initiatives/$id'
|
| '/initiatives/$id'
|
||||||
@@ -136,6 +148,7 @@ export interface FileRouteTypes {
|
|||||||
export interface RootRouteChildren {
|
export interface RootRouteChildren {
|
||||||
IndexRoute: typeof IndexRoute
|
IndexRoute: typeof IndexRoute
|
||||||
AgentsRoute: typeof AgentsRoute
|
AgentsRoute: typeof AgentsRoute
|
||||||
|
HqRoute: typeof HqRoute
|
||||||
InboxRoute: typeof InboxRoute
|
InboxRoute: typeof InboxRoute
|
||||||
SettingsRoute: typeof SettingsRouteWithChildren
|
SettingsRoute: typeof SettingsRouteWithChildren
|
||||||
InitiativesIdRoute: typeof InitiativesIdRoute
|
InitiativesIdRoute: typeof InitiativesIdRoute
|
||||||
@@ -158,6 +171,13 @@ declare module '@tanstack/react-router' {
|
|||||||
preLoaderRoute: typeof InboxRouteImport
|
preLoaderRoute: typeof InboxRouteImport
|
||||||
parentRoute: typeof rootRouteImport
|
parentRoute: typeof rootRouteImport
|
||||||
}
|
}
|
||||||
|
'/hq': {
|
||||||
|
id: '/hq'
|
||||||
|
path: '/hq'
|
||||||
|
fullPath: '/hq'
|
||||||
|
preLoaderRoute: typeof HqRouteImport
|
||||||
|
parentRoute: typeof rootRouteImport
|
||||||
|
}
|
||||||
'/agents': {
|
'/agents': {
|
||||||
id: '/agents'
|
id: '/agents'
|
||||||
path: '/agents'
|
path: '/agents'
|
||||||
@@ -229,6 +249,7 @@ const SettingsRouteWithChildren = SettingsRoute._addFileChildren(
|
|||||||
const rootRouteChildren: RootRouteChildren = {
|
const rootRouteChildren: RootRouteChildren = {
|
||||||
IndexRoute: IndexRoute,
|
IndexRoute: IndexRoute,
|
||||||
AgentsRoute: AgentsRoute,
|
AgentsRoute: AgentsRoute,
|
||||||
|
HqRoute: HqRoute,
|
||||||
InboxRoute: InboxRoute,
|
InboxRoute: InboxRoute,
|
||||||
SettingsRoute: SettingsRouteWithChildren,
|
SettingsRoute: SettingsRouteWithChildren,
|
||||||
InitiativesIdRoute: InitiativesIdRoute,
|
InitiativesIdRoute: InitiativesIdRoute,
|
||||||
|
|||||||
25
apps/web/src/routes/hq.tsx
Normal file
25
apps/web/src/routes/hq.tsx
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
import { motion } from "motion/react";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/hq")({
|
||||||
|
component: HeadquartersPage,
|
||||||
|
});
|
||||||
|
|
||||||
|
function HeadquartersPage() {
|
||||||
|
return (
|
||||||
|
<motion.div
|
||||||
|
className="mx-auto max-w-4xl space-y-6"
|
||||||
|
initial={{ opacity: 0, y: 8 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
transition={{ duration: 0.3 }}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<h1 className="text-xl font-semibold">Headquarters</h1>
|
||||||
|
<p className="text-sm text-muted-foreground">
|
||||||
|
Items waiting for your attention.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{/* Sections implemented in next phase */}
|
||||||
|
</motion.div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -2,6 +2,6 @@ import { createFileRoute, redirect } from '@tanstack/react-router'
|
|||||||
|
|
||||||
export const Route = createFileRoute('/')({
|
export const Route = createFileRoute('/')({
|
||||||
beforeLoad: () => {
|
beforeLoad: () => {
|
||||||
throw redirect({ to: '/initiatives' })
|
throw redirect({ to: '/hq' })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user