4.7 KiB
4.7 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | |||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick | 260420-vk0 | admin |
|
|
|
|
|
|
Quick Task 260420-vk0: Fix UAT Issues — Image Fetch Preview, Tag Routing, Duplicate Error, Form UX
One-liner: Presigned URL passthrough to client fixes fetch-from-URL image preview; 409 unique constraint handler + card-form polish closes tag UAT gaps.
Tasks Completed
| Task | Status | Commit | Files |
|---|---|---|---|
| 1: Fix image fetch-from-URL preview and cropping | Done | b41b832 |
images.ts, $itemId.tsx |
| 2: Fix tag edit page routing | Done (pre-existing) | 31a9e3c |
routeTree.gen.ts (prior commit) |
| 3: Handle duplicate tag name error + polish inline form | Done | 113e689 |
admin-tags.ts, tags/index.tsx |
What Was Built
Task 1 — Image fetch-from-URL preview:
images.ts: AddedgetImageUrlimport from storage service; afterfetchImageFromUrlcompletes, callsgetImageUrl(result.filename)to generate a presigned URL and includes it in the response aspresignedUrl.$itemId.tsx: UpdatedhandleFetchFromUrltype annotation to includepresignedUrlanddominantColor; after successful fetch, setsimageUrl: result.presignedUrlanddominantColorin form state. This causesImageUploadto receive the presigned URL via itsimageUrlprop and render the image preview immediately, making the crop button visible and functional.
Task 2 — Tag edit page routing:
Already resolved by commit 31a9e3c (which moved both items and tags to directory-based routing: items/index.tsx + items/$itemId.tsx / tags/index.tsx + tags/$tagId.tsx). The route tree correctly registers AdminTagsTagIdRoute and AdminTagsIndexRoute as siblings under AdminRoute. No additional changes required.
Task 3 — Duplicate tag name error + form polish:
admin-tags.ts: WrappedcreateTagin try/catch; detects SQLite UNIQUE constraint violations by checkingerr.messagefor "UNIQUE constraint failed" or "unique constraint", returning{ error: "A tag named \"X\" already exists" }with status 409.tags/index.tsx: UpdatedhandleCreatecatch to useerr instanceof Error ? err.message : "Failed to create tag"—ApiError(thrown byapiPost) carries the server'serrorfield as its message, so the friendly 409 message surfaces directly.tags/index.tsx: Replaced bare flex-row form with card-style wrapper (rounded-xl border border-gray-100 bg-white p-4), section header, field labels for Name and Parent, andshrink-0on the submit button. Error message moved inside the card below the form.
Deviations from Plan
Pre-resolved Issues
Task 2 already fixed before this quick task ran
- Found during: Investigation of tag routing
- Issue: Plan described investigating why
/admin/tags/$tagIdshowed the list — but commit31a9e3c(landed same day, prior to this quick task) already moved tag routes to directory structure and regenerated the route tree. Routes are correctly registered as siblings under AdminRoute. - Action taken: Verified route tree, confirmed no changes needed, documented as pre-resolved. Continued to Task 3.
Known Stubs
None. All implemented functionality is wired to real data.
Threat Flags
None. No new network endpoints or auth paths introduced.
Self-Check: PASSED
src/server/routes/images.tsexists and containsgetImageUrlimport andpresignedUrlin responsesrc/client/routes/admin/items/$itemId.tsxcontainsresult.presignedUrlandimageUrl: result.presignedUrlin form state updatesrc/server/routes/admin-tags.tscontains try/catch with 409 for UNIQUE constraintsrc/client/routes/admin/tags/index.tsxcontains card-style form with labels- Commit
b41b832exists (Task 1) - Commit
113e689exists (Task 3) bun run lintpasses with no errors