diff --git a/.planning/HANDOFF.json b/.planning/HANDOFF.json deleted file mode 100644 index 3e3f909..0000000 --- a/.planning/HANDOFF.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "1.0", - "timestamp": "2026-06-23T06:18:22.001Z", - "phase": "04", - "phase_name": "marketplace-portal-navigation", - "phase_dir": ".planning/phases/04-marketplace-portal-navigation", - "plan": 1, - "task": 3, - "total_tasks": 3, - "status": "paused", - "completed_tasks": [ - {"id": 1, "name": "Install and configure Vitest test infrastructure for apps/web", "status": "done", "commit": "e50b3c7"}, - {"id": 2, "name": "Add marketplace i18n namespace and build MarketplaceCard component", "status": "done", "commit": "1e494b3"}, - {"id": 3, "name": "Build /marketplace page and marketplace-store", "status": "in_progress", "progress": "RED phase complete — 4 failing tests written (marketplace.test.tsx). GREEN phase not started: page.tsx and marketplace-store.ts do not exist yet."} - ], - "remaining_tasks": [ - {"id": 3, "name": "Build /marketplace page and marketplace-store — implement page.tsx + marketplace-store.ts to make 4 tests pass", "status": "in_progress"} - ], - "blockers": [], - "human_actions_pending": [], - "decisions": [ - {"decision": "TDD red-green workflow for all tasks with tdd=true", "rationale": "Plan specifies TDD; tests written first, then implementation", "phase": "04"} - ], - "uncommitted_files": [], - "next_action": "Create apps/web/src/lib/stores/marketplace-store.ts and apps/web/src/app/(portal)/marketplace/page.tsx following 04-01-PLAN Task 3 action spec, then run vitest to make all 4 marketplace.test.tsx tests pass (GREEN phase).", - "context_notes": "Plan 04-01 Task 3 uses TDD. The 4 failing tests in marketplace.test.tsx define the expected behavior. The page.tsx should follow admin/modules/page.tsx pattern (parallel fetch, activation Map, role gate). marketplace-store needs bumpSidebarRefresh + selectedTenantId. After Task 3 passes, Plan 04-01 SUMMARY needs writing, then Plan 04-02 starts." -} diff --git a/.planning/STATE.md b/.planning/STATE.md index f8b1a87..29d5712 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -5,7 +5,7 @@ milestone_name: milestone status: executing stopped_at: Phase 4 UI-SPEC approved last_updated: "2026-06-22T12:42:52.447Z" -last_activity: 2026-06-22 -- Phase 04 execution started +last_activity: 2026-06-23 -- Plan 04-01 completed progress: total_phases: 6 completed_phases: 2 @@ -26,9 +26,9 @@ See: .planning/PROJECT.md (updated 2026-06-18) ## Current Position Phase: 04 (marketplace-portal-navigation) — EXECUTING -Plan: 1 of 4 -Status: Executing Phase 04 -Last activity: 2026-06-22 -- Phase 04 execution started +Plan: 2 of 4 +Status: Plan 04-01 complete, ready for 04-02 +Last activity: 2026-06-23 -- Plan 04-01 completed (marketplace browse + activate) Progress: [██▓░░░░░░░] 25% @@ -93,6 +93,6 @@ Items acknowledged and carried forward from previous milestone close: ## Session Continuity -Last session: 2026-06-22T11:55:16.369Z -Stopped at: Phase 4 UI-SPEC approved -Resume file: .planning/phases/04-marketplace-portal-navigation/04-UI-SPEC.md +Last session: 2026-06-23T06:52:00Z +Stopped at: Plan 04-01 complete, 04-02 ready +Resume file: .planning/phases/04-marketplace-portal-navigation/04-02-PLAN.md diff --git a/.planning/phases/04-marketplace-portal-navigation/.continue-here.md b/.planning/phases/04-marketplace-portal-navigation/.continue-here.md deleted file mode 100644 index eddca50..0000000 --- a/.planning/phases/04-marketplace-portal-navigation/.continue-here.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -context: phase -phase: 04-marketplace-portal-navigation -task: 3 -total_tasks: 3 -status: in_progress -last_updated: 2026-06-23T06:18:22.001Z ---- - - -Phase 04, Plan 01 (marketplace browse + activate), Task 3 of 3. -TDD RED phase done — 4 failing tests in marketplace.test.tsx committed (0b7cf66). -GREEN phase not started: `page.tsx` and `marketplace-store.ts` do not exist yet. -Tasks 1 (Vitest infra) and 2 (MarketplaceCard + i18n) fully done and committed. - - - - -Completed Tasks: -- Task 1: Vitest infrastructure — Done (e50b3c7). vitest.config.ts, setup.ts, test scripts. -- Task 2: MarketplaceCard + i18n — Done (1e494b3). Component, 5 passing tests, marketplace namespace in de.json/en.json. -- Task 3: marketplace page + store — In progress. 4 failing tests written (0b7cf66). Implementation not started. - - - - -- Task 3 GREEN phase: Create `apps/web/src/lib/stores/marketplace-store.ts` (Zustand store with bumpSidebarRefresh + selectedTenantId) and `apps/web/src/app/(portal)/marketplace/page.tsx` (client component with parallel fetch, activation Map, role gate, card grid). Make all 4 tests in marketplace.test.tsx pass. -- Task 3 verification: `pnpm vitest run` all green + `pnpm type-check` clean. -- 04-01-SUMMARY.md: Write after Task 3 done. -- Plans 04-02, 04-03, 04-04: Not started. - - - - -- TDD red-green for all tdd=true tasks — tests first, then implementation -- Parallel fetch pattern (Promise.all for /modules + /modules/active) per admin/modules/page.tsx analog -- Activation state as client-side Map, not per-card fetch - - - -None. - - -## Required Reading (in order) -1. `.planning/phases/04-marketplace-portal-navigation/04-01-PLAN.md` — Task 3 action spec has exact implementation details -2. `apps/web/src/app/(portal)/marketplace/marketplace.test.tsx` — The 4 tests that must pass (defines expected behavior) -3. `apps/web/src/app/(portal)/admin/modules/page.tsx` — Analog for parallel fetch + activation Map pattern -4. `apps/web/src/lib/stores/sidebar-store.ts` — Zustand store pattern reference -5. `.planning/phases/04-marketplace-portal-navigation/04-UI-SPEC.md` — Layout specs, grid breakpoints - -## Infrastructure State -- Docker services running: PostgreSQL, Redis, API (NestJS), Web (Next.js), Traefik -- API has /modules and /modules/active endpoints working (verified Phase 03) -- Vitest configured and operational in apps/web - - -Straightforward TDD GREEN phase. Tests define behavior, Task 3 action block has exact implementation. Follow admin/modules/page.tsx pattern closely. No blockers or complications expected. - - - -Start with: Create `apps/web/src/lib/stores/marketplace-store.ts` following Task 3 action spec, then create `apps/web/src/app/(portal)/marketplace/page.tsx`, then run `cd apps/web && pnpm vitest run` to verify all tests pass. - diff --git a/.planning/phases/04-marketplace-portal-navigation/04-01-SUMMARY.md b/.planning/phases/04-marketplace-portal-navigation/04-01-SUMMARY.md new file mode 100644 index 0000000..e10f2e2 --- /dev/null +++ b/.planning/phases/04-marketplace-portal-navigation/04-01-SUMMARY.md @@ -0,0 +1,108 @@ +--- +phase: 04-marketplace-portal-navigation +plan: 01 +subsystem: ui +tags: [react, vitest, zustand, next-intl, marketplace, testing-library] + +requires: + - phase: 03-module-system-domaincheck + provides: /modules and /modules/active API endpoints, module-registry CRUD +provides: + - Vitest test infrastructure for apps/web (jsdom + testing-library) + - MarketplaceCard component with activation controls + - /marketplace page with parallel fetch, activation Map, role gate + - marketplace-store (Zustand) with sidebarRefreshKey + selectedTenantId + - marketplace i18n namespace (DE/EN) with full copywriting contract +affects: [04-02 filters/detail, 04-03 sidebar, 04-04 navigation] + +tech-stack: + added: [vitest, @testing-library/react, @testing-library/jest-dom, @testing-library/user-event, jsdom, @vitejs/plugin-react] + patterns: [TDD red-green, parallel fetch with activation Map, Zustand cross-component signaling] + +key-files: + created: + - apps/web/vitest.config.ts + - apps/web/src/test/setup.ts + - apps/web/src/lib/stores/marketplace-store.ts + - apps/web/src/app/(portal)/marketplace/page.tsx + - apps/web/src/app/(portal)/marketplace/components/MarketplaceCard.tsx + - apps/web/src/app/(portal)/marketplace/components/MarketplaceCard.test.tsx + - apps/web/src/app/(portal)/marketplace/marketplace.test.tsx + modified: + - apps/web/package.json + - apps/web/src/messages/de.json + - apps/web/src/messages/en.json + +key-decisions: + - "TDD red-green workflow: tests first, then implementation" + - "Parallel fetch (Promise.all) with client-side activation Map instead of per-card fetch" + - "marketplace-store signals sidebar refresh via sidebarRefreshKey counter" + +patterns-established: + - "Vitest + testing-library + jsdom for React component tests" + - "next-intl mock pattern: vi.mock returning key lookup function" + - "Zustand store mock pattern for isolated component testing" + +requirements-completed: [MRKT-01, MRKT-02, MRKT-04] + +duration: 15min +completed: 2026-06-23 +--- + +# Plan 04-01: Marketplace Browse + Activate Summary + +**Vitest test infra, MarketplaceCard component, and /marketplace page with parallel fetch, activation Map, and role-gated card grid — 9 tests green** + +## Performance + +- **Duration:** ~15 min (across 2 sessions, paused after RED phase) +- **Started:** 2026-06-22T12:45:00Z +- **Completed:** 2026-06-23T06:52:00Z +- **Tasks:** 3 +- **Files modified:** 10 + +## Accomplishments +- Vitest + testing-library test infrastructure operational in apps/web +- MarketplaceCard with icon, name, localized description, category badge, status badge, activate/deactivate button +- /marketplace page with Promise.all parallel fetch, activation Map, admin role gate, empty state, responsive 1/2/3/4-col grid +- marketplace-store with sidebarRefreshKey signal for sidebar re-fetch after activation +- Full marketplace i18n namespace (DE/EN) with all copywriting contract keys + +## Task Commits + +1. **Task 1: Vitest test infrastructure** - `e50b3c7` (chore) +2. **Task 2: MarketplaceCard + i18n** - `a64f889` (test/RED), `1e494b3` (feat/GREEN) +3. **Task 3: Marketplace page + store** - `0b7cf66` (test/RED), `fb6a340` (feat/GREEN) + +## Files Created/Modified +- `apps/web/vitest.config.ts` - Vitest config with jsdom + react plugin +- `apps/web/src/test/setup.ts` - jest-dom matcher registration +- `apps/web/src/lib/stores/marketplace-store.ts` - Zustand store for sidebar refresh signal + tenant context +- `apps/web/src/app/(portal)/marketplace/page.tsx` - Marketplace grid page with fetch + role gate +- `apps/web/src/app/(portal)/marketplace/components/MarketplaceCard.tsx` - Module card component +- `apps/web/src/app/(portal)/marketplace/components/MarketplaceCard.test.tsx` - 5 card unit tests +- `apps/web/src/app/(portal)/marketplace/marketplace.test.tsx` - 4 page tests +- `apps/web/src/messages/de.json` - marketplace namespace added +- `apps/web/src/messages/en.json` - marketplace namespace added + +## Decisions Made +- Followed plan as specified, no significant deviations +- Used admin/modules/page.tsx as direct analog for fetch + Map pattern + +## Deviations from Plan +None - plan executed exactly as written. + +## Issues Encountered +- pnpm install needed at session start (node_modules not present from fresh checkout) + +## User Setup Required +None - no external service configuration required. + +## Next Phase Readiness +- Plan 04-02 (filters, search, detail view, tenant context) can start — marketplace page and store are in place +- marketplace-store.selectedTenantId ready for tenant dropdown in 04-02 +- sidebarRefreshKey ready for sidebar subscription in 04-03 + +--- +*Phase: 04-marketplace-portal-navigation* +*Completed: 2026-06-23*