Commit Graph

24 Commits

Author SHA1 Message Date
acf34c33d9 feat(05-02): add always-visible 4:3 image area with placeholders to ItemCard and CandidateCard
- Replace conditional image rendering with always-present 4:3 aspect ratio area
- Show category emoji centered on gray background when no image exists
- Ensures consistent card heights across grid layouts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:14:20 +01:00
3243be433f feat(05-01): redesign ImageUpload as hero area and move to top of forms
- Full-width 4:3 aspect ratio hero image area with rounded corners
- Placeholder state: gray background with ImagePlus icon and helper text
- Preview state: object-cover image with circular X remove button
- Upload state: semi-transparent spinner overlay
- Entire area clickable to upload/replace image
- Moved ImageUpload to first element in both ItemForm and CandidateForm
- Removed redundant "Image" label wrappers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:11:18 +01:00
8c0529cd60 fix(05-01): add imageFilename to Zod validation schemas
- Root cause: Zod schemas for createItem and createCandidate did not
  include imageFilename field, so @hono/zod-validator silently stripped
  it from validated payloads before reaching the service layer
- Images uploaded successfully but filename was never persisted to DB
- Added imageFilename as optional string to both createItemSchema and
  createCandidateSchema

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:09:59 +01:00
d05aac0687 feat(04-02): overhaul PlanningView with empty state, pill tabs, and category filter
- Replace inline thread creation form with modal trigger
- Add educational empty state with 3-step workflow guide
- Add Active/Resolved pill tab selector replacing checkbox
- Add category filter dropdown for thread list
- Display category emoji + name badge on ThreadCard
- Add aria-hidden to decorative SVG icons for a11y
- Auto-format pre-existing indentation issues (spaces to tabs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:38:48 +01:00
eb79ab671e feat(04-02): add CreateThreadModal and uiStore modal state
- Add createThreadModalOpen state to uiStore with open/close actions
- Create CreateThreadModal with name input and category dropdown
- Modal submits via useCreateThread with name + categoryId
- Fix pre-existing formatting in uiStore.ts (spaces to tabs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:36:51 +01:00
ed8508110f feat(04-01): update thread service, routes, and hooks for categoryId
- createThread now inserts categoryId from data
- getAllThreads joins categories table, returns categoryName/categoryEmoji
- updateThread accepts optional categoryId
- ThreadListItem interface includes category fields
- useCreateThread hook sends categoryId
- Fix test files to pass categoryId when creating threads

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:31:48 +01:00
629e14f60c feat(04-01): add categoryId to threads schema, Zod schemas, and test helper
- Add categoryId column with FK to categories on threads table
- Update createThreadSchema to require categoryId
- Update updateThreadSchema to allow optional categoryId
- Update test helper CREATE TABLE to include category_id

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:30:46 +01:00
67099551d0 feat(03-02): setup list page, detail page, and item picker
- Create SetupCard component with name, item count, weight, cost display
- Build setups list page with inline create form and grid layout
- Build setup detail page with category-grouped items and sticky totals bar
- Create ItemPicker component in SlideOutPanel with category-grouped checkboxes
- Add onRemove prop to ItemCard for non-destructive setup item removal
- Setup detail has delete confirmation dialog with collection safety note
- Empty states for both setup list and setup detail pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 12:50:54 +01:00
86a7a0def1 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>
2026-03-15 12:49:03 +01:00
0f115a2a4b feat(03-01): implement setup backend with junction table
- Setup service with CRUD, syncSetupItems, removeSetupItem
- SQL aggregation for itemCount, totalWeight, totalCost via COALESCE
- Hono routes for all 7 endpoints with zValidator
- Mount setupRoutes at /api/setups
- All 87 tests pass (24 new setup tests)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 12:43:02 +01:00
1e4e74f8d2 test(03-01): add failing tests for setup backend
- Add setups and setupItems tables to DB schema
- Add Zod schemas for setup create/update/sync
- Add Setup/SetupItem types to shared types
- Add setup tables to test helper
- Write service and route tests (RED - no implementation yet)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 12:42:15 +01:00
7d043a8585 feat(02-02): add thread detail page with candidate CRUD and resolution flow
- Create CandidateCard with edit, delete, and pick winner actions
- Create CandidateForm with same fields as ItemForm for candidate add/edit
- Build thread detail page with candidate grid and resolution banner
- Update root layout with candidate panel, delete dialog, and resolve dialog
- Hide FAB on thread detail pages, keep it for gear tab
- Resolution navigates back to planning tab after success
2026-03-15 11:46:19 +01:00
a9d624dc83 feat(02-02): add thread hooks, UI store, tab navigation, and thread list
- Create useThreads/useCandidates TanStack Query hooks
- Extend uiStore with candidate panel and resolve dialog state
- Add ThreadTabs component for gear/planning tab switching
- Add ThreadCard component with candidate count and price range chips
- Refactor index.tsx to tabbed HomePage with PlanningView
- Create placeholder thread detail route for navigation target
2026-03-15 11:44:17 +01:00
add3e3371d feat(02-01): add thread API routes and mount in server
- Thread CRUD: GET /, POST /, GET /:id, PUT /:id, DELETE /:id
- Candidate CRUD: POST /:id/candidates, PUT/DELETE nested candidates
- Resolution: POST /:id/resolve with validation and error handling
- Image cleanup on thread/candidate deletion
- Routes mounted at /api/threads in server index

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 11:39:15 +01:00
1a8b91edca feat(02-01): implement thread service with CRUD and transactional resolution
- Thread CRUD: create, update, delete with cascade candidate cleanup
- Candidate CRUD: create, update, delete with all item-compatible fields
- getAllThreads with subquery aggregates for candidateCount and price range
- getThreadWithCandidates with candidate+category join
- resolveThread: atomic transaction creating collection item from candidate data
- Category fallback to Uncategorized on resolution if category deleted

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 11:37:53 +01:00
e146eeab80 test(02-01): add failing tests for thread service
- Add threads and threadCandidates tables to Drizzle schema
- Add Zod schemas for thread/candidate/resolve validation
- Add Thread/ThreadCandidate types to shared types
- Update test helper with threads and thread_candidates tables
- Write comprehensive failing tests for thread service

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 11:36:01 +01:00
55d47d4e33 fix(01): align image upload field name and wrap category delete in transaction 2026-03-14 22:58:41 +01:00
9fcbf0bab5 feat(01-04): add onboarding wizard with settings API and persisted state
- Settings API: GET/PUT /api/settings/:key with SQLite persistence
- useSettings hook with TanStack Query for settings CRUD
- OnboardingWizard: 3-step modal overlay (welcome, create category, add item)
- Root layout checks onboarding completion flag before rendering wizard
- Skip option available at every step, all paths persist completion to DB

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 22:51:25 +01:00
12fd14ff41 feat(01-03): add slide-out panel, item form, category picker, and collection page
- CategoryPicker combobox with search, select, and inline create
- SlideOutPanel with backdrop, escape key, and slide animation
- ItemForm with all fields, validation, dollar-to-cents conversion
- Root layout with TotalsBar, panel, confirm dialog, and floating add button
- Collection page with card grid grouped by category, empty state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 22:46:24 +01:00
b099a47eb4 feat(01-03): add data hooks, utilities, UI store, and foundational components
- API fetch wrapper with error handling and multipart upload
- Weight/price formatters for display
- TanStack Query hooks for items, categories, and totals with cache invalidation
- Zustand UI store for panel and confirm dialog state
- TotalsBar, CategoryHeader, ItemCard, ConfirmDialog, ImageUpload components

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 22:44:48 +01:00
029adf4dca feat(01-02): add Hono API routes with validation, image upload, and integration tests
- Item routes: GET, POST, PUT, DELETE with Zod validation and image cleanup
- Category routes: GET, POST, PUT, DELETE with Uncategorized protection
- Totals route: per-category and global aggregates
- Image upload: multipart file handling with type/size validation
- Routes use DI via Hono context variables for testability
- Integration tests: 10 tests covering all endpoints and edge cases
- All 30 tests passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 22:40:49 +01:00
22757a8aef feat(01-02): implement item, category, and totals service layers
- Item CRUD: getAllItems with category join, getById, create, update, delete
- Category CRUD: getAll ordered by name, create, update, delete with reassignment
- Totals: per-category aggregates and global totals via SQL SUM/COUNT
- All 20 service tests passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 22:39:09 +01:00
7412ef1d86 feat(01-01): add database schema, shared Zod schemas, seed, and test infrastructure
- Create Drizzle schema with items, categories, and settings tables
- Set up database connection singleton with WAL mode and foreign keys
- Add seed script for default Uncategorized category
- Create shared Zod validation schemas for items and categories
- Export TypeScript types inferred from Zod and Drizzle schemas
- Add in-memory SQLite test helper for isolated test databases
- Wire seed into Hono server startup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 22:34:53 +01:00
67ff86039f feat(01-01): scaffold project with Vite, Hono, TanStack Router, Tailwind, and Drizzle config
- Initialize bun project with all frontend/backend dependencies
- Configure Vite with TanStack Router plugin, React, and Tailwind v4
- Create Hono server with health check and static file serving
- Set up TanStack Router file-based routes with root layout
- Add Drizzle config, Biome linter, and proper .gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 22:33:28 +01:00