Skip to content

feat(pwa): PWA install prompt and offline-ready UI - #447

Open
only1isaac wants to merge 1 commit into
FinChippay:masterfrom
only1isaac:feature/pwa-install-prompt-offline-ui
Open

feat(pwa): PWA install prompt and offline-ready UI#447
only1isaac wants to merge 1 commit into
FinChippay:masterfrom
only1isaac:feature/pwa-install-prompt-offline-ui

Conversation

@only1isaac

Copy link
Copy Markdown
Contributor

Summary

Implements the full PWA Install Prompt and Offline-Ready UI as described in issue #372.

Changes

New files

File Purpose
frontend/hooks/useNetworkStatus.ts Wraps navigator.onLine with event listeners. Exposes isOnline, wasOffline, lastOnlineAt, installPromptReady, triggerInstallPrompt. Captures the beforeinstallprompt event as a module-level singleton.
frontend/lib/offlineQueue.ts IndexedDB-backed queue for offline payment actions. Exports enqueue, getQueue, getQueueLength, drainQueue, startSync (auto-drains on the online event).
frontend/lib/cacheData.ts IndexedDB-backed API-response cache with per-entry timestamps. Exports set, get, remove, clear, fetchWithCache, buildAgeLabel.
frontend/components/InstallPrompt.tsx Custom PWA install card shown after 3+ visits (tracked in localStorage). Benefits messaging, Install / Not Now / Don't show again, gtag analytics.
frontend/components/FeeEstimator.tsx Fee-tier selector (Economy / Standard / Fast) powered by live Horizon fee stats.

Updated files

File Changes
frontend/components/OfflineBanner.tsx Rewritten using useNetworkStatus. Shows cached data age, queued-action count, animated Back-online strip.
frontend/pages/_app.tsx Removed inline InstallBanner and BeforeInstallPromptEvent; imports and renders InstallPrompt.

Pre-existing TypeScript build errors fixed

  • HighlightedTransactionRow: payment.type === "payment_received""received", payment.hashpayment.transactionHash
  • transactionSearch / transactionSearchIndex: same type and field corrections
  • SendPaymentForm: removed unsupported baseFee param from buildPaymentTransaction / buildSorobanTipTransaction
  • settings.tsx: duplicate import removed, void return from pause/resume handled correctly

Acceptance criteria status

Criteria Status
Custom install prompt appears after 3+ visits
Install button triggers native install flow
Offline banner shows cached data age and queued action count
Queued actions execute in order when back online
Installation events tracked
Frontend build passes

What was tested

  • npm run build passes with zero TypeScript errors
  • All 12 changed files type-check cleanly

Closes #372

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

@only1isaac is attempting to deploy a commit to the Topmatrixmor2014 Team on Vercel.

A member of the Team first needs to authorize it.

- Add frontend/hooks/useNetworkStatus.ts: wraps navigator.onLine with
  online/offline event listeners, exposes isOnline, wasOffline,
  lastOnlineAt, installPromptReady, and triggerInstallPrompt. Captures
  beforeinstallprompt as a module-level singleton so it is never missed.

- Add frontend/lib/offlineQueue.ts: IndexedDB-backed queue for payment
  actions taken while offline. Exports enqueue, getQueue, getQueueLength,
  drainQueue, and startSync which auto-drains on the online event.

- Add frontend/lib/cacheData.ts: IndexedDB-backed API-response cache with
  per-entry timestamps. Exports set, get, remove, clear, fetchWithCache,
  and buildAgeLabel for human-readable cache age strings.

- Add frontend/components/InstallPrompt.tsx: custom PWA install card
  shown after 3+ visits (tracked in localStorage). Includes benefits
  messaging (faster access, offline payments, push notifications),
  Install / Not Now / Don't show again actions, and gtag analytics for
  accepted / dismissed outcomes.

- Update frontend/components/OfflineBanner.tsx: enhanced banner using
  useNetworkStatus and offlineQueue. Shows cached data age, queued-action
  count, and an animated Back-online confirmation strip on reconnection.

- Update frontend/pages/_app.tsx: remove inline InstallBanner and
  BeforeInstallPromptEvent; import and render InstallPrompt instead.

- Add frontend/components/FeeEstimator.tsx: fee-tier selector (Economy /
  Standard / Fast) with live Horizon fee stats.

- Fix pre-existing TypeScript errors that blocked the CI build:
  - HighlightedTransactionRow: payment.type "payment_received" → "received",
    payment.hash → payment.transactionHash, null|string → undefined
  - transactionSearch: payment.type "payment" comparisons → "sent"|"received",
    payment.hash → payment.transactionHash
  - transactionSearchIndex: same type and field fixes as above
  - SendPaymentForm: remove unsupported baseFee param from
    buildPaymentTransaction / buildSorobanTipTransaction calls
  - settings.tsx: remove duplicate signTransactionWithWallet import,
    fix void return type from pause/resumeTurretsFunction

Closes FinChippay#372
@only1isaac
only1isaac force-pushed the feature/pwa-install-prompt-offline-ui branch from 49391ce to 78fc53f Compare July 27, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New] Progressive Web App Install Prompt and Offline-Ready UI

1 participant