6.3 KiB
6.3 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | duration | completed | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 12-offer-composition-drag-drop-csv-import | 04 | ui |
|
|
|
|
|
|
|
|
|
10min | 2026-06-15 |
Phase 12 Plan 04: Offer List Page Redesign Summary
Rewrote /admin/offers from a legacy flat macro/micro/offer_services CRUD page into a category-filterable, archive-aware offer card grid with a "+ Nuova Offerta" inline creation flow, per UI-SPEC section 1.
Performance
- Duration: 10 min
- Started: 2026-06-15T08:15:00Z (approx)
- Completed: 2026-06-15T08:25:30Z
- Tasks: 2 completed
- Files modified: 2 (1 rewritten, 1 created)
Accomplishments
src/app/admin/offers/page.tsxrewritten as a thin server component:Promise.all([getOfferListCards(), getOfferFieldOptions()])feedingOfferListClient, matching thecatalog/page.tsxpattern (239 lines of legacy macro/micro/offer_services CRUD forms removed)- New
src/components/admin/offers/OfferListClient.tsx:- Category filter chip row ("Tutti" + dynamic
categoryOptions), active state#1A463Cborder/text, inactive#e5e7eb/#71717a - "Mostra offerte archiviate" checkbox toggle (default off), filters via
useMemoonactiveCategory+showArchived - Responsive card grid (1/2/3 columns) — each card is a
Linkto/admin/offers/${card.id}/edit, showinginternal_name,description(line-clamp-2), categoryBadge, and red "Archiviata" text for archived offers - Empty state: "Nessuna offerta" / "Inizia creando la tua prima offerta" + "+ Nuova Offerta" CTA
- "+ Nuova Offerta" header CTA toggles an inline form (
Input name="internal_name"+ "Crea" button); on submit callscreateOfferMacroviastartTransition, thenrouter.refresh()— new card appears in the grid - All literal copy strings verbatim from UI-SPEC copywriting contract table (Italian)
- Category filter chip row ("Tutti" + dynamic
Task Commits
Each task was committed atomically:
- Task 1: Rewrite /admin/offers page.tsx as the new list page entry point -
68dc1b6(feat) - Task 2: Build OfferListClient — category filter, archive toggle, card grid, create CTA -
7df4b9c(feat)
Plan metadata: (this commit, follows)
Files Created/Modified
src/app/admin/offers/page.tsx- Thin server component: fetchesgetOfferListCards()+getOfferFieldOptions(), rendersOfferListClientsrc/components/admin/offers/OfferListClient.tsx- Client component: category filter chips, archive toggle, responsive card grid, "+ Nuova Offerta" inline create form usingcreateOfferMacro
Decisions Made
- Removed all legacy macro/micro/offer_services CRUD UI from
/admin/offersper D-1 and UI-SPEC section 1; confirmed viagrep -rnthat no other file insrc/app/src/componentsreferencescreateMacro,createMicro,createOfferService,deleteMacro,deleteMicro,toggleOfferServiceActive,getCatalogWithMicros,getAllOfferServices, orServiceCheckboxListoutside the old page — these remain exported fromactions.ts/offer-queries.tsas zero-risk dead code (per plan's explicit instruction not to remove them) - Used shadcn
Button,Badge, andInputcomponents for CTA, category badge, and create-form text input respectively, matching the project's existing component library usage inCatalogSearch.tsx
Deviations from Plan
None - plan executed exactly as written. Both tasks implemented the documented component structure, state shape, filter logic, and copy strings verbatim.
Issues Encountered
None.
User Setup Required
None - no external service configuration required. Pure UI change consuming Plan 03's existing query/action exports.
Next Phase Readiness
/admin/offersnow renders the new card-grid list per UI-SPEC section 1; OFFER-18 satisfied (category filter + archive toggle, default hides archived)- Each card links to
/admin/offers/${id}/edit— Plan 05 builds this route in a parallel worktree; link target is correct regardless of Plan 05's landing order npx tsc --noEmitpasses with zero errors across the full project;npx eslintclean for both modified/created files- No legacy macro/micro/offer_services CRUD routes remain; underlying actions/queries left as unreferenced exports for future cleanup (out of this plan's scope)
Phase: 12-offer-composition-drag-drop-csv-import Completed: 2026-06-15
Self-Check: PASSED
All created/modified files verified present on disk:
- FOUND: src/app/admin/offers/page.tsx
- FOUND: src/components/admin/offers/OfferListClient.tsx
- FOUND: .planning/phases/12-offer-composition-drag-drop-csv-import/12-04-SUMMARY.md
All task commits verified present in git log: