From d9b022bd4c7fb65ec617ec7b430c65c8266a07bc Mon Sep 17 00:00:00 2001 From: Adolfo Delorenzo Date: Wed, 25 Mar 2026 20:34:24 -0600 Subject: [PATCH] docs(08-mobile-pwa): create phase plan --- .planning/ROADMAP.md | 15 +- .planning/phases/08-mobile-pwa/08-01-PLAN.md | 351 +++++++++++++++++++ .planning/phases/08-mobile-pwa/08-02-PLAN.md | 239 +++++++++++++ .planning/phases/08-mobile-pwa/08-03-PLAN.md | 335 ++++++++++++++++++ .planning/phases/08-mobile-pwa/08-04-PLAN.md | 143 ++++++++ 5 files changed, 1077 insertions(+), 6 deletions(-) create mode 100644 .planning/phases/08-mobile-pwa/08-01-PLAN.md create mode 100644 .planning/phases/08-mobile-pwa/08-02-PLAN.md create mode 100644 .planning/phases/08-mobile-pwa/08-03-PLAN.md create mode 100644 .planning/phases/08-mobile-pwa/08-04-PLAN.md diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index f9ffb4f..a11755a 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -142,7 +142,7 @@ Phases execute in numeric order: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 | 5. Employee Design | 4/4 | Complete | 2026-03-25 | | 6. Web Chat | 3/3 | Complete | 2026-03-25 | | 7. Multilanguage | 4/4 | Complete | 2026-03-25 | -| 8. Mobile + PWA | 0/0 | Not started | - | +| 8. Mobile + PWA | 0/4 | In progress | - | --- @@ -174,17 +174,20 @@ Plans: **Depends on**: Phase 7 **Requirements**: MOB-01, MOB-02, MOB-03, MOB-04, MOB-05, MOB-06 **Success Criteria** (what must be TRUE): - 1. All portal pages render correctly and are usable on mobile screens (320px–480px) and tablets (768px–1024px) - 2. The sidebar collapses to a hamburger menu on mobile with smooth open/close animation + 1. All portal pages render correctly and are usable on mobile screens (320px-480px) and tablets (768px-1024px) + 2. The sidebar collapses to a bottom tab bar on mobile with smooth open/close animation 3. The chat interface is fully functional on mobile — send messages, see streaming responses, scroll history 4. The portal can be installed as a PWA from Chrome/Safari with app icon, splash screen, and offline shell 5. Push notifications work for new messages when the PWA is installed (or at minimum, the service worker caches the app shell for instant load) 6. All touch interactions (swipe, tap, long-press) feel native — no hover-dependent UI that breaks on touch -**Plans**: 0 plans +**Plans**: 4 plans Plans: -- [ ] TBD (run /gsd:plan-phase 8 to break down) +- [ ] 08-01-PLAN.md — PWA infrastructure (manifest, service worker, icons, offline banner) + responsive layout (bottom tab bar, More sheet, layout split) +- [ ] 08-02-PLAN.md — Mobile chat (full-screen WhatsApp-style flow, Visual Viewport keyboard handling, touch-safe interactions) +- [ ] 08-03-PLAN.md — Push notifications (VAPID, push subscription DB, service worker push handler, offline message queue, install prompt) +- [ ] 08-04-PLAN.md — Human verification: mobile responsive layout, PWA install, push notifications, touch interactions --- *Roadmap created: 2026-03-23* -*Coverage: 25/25 v1 requirements + 6 RBAC requirements + 5 Employee Design requirements + 5 Web Chat requirements + 6 Multilanguage requirements mapped* +*Coverage: 25/25 v1 requirements + 6 RBAC requirements + 5 Employee Design requirements + 5 Web Chat requirements + 6 Multilanguage requirements + 6 Mobile+PWA requirements mapped* diff --git a/.planning/phases/08-mobile-pwa/08-01-PLAN.md b/.planning/phases/08-mobile-pwa/08-01-PLAN.md new file mode 100644 index 0000000..77d35da --- /dev/null +++ b/.planning/phases/08-mobile-pwa/08-01-PLAN.md @@ -0,0 +1,351 @@ +--- +phase: 08-mobile-pwa +plan: 01 +type: execute +wave: 1 +depends_on: [] +files_modified: + - packages/portal/package.json + - packages/portal/next.config.ts + - packages/portal/app/manifest.ts + - packages/portal/app/sw.ts + - packages/portal/app/layout.tsx + - packages/portal/app/(dashboard)/layout.tsx + - packages/portal/components/mobile-nav.tsx + - packages/portal/components/mobile-more-sheet.tsx + - packages/portal/components/sw-register.tsx + - packages/portal/components/offline-banner.tsx + - packages/portal/lib/use-offline.ts + - packages/portal/public/icon-192.png + - packages/portal/public/icon-512.png + - packages/portal/public/icon-maskable-192.png + - packages/portal/public/apple-touch-icon.png + - packages/portal/public/badge-72.png + - packages/portal/messages/en.json + - packages/portal/messages/es.json + - packages/portal/messages/pt.json +autonomous: true +requirements: + - MOB-01 + - MOB-02 + - MOB-04 + +must_haves: + truths: + - "Desktop sidebar is hidden on screens < 768px; bottom tab bar appears instead" + - "Bottom tab bar has 5 items: Dashboard, Employees, Chat, Usage, More" + - "More sheet opens with Billing, API Keys, Users, Platform, Settings, Sign Out (RBAC-filtered)" + - "Main content has bottom padding on mobile to clear the tab bar" + - "Portal is installable as a PWA with manifest, icons, and service worker" + - "Offline banner appears when network is lost" + - "All existing pages remain functional on desktop (no regression)" + artifacts: + - path: "packages/portal/components/mobile-nav.tsx" + provides: "Bottom tab bar navigation for mobile" + exports: ["MobileNav"] + - path: "packages/portal/components/mobile-more-sheet.tsx" + provides: "Bottom sheet for secondary nav items" + exports: ["MobileMoreSheet"] + - path: "packages/portal/app/manifest.ts" + provides: "PWA manifest with K monogram icons" + exports: ["default"] + - path: "packages/portal/app/sw.ts" + provides: "Service worker with Serwist precaching" + - path: "packages/portal/components/sw-register.tsx" + provides: "Service worker registration client component" + exports: ["ServiceWorkerRegistration"] + - path: "packages/portal/components/offline-banner.tsx" + provides: "Offline status indicator" + exports: ["OfflineBanner"] + key_links: + - from: "packages/portal/app/(dashboard)/layout.tsx" + to: "packages/portal/components/mobile-nav.tsx" + via: "conditional render with hidden md:flex / md:hidden" + pattern: "MobileNav.*md:hidden" + - from: "packages/portal/next.config.ts" + to: "packages/portal/app/sw.ts" + via: "withSerwist wrapper generates public/sw.js from app/sw.ts" + pattern: "withSerwist" + - from: "packages/portal/app/layout.tsx" + to: "packages/portal/components/sw-register.tsx" + via: "mounted in body for service worker registration" + pattern: "ServiceWorkerRegistration" +--- + + +Responsive mobile layout foundation and PWA infrastructure. Desktop sidebar becomes a bottom tab bar on mobile, PWA manifest and service worker enable installability, and offline detection provides status feedback. + +Purpose: This is the structural foundation that all other mobile plans build on. The layout split (sidebar vs tab bar) affects every page, and PWA infrastructure (manifest + service worker) is required before push notifications or offline caching can work. + +Output: Mobile-responsive dashboard layout, bottom tab bar with More sheet, PWA manifest with K monogram icons, Serwist service worker, offline banner component. + + + +@/home/adelorenzo/.claude/get-shit-done/workflows/execute-plan.md +@/home/adelorenzo/.claude/get-shit-done/templates/summary.md + + + +@.planning/PROJECT.md +@.planning/ROADMAP.md +@.planning/STATE.md +@.planning/phases/08-mobile-pwa/08-CONTEXT.md +@.planning/phases/08-mobile-pwa/08-RESEARCH.md + + + + +From packages/portal/components/nav.tsx: +```typescript +type NavItem = { + href: string; + label: string; + icon: React.ElementType; + allowedRoles?: string[]; +}; + +// Nav items array (lines 43-53): +// Dashboard, Tenants (platform_admin), Employees, Chat, Usage, +// Billing (admin+), API Keys (admin+), Users (admin+), Platform (platform_admin) +// Role filtering: visibleItems = navItems.filter(item => !item.allowedRoles || item.allowedRoles.includes(role)) +``` + +From packages/portal/app/(dashboard)/layout.tsx: +```typescript +// Current layout: flex min-h-screen,