Commit Graph

902 Commits

Author SHA1 Message Date
0202d0bb5c docs: add superpowers-friendly state and backlog summary
All checks were successful
CI / ci (push) Successful in 2m0s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 15s
Summarize current v2.4 state and forward-looking backlog in docs/ as a
parallel entry point to the active .planning/ GSD workspace. Lets
superpowers skills (brainstorming → writing-plans → executing-plans)
work from a clean starting point without retiring the existing workflow.

Also ignore .idea/ so JetBrains project files stay local.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 13:16:15 +02:00
1f2e8e18c4 docs(quick-260420-vk0): Fix UAT issues: image fetch-from-URL, image cropping, tag routing, duplicate tag error, tag form UX
All checks were successful
CI / ci (push) Successful in 1m56s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 17s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 22:52:12 +02:00
ddf9b9554f chore: merge quick task worktree (worktree-agent-accd63c4) 2026-04-20 22:51:44 +02:00
113e689932 fix(admin): handle duplicate tag name with 409 + polish inline tag form
- admin-tags.ts: wrap createTag in try/catch, detect UNIQUE constraint violations and return 409 with friendly message
- tags/index.tsx: surface server error message in catch block via err.message (ApiError carries the message from response body)
- tags/index.tsx: replace bare form row with card-style wrapper — label for Name and Parent, card border/bg, shrink-0 submit button
2026-04-20 22:50:35 +02:00
b41b8329bc fix(admin): return presignedUrl from from-url endpoint and update image preview after fetch
- images.ts: import getImageUrl from storage service, call after fetchImageFromUrl and include presignedUrl in response
- $itemId.tsx: update handleFetchFromUrl to use presignedUrl and dominantColor from response, set imageUrl in form state so ImageUpload component shows preview immediately
2026-04-20 22:49:34 +02:00
e4c0298a08 docs: capture todo - Make tag selector in global search searchable 2026-04-20 22:34:03 +02:00
2f39a7241a fix: persist crop preview in ImageUpload via initialCrop prop
All checks were successful
CI / ci (push) Successful in 1m52s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 16s
Crop values were stored in DB but never passed back to ImageUpload on reload,
causing images to revert to object-contain. Now both admin and user item pages
pass persisted crop data so the cropped view displays correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 22:29:19 +02:00
f1825fc722 docs(37): add image fetch + crop issues to UAT
All checks were successful
CI / ci (push) Successful in 1m52s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 7s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 22:09:48 +02:00
8b60428b3b feat(admin): replace image URL input with ImageUpload component + fetch-from-URL
All checks were successful
CI / ci (push) Successful in 1m56s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 17s
Admin item edit page now uses the same ImageUpload component as the rest
of the app (file upload, preview, crop editor). Also adds a "Fetch from URL"
input that uses /api/images/from-url. Renames "Source URL" to "Product Page URL".

Backend updated to accept imageFilename, dominantColor, cropZoom/X/Y fields
and return presignedImageUrl for display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 22:01:39 +02:00
31a9e3c1ff fix(admin): move detail routes to directory structure to fix rendering
All checks were successful
CI / ci (push) Successful in 1m54s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 18s
Admin item/tag edit pages weren't rendering because TanStack Router treated
them as children of the list route (which had no Outlet). Moving to
directory-based routing (items/index.tsx + items/$itemId.tsx) makes them
siblings that render directly in the admin layout.

Also adds UAT results for phases 35-38 and backlog item 999.12 (Admin UX Polish).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 21:40:57 +02:00
88c5339b98 chore: commit missing drizzle-pg journal and snapshot for migration 0010
All checks were successful
CI / deploy (push) Successful in 7s
CI / ci (push) Successful in 2m10s
CI / e2e (push) Has been skipped
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:18:15 +02:00
e044547121 chore: fix lint errors — auto-format, isNaN, unused imports, button type
Some checks failed
CI / ci (push) Failing after 1m41s
CI / e2e (push) Has been skipped
CI / deploy (push) Has been skipped
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 22:54:37 +02:00
22f5004e53 docs(38): mark phase complete — admin tag management
Some checks failed
CI / ci (push) Failing after 21s
CI / deploy (push) Has been skipped
CI / e2e (push) Has been skipped
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 22:37:02 +02:00
5d417b7c6e docs(38): phase verification report .planning/phases/38-admin-tag-management/38-VERIFICATION.md 2026-04-19 22:36:48 +02:00
6a5ffe8e2f docs(38-02): complete admin tag management client UI plan
- Add 38-02-SUMMARY.md
- Advance STATE.md to 38-02 complete
- Mark 38-02-PLAN.md complete in ROADMAP.md
2026-04-19 22:33:36 +02:00
0571ee47fb feat(38-02): tag edit page + enable Tags sidebar link
- Create admin/tags.$tagId.tsx with rename, reparent (cycle-safe), and delete
- getDescendantIds excludes self + all descendants from parent picker
- getDeleteConfirmText builds impact-aware confirmation (item count + child count)
- Delete confirmation modal with This cannot be undone
- Enable Tags sidebar Link in admin.tsx (remove disabled div + Soon badge)
2026-04-19 22:31:45 +02:00
1f8b85dc62 feat(38-02): admin tag hooks + list page with tree view and quick-add
- Create useAdminTags.ts with 5 hooks (useAdminTags, useAdminTag, useCreateAdminTag, useUpdateAdminTag, useDeleteAdminTag)
- Dual query key invalidation on all mutations (admin-tags + tags)
- Create admin/tags.tsx with collapsible tree view, search/filter, quick-add form
- buildTree, flattenTree, filterTree utilities for hierarchy rendering
- Chevron expand/collapse with LucideIcon, depth-based indent
2026-04-19 22:31:06 +02:00
0de809d8cb docs(38-01): complete admin tag backend plan
- Add 38-01-SUMMARY.md (schema+service+routes+tests)
- Advance plan counter to 2/2, progress to 97%
- Mark 38-01 complete in ROADMAP.md
2026-04-19 22:29:38 +02:00
311ebe8afe feat(38-01): admin tag routes + route registration + integration tests
- Create admin-tags.ts with GET list, GET single, POST, PUT (cycle guard → 400), DELETE
- Register /tags route in admin.ts
- Add 13-test integration suite covering CRUD, cycle detection, orphan behavior
2026-04-19 22:28:02 +02:00
8cefdf625b feat(38-01): schema parentId + tag service CRUD + cycle detection
- Add parentId self-ref FK to tags table (ON DELETE SET NULL)
- Generate Drizzle migration 0010_yielding_random.sql
- Extend tag.service.ts with getAdminTags, getTagWithCounts, createTag, updateTag, deleteTag, isDescendant
- Add service tests (14 tests, all pass)
2026-04-19 22:26:47 +02:00
c0a0aeff77 docs(38): create phase plans for admin tag management
Two plans across 2 waves: backend (schema + service + routes + tests)
then frontend (hooks + tree list page + edit page + sidebar activation).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 22:21:33 +02:00
d597affc1b docs(38): add validation strategy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 22:06:11 +02:00
136772d80c docs(38): research phase — admin tag management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 22:05:22 +02:00
f0597ae6b1 docs(38): fix UI-SPEC issues flagged by checker
- Spacing: change tree row indent from pl-5 (20px) to pl-4 (16px); remove non-standard exception entry
- Copywriting: change delete confirmation button from "Delete" to "Delete Tag"
- Visuals: declare focal point for list page (tree view) and edit page (name input)
- Typography: lower Label/Display from 12px to 11px, establishing 3px gap above 14px body

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 22:00:19 +02:00
096cb5a1dd docs(38): add UI design contract for admin tag management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 21:57:19 +02:00
11ff1eb1dd docs(state): record phase 38 context session 2026-04-19 21:50:56 +02:00
9e49e52bc0 docs(38): capture phase context 2026-04-19 21:50:37 +02:00
45eaeb0462 docs(37): add code review report 2026-04-19 21:36:14 +02:00
821c61f912 docs(37): add plan execution summaries for 37-01 and 37-02 2026-04-19 21:35:22 +02:00
6931c33f73 feat(37-02): admin global items client — list, edit, sidebar activation
- Add useAdminGlobalItems hooks: infinite query, detail query, update/delete mutations
- Activate Items sidebar link in admin.tsx (replace disabled div with active Link)
- Create /admin/items list page with table, infinite scroll, search, tag filters, skeleton
- Create /admin/items/$itemId edit page with all fields, manufacturer dropdown, TagInput chip component
- Delete confirmation dialog shows ownerCount impact message
- routeTree.gen.ts updated with /admin/items and /admin/items/$itemId routes

Closes ADMN-02, ADMN-03, ADMN-04 (client side)
2026-04-19 21:34:53 +02:00
db471001fa feat(37-01): admin global item services, routes, and unit tests
- Add listGlobalItemsForAdmin: paginated with batched tag/ownerCount queries
- Add updateGlobalItemById: partial update in transaction, syncs tags
- Add deleteGlobalItem: nullifies FK refs, removes tag associations before delete
- Create src/server/routes/admin-items.ts with GET/GET:id/PUT/DELETE endpoints
- Mount adminItemRoutes at /items in admin.ts (protected by requireAuth+requireAdmin)
- Extend global-item.service.test.ts with 13 new tests (all passing)

Closes ADMN-02, ADMN-03, ADMN-04 (server side)
2026-04-19 21:32:42 +02:00
3c79b7eb9a docs(state): record phase 37 planning complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 21:28:52 +02:00
eabfca475c docs(37): write wave plan files for admin global item management
Plans 37-01 (server: services + admin-items routes) and 37-02 (client:
hooks, list page, edit page, sidebar) with full acceptance criteria and
read_first blocks per phase context, research, and UI-SPEC artifacts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 21:28:46 +02:00
2f2fc1e681 docs(37): add research, validation strategy, and UI design contract
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 21:04:03 +02:00
298da6da85 docs(37): capture phase context 2026-04-19 20:57:32 +02:00
868aed4f10 docs(36): add code review report 2026-04-19 20:50:57 +02:00
70a3e159ba docs(phase-36): update ROADMAP and STATE after wave execution 2026-04-19 20:49:56 +02:00
8e76fe35dc docs(36-02): create SUMMARY.md for plan 36-02 completion 2026-04-19 20:49:40 +02:00
72473bc5c5 chore(36-02): regenerate routeTree.gen.ts with /admin and /admin/ routes 2026-04-19 20:49:19 +02:00
8f62edc91d feat(36-02): add conditional Admin link to UserMenu for admin users 2026-04-19 20:49:03 +02:00
7a3dca768a feat(36-02): add /admin layout route and placeholder index
- admin.tsx: createFileRoute('/admin') with sidebar shell (Items, Tags disabled with Soon badge)
- admin/index.tsx: createFileRoute('/admin/') placeholder with shield icon
- useEffect guard redirects non-admin users to /
2026-04-19 20:48:53 +02:00
080838ecb5 feat(36-02): add isAdmin to AuthState interface in useAuth.ts 2026-04-19 20:48:30 +02:00
488fdbb568 docs(36-01): create SUMMARY.md for plan 36-01 completion 2026-04-19 20:48:14 +02:00
d3c5a8945b feat(36-01): add scripts/grant-admin.ts for granting/revoking admin status 2026-04-19 20:47:49 +02:00
48381105b5 feat(36-01): add /api/admin placeholder route with requireAuth + requireAdmin middleware 2026-04-19 20:47:36 +02:00
18883fb9f0 feat(36-01): surface isAdmin in /api/auth/me response 2026-04-19 20:47:12 +02:00
34c7d27ee5 feat(36-01): add requireAdmin middleware to auth.ts
- Import eq from drizzle-orm and users from schema
- Export requireAdmin(c, next) that returns 401 if userId not in context, 403 if user.isAdmin is falsy
2026-04-19 20:47:06 +02:00
23cdb25063 feat(36-01): add isAdmin column to users table schema and generate migration
- Add isAdmin boolean(is_admin) NOT NULL DEFAULT false to users table
- Generate migration 0009_spotty_lord_tyger.sql
- NOTE: db:push requires DATABASE_URL with correct credentials to apply
2026-04-19 20:46:51 +02:00
94e2a8c019 plan(36): admin role & panel foundation — 2 plans ready
- 36-RESEARCH.md: schema migration, requireAdmin middleware, /api/auth/me
  surface, client routing patterns, grant script, wave breakdown
- 36-UI-SPEC.md: admin shell layout, sidebar disabled nav items, UserMenu
  admin link, palette and responsive notes
- 36-01-PLAN.md (wave 1): isAdmin schema column + Drizzle migration,
  requireAdmin middleware, /api/auth/me isAdmin field, /api/admin placeholder
  route, scripts/grant-admin.ts
- 36-02-PLAN.md (wave 2): AuthState isAdmin type, /admin client route with
  sidebar shell, admin/index.tsx placeholder, UserMenu admin link
- STATE.md: updated to Phase 36, ready to execute, 2 plans

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 20:43:12 +02:00
e8cdeafba2 docs(state): record phase 36 context session .planning/STATE.md 2026-04-19 20:34:26 +02:00