Files
mission-control/src/stores/nav-store.ts
teernisse 251ae44a56 feat(bd-2vw): display raw lore data in debug view
Add DebugView component to show raw lore status data for visual
verification that the data pipeline works end-to-end:
- Frontend -> Tauri IPC -> Rust backend -> lore CLI -> parsed data

New files:
- src/components/DebugView.tsx - Debug component with health indicator
- src/hooks/useLoreData.ts - TanStack Query hook for lore status
- tests/components/DebugView.test.tsx - Component tests
- tests/hooks/useLoreData.test.ts - Hook tests

Modified:
- src/App.tsx - Add QueryClientProvider wrapper
- src/stores/nav-store.ts - Add 'debug' ViewId
- src/components/AppShell.tsx - Add Debug nav tab and view routing
- tests/components/AppShell.test.tsx - Update tests for new nav
2026-02-26 11:01:59 -05:00

31 lines
766 B
TypeScript

/**
* Navigation Store - tracks which view is active.
*
* Simple view routing for the desktop app. No URL-based routing needed
* since this is a native app with a fixed set of views.
*/
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import { getStorage } from "@/lib/tauri-storage";
export type ViewId = "focus" | "queue" | "inbox" | "settings" | "debug";
export interface NavState {
activeView: ViewId;
setView: (view: ViewId) => void;
}
export const useNavStore = create<NavState>()(
persist(
(set) => ({
activeView: "focus",
setView: (view) => set({ activeView: view }),
}),
{
name: "mc-nav-store",
storage: createJSONStorage(() => getStorage()),
}
)
);