Skip to content

Add vite-pwa support to the cms and fix the titlebar bug in the app#1775

Open
MrDirkelz wants to merge 3 commits into
mainfrom
1752-cms-add-vite-pwa-support-and-add-in-app-install-notification
Open

Add vite-pwa support to the cms and fix the titlebar bug in the app#1775
MrDirkelz wants to merge 3 commits into
mainfrom
1752-cms-add-vite-pwa-support-and-add-in-app-install-notification

Conversation

@MrDirkelz

Copy link
Copy Markdown
Collaborator

No description provided.

@ivanslabbert

Copy link
Copy Markdown
Contributor

Review — 🟢 Approve

Both tickets (#1752, #1753) are satisfied and the test-gap from the earlier #1755 review is now closed. Two carry-over nits remain (non-blocking).

This is effectively #1755 re-opened on the same branch, but unlike the stale snapshot I first reviewed there, this branch is genuinely clean: main is an ancestor, 11 files, no scope bloat. The +8k/−3.6k churn is entirely cms/package-lock.json regenerating for the one new dev dep (vite-plugin-pwa ^1.0.3workbox-* tree).

Per ticket

#1752 — CMS: Vite PWA + in-app install notification → satisfied

  • cms/vite.config.ts adds VitePWA (registerType: autoUpdate, manifest name from env.VITE_APP_NAME, static theme_color/background_color: #ffffff, pwa-icon-192.png, workbox.navigateFallback: null — correct for a non-offline-first SPA).
  • useInstallPrompt.ts is correct: preventDefaults beforeinstallprompt, tracks appinstalled, SSR-guarded, and detects already-installed via navigator.standalone + display-mode media queries. Module-level singleton is intentional and fine.
  • SideBar.vue renders an "Install app" button gated on isInstallable; styling matches the sibling account section (including its lack of a dark: variant).

#1753 — APP: green PWA title bar → addressed

  • app/index.html adds light/dark media-query theme-color metas (#ffffff / #0f172a), matching the bg-white dark:bg-slate-900 body palette.

Verification

Ran the two new CMS specs (after npm install to pull the new plugin) — 17/17 pass. The added coverage (useInstallPrompt.spec.ts, the SideBar install-button test, and the matchMedia mock in vitest.setup.ts) closes the "no unit test for the install flow" nit from the earlier review.

Remaining nits (non-blocking)

  1. APP: Fix PWA green title bar (should follow app colour scheme) #1753 — app manifest has no theme_color (carry-over, still unaddressed). app/vite.config.ts sets no manifest theme_color. The index.html media-query metas fix the in-browser address bar and, in modern Chrome, the installed standalone bar — but the manifest theme_color is the authoritative source for the splash screen and the fallback for browsers that ignore media-query theme-color. CMS deliberately added a static #ffffff; the app has none. A manifest value is static (can't switch light/dark), so picking #ffffff there as a floor would be the parity move. Judgment call — the media-query approach likely resolves the reported symptom.
  2. CMS install action is a sidebar button, not a "notification." Reasonable reading of "in-app install notification," but flagging in case a proactive toast was intended.

One question worth a glance

cms/vite.config.ts uses loadEnv("", process.cwd()) (empty mode) whereas the app uses loadEnv(mode, …). Empty mode still loads .env/.env.local, so VITE_APP_NAME resolves — just noting the inconsistency.

🤖 AI-assisted review summary (Claude Code). Read-only analysis of the PR diff, plus a local run of the two new CMS specs — not a substitute for human review.

@ivanslabbert

ivanslabbert commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Check failing tests and nitpick 1.
Nitpick 2 is accepted, we can keep it in the menu

@MrDirkelz

Copy link
Copy Markdown
Collaborator Author

Check failing tests and nitpick 1. Nitpick 2 is accepted, we can keep it in the menu

image So this is fine?

Re-arm the window.matchMedia mock every test instead of once at setup
scope — EditGroup.spec's vi.resetAllMocks() was wiping it, breaking any
component using vueuse's useMediaQuery/useBreakpoints. Also add
theme_color/background_color to the app's PWA manifest for parity with
the cms (addresses review nitpick on PR #1775).
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.

CMS: Add Vite PWA support, and add in-app install notification APP: Fix PWA green title bar (should follow app colour scheme)

2 participants