feat(03-02): navigation restructure, TotalsBar refactor, and setup hooks

- Move collection view from / to /collection with gear/planning tabs
- Rewrite / as dashboard with three summary cards (Collection, Planning, Setups)
- Refactor TotalsBar to accept optional stats/linkTo/title props
- Create DashboardCard component for dashboard summary cards
- Create useSetups hooks (CRUD + sync/remove item mutations)
- Update __root.tsx with route-aware TotalsBar, FAB visibility, resolve navigation
- Add item picker and setup delete UI state to uiStore
- Invalidate setups queries on item update/delete for stale data prevention
- Update routeTree.gen.ts with new collection/setups routes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 12:49:03 +01:00
parent c2b8985d37
commit 86a7a0def1
11 changed files with 637 additions and 270 deletions

View File

@@ -10,33 +10,73 @@
import { Route as rootRouteImport } from './routes/__root'
import { Route as IndexRouteImport } from './routes/index'
import { Route as ThreadsThreadIdRouteImport } from './routes/threads/$threadId'
import { Route as CollectionIndexRouteImport } from './routes/collection/index'
import { Route as SetupsIndexRouteImport } from './routes/setups/index'
import { Route as SetupsSetupIdRouteImport } from './routes/setups/$setupId'
const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const ThreadsThreadIdRoute = ThreadsThreadIdRouteImport.update({
id: '/threads/$threadId',
path: '/threads/$threadId',
getParentRoute: () => rootRouteImport,
} as any)
const CollectionIndexRoute = CollectionIndexRouteImport.update({
id: '/collection/',
path: '/collection/',
getParentRoute: () => rootRouteImport,
} as any)
const SetupsIndexRoute = SetupsIndexRouteImport.update({
id: '/setups/',
path: '/setups/',
getParentRoute: () => rootRouteImport,
} as any)
const SetupsSetupIdRoute = SetupsSetupIdRouteImport.update({
id: '/setups/$setupId',
path: '/setups/$setupId',
getParentRoute: () => rootRouteImport,
} as any)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/threads/$threadId': typeof ThreadsThreadIdRoute
'/collection': typeof CollectionIndexRoute
'/setups': typeof SetupsIndexRoute
'/setups/$setupId': typeof SetupsSetupIdRoute
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
'/threads/$threadId': typeof ThreadsThreadIdRoute
'/collection': typeof CollectionIndexRoute
'/setups': typeof SetupsIndexRoute
'/setups/$setupId': typeof SetupsSetupIdRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
'/': typeof IndexRoute
'/threads/$threadId': typeof ThreadsThreadIdRoute
'/collection/': typeof CollectionIndexRoute
'/setups/': typeof SetupsIndexRoute
'/setups/$setupId': typeof SetupsSetupIdRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/'
fullPaths: '/' | '/threads/$threadId' | '/collection' | '/setups' | '/setups/$setupId'
fileRoutesByTo: FileRoutesByTo
to: '/'
id: '__root__' | '/'
to: '/' | '/threads/$threadId' | '/collection' | '/setups' | '/setups/$setupId'
id: '__root__' | '/' | '/threads/$threadId' | '/collection/' | '/setups/' | '/setups/$setupId'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
ThreadsThreadIdRoute: typeof ThreadsThreadIdRoute
CollectionIndexRoute: typeof CollectionIndexRoute
SetupsIndexRoute: typeof SetupsIndexRoute
SetupsSetupIdRoute: typeof SetupsSetupIdRoute
}
declare module '@tanstack/react-router' {
@@ -48,11 +88,43 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/threads/$threadId': {
id: '/threads/$threadId'
path: '/threads/$threadId'
fullPath: '/threads/$threadId'
preLoaderRoute: typeof ThreadsThreadIdRouteImport
parentRoute: typeof rootRouteImport
}
'/collection/': {
id: '/collection/'
path: '/collection'
fullPath: '/collection'
preLoaderRoute: typeof CollectionIndexRouteImport
parentRoute: typeof rootRouteImport
}
'/setups/': {
id: '/setups/'
path: '/setups'
fullPath: '/setups'
preLoaderRoute: typeof SetupsIndexRouteImport
parentRoute: typeof rootRouteImport
}
'/setups/$setupId': {
id: '/setups/$setupId'
path: '/setups/$setupId'
fullPath: '/setups/$setupId'
preLoaderRoute: typeof SetupsSetupIdRouteImport
parentRoute: typeof rootRouteImport
}
}
}
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
ThreadsThreadIdRoute: ThreadsThreadIdRoute,
CollectionIndexRoute: CollectionIndexRoute,
SetupsIndexRoute: SetupsIndexRoute,
SetupsSetupIdRoute: SetupsSetupIdRoute,
}
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)