Files
clienthub/.planning/milestones/v2.1-phases/12-offer-composition-drag-drop-csv-import/12-04-SUMMARY.md
T
simone f7eb7eec23 docs(planning): archivia v2.1/v2.2/v2.3 e documenta v2.4
.planning/ documentava in dettaglio cio che era vecchio e per niente cio
che e in produzione: le fasi 11-22 (v2.1 e v2.2, chiuse a giugno) erano
ancora in phases/ mentre v1.0 e v2.0 stavano gia in milestones/, e il
lavoro degli ultimi due mesi - gate OTP e ciclo di vita dei retainer, cioe
quello che gira su hub.iamcavalli.net - non aveva nessuna cartella.

- phases/{11,12,14} -> milestones/v2.1-phases/, phases/{18..22} ->
  milestones/v2.2-phases/. Ora phases/ contiene solo la milestone in
  corso, che e quello che state.cjs conta per il progresso
- v2.1-ROADMAP.md ricostruito: era l'unica milestone senza archivio,
  interrotta dal reset del 19/06 e mai chiusa formalmente
- v2.3-ROADMAP.md + v2.3-REQUIREMENTS.md: v2.3 e stata eseguita fuori dal
  ciclo GSD, non esistono PLAN/SUMMARY per fase. L'archivio E la doc
- REQUIREMENTS.md riscritto per v2.4 con il backlog reale
- phases/13 e phases/26: SUMMARY ricostruiti da commit, migration e
  STATUS.md. 26 e il primo numero libero
- research/: cancellate 4 varianti dello stesso PITFALLS e FEATURES/
  SUMMARY, superati da PROJECT.md. Diverse anti-feature erano ormai
  contraddette dai fatti (il Kanban e stato costruito in Phase 19,
  l'email in v2.3, il time tracking esiste)
- cancellati UI-RULES.md e DESIGN-SYSTEM.md (CLAUDE.md li dichiara
  superseded: impongono l'inverso della regola attuale) e HANDOFF.md,
  fermo al 13/06
- SECURITY-*.md -> security/: audit chiuso, ma i report restano la doc di
  cosa e stato ruotato e perche
- PROJECT.md/MILESTONES.md/ROADMAP.md allineati: milestone corrente v2.4,
  sessione OTP 90gg non 30, migrazioni fino alla 0016

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 22:38:36 +02:00

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
next.js
react
tailwind
shadcn
phase provides
12-offer-composition-drag-drop-csv-import (Plan 03) getOfferListCards(), getOfferFieldOptions(), createOfferMacro server action
/admin/offers list page rewritten as category-filterable, archive-aware offer card grid (UI-SPEC section 1)
OfferListClient component: category filter chips, archive toggle, '+ Nuova Offerta' inline create form, card grid linking to /admin/offers/[id]/edit
12-05-offer-editor-page
added patterns
Thin server-component list page (Promise.all fetch -> client component), mirroring src/app/admin/catalog/page.tsx
useTransition + router.refresh() for FormData server-action create flow without returning the new row's id
created modified
src/components/admin/offers/OfferListClient.tsx
src/app/admin/offers/page.tsx
Legacy macro/micro/offer_services CRUD UI removed from /admin/offers entirely per D-1 and UI-SPEC section 1; underlying actions.ts exports (createMacro, createMicro, createOfferService, deleteMacro, deleteMicro, updateMicroOfferServices) left untouched and unreferenced — zero-risk dead exports, confirmed via grep no other usages exist
Card grid links to /admin/offers/${id}/edit (Plan 05's route) — link target correct even though Plan 05 may not have landed yet at verification time
'+ Nuova Offerta' inline create-form pattern: toggle visibility, startTransition(createOfferMacro(formData)), then router.refresh() — admin clicks the new card to open the editor (no auto-navigation, no id returned from the server action)
OFFER-18
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.tsx rewritten as a thin server component: Promise.all([getOfferListCards(), getOfferFieldOptions()]) feeding OfferListClient, matching the catalog/page.tsx pattern (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 #1A463C border/text, inactive #e5e7eb/#71717a
    • "Mostra offerte archiviate" checkbox toggle (default off), filters via useMemo on activeCategory + showArchived
    • Responsive card grid (1/2/3 columns) — each card is a Link to /admin/offers/${card.id}/edit, showing internal_name, description (line-clamp-2), category Badge, 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 calls createOfferMacro via startTransition, then router.refresh() — new card appears in the grid
    • All literal copy strings verbatim from UI-SPEC copywriting contract table (Italian)

Task Commits

Each task was committed atomically:

  1. Task 1: Rewrite /admin/offers page.tsx as the new list page entry point - 68dc1b6 (feat)
  2. 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: fetches getOfferListCards() + getOfferFieldOptions(), renders OfferListClient
  • src/components/admin/offers/OfferListClient.tsx - Client component: category filter chips, archive toggle, responsive card grid, "+ Nuova Offerta" inline create form using createOfferMacro

Decisions Made

  • Removed all legacy macro/micro/offer_services CRUD UI from /admin/offers per D-1 and UI-SPEC section 1; confirmed via grep -rn that no other file in src/app/src/components references createMacro, createMicro, createOfferService, deleteMacro, deleteMicro, toggleOfferServiceActive, getCatalogWithMicros, getAllOfferServices, or ServiceCheckboxList outside the old page — these remain exported from actions.ts/offer-queries.ts as zero-risk dead code (per plan's explicit instruction not to remove them)
  • Used shadcn Button, Badge, and Input components for CTA, category badge, and create-form text input respectively, matching the project's existing component library usage in CatalogSearch.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/offers now 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 --noEmit passes with zero errors across the full project; npx eslint clean 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: