Commit graph

15 commits

Author SHA1 Message Date
7db093c696 feat(07-02): frontend NL search bar wired to GET /api/search
- web/src/lib/api.ts: add fetchSearch(q) returning Promise<InventoryItem[]>
- web/src/components/inventory/FilterBar.tsx: NL search input with 400ms debounce,
  volt accent styling, Sparkles icon, Loader2 spinner during search
- web/src/pages/DashboardPage.tsx: nlQuery state + useQuery hook (enabled >2 chars),
  displays searchResults when NL active, local filter unchanged when NL empty
2026-04-10 07:56:02 +00:00
bcc360892c feat(06-03): add AdvisorPage, /advisor route, and TopBar link
- AdvisorPage: two-panel layout (sidebar + chat), streaming SSE tokens
- Sidebar: conversation list with refetchInterval 5s, New Chat button
- Chat: optimistic user messages, streaming cursor, model dropdown
- router.tsx: lazy AdvisorPage import + advisorRoute at /advisor
- TopBar.tsx: MessageSquare icon + Advisor link between Test and Scan
- AppShell.tsx: noPadding prop for full-height layouts
2026-04-10 07:39:56 +00:00
811223ddf7 feat(06-03): add advisor API wrappers (streamChat, fetchConversations, fetchConversation)
- Types: ChatMessage, ConversationSummary, Conversation
- streamChat: POST /api/advisor/chat with ReadableStream SSE parsing
- fetchConversations: GET with 404-tolerant empty array fallback
- fetchConversation: GET by id
2026-04-10 07:39:50 +00:00
4e5a3547f9 test(05-03): add CableTestPage unit tests with Vitest setup
- Install vitest, @testing-library/react, jsdom (Rule 3: missing test infra)
- Add vitest.config.ts with jsdom environment and @ alias
- Add src/test/setup.ts with jest-dom matchers and matchMedia stub
- Add CableTestPage.test.tsx: 4 tests (no-tester, recent list, print success, print_skipped)
- Mock AppShell to avoid TanStack Router context in tests
- All 4 tests pass; npm run build exits 0
2026-04-10 07:21:08 +00:00
499dbb9929 feat(05-03): Cable Test Station page at /test
- Add web/src/api/test.ts with submitCableTest, getRecentTests, streamTestEvents
- Add web/src/pages/CableTestPage.tsx with three-panel layout (readout/label/recent)
- Register /test route in router.tsx
- Add Test nav link (Cable icon) in TopBar
- SSE live readout via EventSource, closed on unmount
- Print & Next mutation with react-hot-toast feedback
- Mobile-responsive: single col on mobile, 3-col on lg+
- ClickHouse design tokens throughout (#000000 bg, #faff69 accent)
2026-04-10 07:19:24 +00:00
021c82875e fix(03): resolve TypeScript type mismatches from merged plans 2026-04-10 06:27:11 +00:00
e2ac3b10aa chore: merge 03-04 worktree (intake UI) — resolved router/api/AppShell conflicts 2026-04-10 06:25:29 +00:00
8c7563af9a chore: merge 03-03 worktree (dashboard+detail) — resolved router/api/AppShell conflicts 2026-04-10 06:24:20 +00:00
75c91a5941 feat(03-05): QR scanner page with @zxing/browser and router wiring
- web/src/pages/ScanPage.tsx: camera QR scanner with volt reticle overlay
  - extractHWID() parses both URL format and bare HW-XXXXX patterns
  - rear camera preference (back/rear/environment label matching)
  - debounce via lastScanned state prevents duplicate navigation
  - graceful camera permission denied error state
- web/src/router.tsx: lazy-loads ScanPage with Suspense fallback spinner
- web/src/lib/api.ts: typed fetch wrappers (fetchInventory, fetchInventoryItem)
- web/src/components/layout/AppShell.tsx: minimal page wrapper (stub for plan 03-03)
2026-04-10 06:22:14 +00:00
95a50f4abd feat(03-05): PWA manifest, service worker, icons, and registration hook
- web/public/manifest.json with display=standalone, theme_color=#faff69, 192+512 icons
- web/public/sw.js with app-shell cache strategy (API calls network-only)
- web/public/icons/icon-192.png and icon-512.png generated via gen-icons.cjs
- web/scripts/gen-icons.cjs pure-Node.js PNG icon generator (black canvas, volt H monogram)
- web/src/hooks/usePWA.ts registers service worker on app load
- web/index.html: added theme-color meta tag
- web/src/App.tsx: calls usePWA() hook
2026-04-10 06:22:05 +00:00
5909025677 feat(03-04): intake wizard UI — AIResultReview, ConfirmForm, IntakePage, router wiring
- AIResultReview: confidence meter (green/yellow/red), manufacturer/model/category/tags, editable name input, ai_notes card
- ConfirmForm: confirm/start-over action buttons with submitting spinner state
- AppShell: top-nav layout wrapper with HWLab logo and Inventory/Add Item nav links
- IntakePage: three-step wizard (upload → submitting → review) wired to submitIntake()
- router.tsx: lazy-loads IntakePage for /intake, Suspense+Spinner fallback
- Analyze button disabled during submitting (T-03-13 DoS mitigation)
2026-04-10 06:21:53 +00:00
19c2bb7d05 feat(03-03): DashboardPage, ItemDetailPage, FilterBar, and router wiring
- web/src/components/inventory/FilterBar.tsx: search + status dropdown + grid/list toggle
- web/src/pages/DashboardPage.tsx: / route with grid/list view, filters, loading/error/empty states
- web/src/pages/ItemDetailPage.tsx: /item/$id route, two-column desktop, single-column mobile
- web/src/router.tsx: lazy-load DashboardPage + ItemDetailPage, keep intake/scan stubs
2026-04-10 06:21:48 +00:00
1867846a9f feat(03-03): API client, TanStack Query hooks, layout shell, inventory item components
- web/src/lib/api.ts: typed fetch wrappers for GET /api/inventory and GET /api/inventory/:id
- web/src/hooks/useInventory.ts: useInventory + useInventoryItem TanStack Query hooks
- web/src/components/inventory/StatusBadge.tsx: catalog_status → Badge variant mapping
- web/src/components/inventory/ItemCard.tsx: grid card with photo, HW ID, name, status, NetBox link
- web/src/components/inventory/ItemRow.tsx: list-mode row with status color indicator
- web/src/components/layout/TopBar.tsx: sticky nav with HWLab volt brand, Add Item + Scan buttons
- web/src/components/layout/AppShell.tsx: TopBar + main content wrapper
2026-04-10 06:21:43 +00:00
709876d3a0 feat(03-04): add intake Zustand store, api.ts submitIntake, DropZone, PhotoPreview
- useIntakeStore: step tracking, photos (max 3), aiResult, editedName, error
- submitIntake(): multipart FormData POST /api/intake with IntakeResponse type
- DropZone: react-dropzone with camera capture, volt hover state, slot counter
- PhotoPreview: thumbnail grid with X remove button per photo
2026-04-10 06:20:35 +00:00
d38f93dd67 feat(03-01): bootstrap React+TS frontend with ClickHouse design system
- Vite 5 + React 18 + TypeScript 5 + Tailwind 3 scaffold in web/
- ClickHouse design tokens (volt, forest, canvas, charcoal, near-black) in tailwind.config.ts
- TanStack Router v1 with placeholder routes for /, /item/$id, /intake, /scan
- TanStack Query v5 QueryClientProvider + Zustand uiStore
- shadcn/ui Button (neon/forest/secondary/outline/ghost), Card, Badge with ClickHouse variants
- Vite proxy: /api -> http://localhost:8080
- Makefile: added frontend and dev-frontend targets
- Fixed: @typescript-eslint v8 for ESLint v9 compatibility; @types/node for vite.config.ts
2026-04-10 06:16:46 +00:00