- InstallPromptBanner: 7-day cooldown, iOS fallback, beforeinstallprompt CTA - OfflineBanner: amber theming, queue count, 3s auto-dismiss on reconnect - useOfflineQueue: IndexedDB nexus-offline/message_queue, flush on online event - ChatPanel: offline guard in handleSend, OfflineBanner + InstallPromptBanner wired - Requirements PWA-01, PWA-02, PWA-08 marked complete
6.8 KiB
6.8 KiB
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | duration | completed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 26-pwa-performance | 03 | ui |
|
|
|
|
|
|
|
|
|
5min | 2026-04-02 |
Phase 26 Plan 03: PWA Install Prompt, Offline Banner, and Message Queue Summary
PWA install prompt with iOS fallback, amber offline status banner, and IndexedDB message queue that auto-flushes on reconnection
Performance
- Duration: ~5 min
- Started: 2026-04-02T02:15:40Z
- Completed: 2026-04-02T02:20:35Z
- Tasks: 2
- Files modified: 8
Accomplishments
- Created three production hooks:
useOnlineStatus(reactive online state),useInstallPrompt(captures beforeinstallprompt + iOS detection),useOfflineQueue(IndexedDB-backed queue with auto-flush) - Built
InstallPromptBannercomponent with 7-day localStorage dismiss cooldown, iOS Share menu instruction text, and "Add to Home Screen" CTA - Built
OfflineBannercomponent with amber theming (dark/light), queued message count display, and 3-second auto-dismiss on reconnection - Wired
ChatPanelto enqueue messages to IndexedDB when offline and display a queued toast notification
Task Commits
- Task 1: useOnlineStatus, useInstallPrompt, useOfflineQueue hooks -
2b172bda(feat) - Task 2: InstallPromptBanner, OfflineBanner, ChatPanel wiring -
427e6c80(feat)
Files Created/Modified
ui/src/hooks/useOnlineStatus.ts— Reactive boolean from navigator.onLine with online/offline event listenersui/src/hooks/useInstallPrompt.ts— Captures beforeinstallprompt, iOS detection via userAgent, promptInstall() callbackui/src/hooks/useOfflineQueue.ts— openDB nexus-offline/message_queue store, enqueue/flush with stop-on-failure strategyui/src/components/InstallPromptBanner.tsx— Fixed-position banner with 7-day localStorage cooldown and iOS text variantui/src/components/OfflineBanner.tsx— Fixed top-0 amber banner showing queue count, 3s auto-dismiss on reconnectui/src/components/ChatPanel.tsx— Added isOnline guard in handleSend, enqueue call, OfflineBanner and InstallPromptBanner rendersui/src/types/pwa.d.ts— BeforeInstallPromptEvent interface with global WindowEventMap extensionui/package.json— Added idb@^8.0.3 dependency
Decisions Made
idbandpwa.d.tswere added here as a deviation — the parallel 26-00 worktree commits were not merged intogsd/phase-26-pwa-performancebranch- Offline guard in
handleSendonly enqueues whenactiveConversationIdexists — creating a new conversation requires network, so we skip enqueue for that path useOfflineQueue.flush()breaks on first failure — stops partial replay and retries on nextonlineevent
Deviations from Plan
Auto-fixed Issues
1. [Rule 3 - Blocking] Added idb dependency and pwa.d.ts that were missing from branch
- Found during: Task 1 (creating hooks)
- Issue: The
gsd/phase-26-pwa-performancebranch was missing theidbpackage andui/src/types/pwa.d.tsthat were created in a parallel 26-00 worktree but never merged to the main phase branch - Fix: Added
idb@^8.0.3toui/package.json, ranpnpm install, createdui/src/types/pwa.d.tswith BeforeInstallPromptEvent interface - Files modified: ui/package.json, pnpm-lock.yaml, ui/src/types/pwa.d.ts
- Verification:
import { openDB } from "idb"compiles without errors - Committed in:
2b172bda(Task 1 commit)
Total deviations: 1 auto-fixed (1 blocking) Impact on plan: Required for task completion. No scope creep.
Issues Encountered
- Pre-existing TypeScript errors in
packages/shared(zodmodule not found) andpackages/adapterspreventpnpm --filter @paperclipai/ui buildfrom passing at the workspace level, buttsc -bwithin theuidirectory itself produces zero errors. These are pre-existing issues unrelated to this plan.
User Setup Required
None - no external service configuration required.
Next Phase Readiness
- PWA install prompt, offline banner, and message queue all functional
useOfflineQueuerelies onchatApi.postMessagefor replay — the flush will restore messages when reconnected- Plan 26-04 (push notifications) can build on the same
useOnlineStatuspattern
Self-Check: PASSED
- FOUND: ui/src/hooks/useOnlineStatus.ts
- FOUND: ui/src/hooks/useInstallPrompt.ts
- FOUND: ui/src/hooks/useOfflineQueue.ts
- FOUND: ui/src/components/InstallPromptBanner.tsx
- FOUND: ui/src/components/OfflineBanner.tsx
- FOUND: ui/src/types/pwa.d.ts
- FOUND commit: 2b172bda (Task 1)
- FOUND commit: 427e6c80 (Task 2)
Phase: 26-pwa-performance Completed: 2026-04-02