From 299649738ef3e5b5ebf015466f0d3c4571b44a1b Mon Sep 17 00:00:00 2001 From: kuannnn Date: Sat, 28 Mar 2026 04:47:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(pwa):=20audit=20fixes=20=E2=80=94=20safe-ar?= =?UTF-8?q?ea,=20SW=20lifecycle,=20badge,=20tap=20highlight,=20update=20ba?= =?UTF-8?q?nner,=20precache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add safe-top to all full-screen overlays (PlanMode, DiffViewer, ChatView PlanViewer) - Add safe-top to SessionsView drill-down header + swipe-back via pushState - Move safe-top to ChatView outer container (persists when header hides) - Add skipWaiting + clients.claim for immediate SW updates - Create monochrome 96x96 badge icon for Android notifications - Add -webkit-tap-highlight-color: transparent for dark theme - Show SW update banner on all views, not just SessionsView - Fix precache duplicates with specific glob patterns (18→16 entries) - Add safe-bottom to ChatView saveToast - Fix stale poll interval comment (10s→3s) Co-Authored-By: Claude Opus 4.6 (1M context) --- public/badge-96x96.png | Bin 0 -> 434 bytes src/App.tsx | 61 ++++++++++++++++++-------------- src/components/ChatView.tsx | 4 +-- src/components/DiffViewer.tsx | 2 +- src/components/PlanMode.tsx | 2 +- src/components/SessionsView.tsx | 2 +- src/hooks/useSessions.ts | 21 +++++++++-- src/index.css | 1 + src/sw.ts | 8 ++++- vite.config.ts | 2 +- 10 files changed, 67 insertions(+), 36 deletions(-) create mode 100644 public/badge-96x96.png diff --git a/public/badge-96x96.png b/public/badge-96x96.png new file mode 100644 index 0000000000000000000000000000000000000000..946ecccabd8bcb0061d37ec6c89116fe5369d0d4 GIT binary patch literal 434 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoY)RhkE)4%caKYZ?lNlHo(>+}r zLn`LHy}8l%u!9KOgYu3hBUa`V1}--aX#*zd4NaRlXHR%@fI*U>a~ji2jSLy?n}I^V zEl+(fef}dZ?vMBL&BBa8gQ4I|_}bFY@3~fwL(BSOBW>^Z1Wq~3sW6ja5|p_4)}ypu zDe1OUed)3DZ*yZcmrAbekK20f+jqT1`=8I(tg`B6{&uBW==Yn)mJg&jkag-XN!;Kw zQ@@h?Y{%c+*{%%NeHcz2s}e2r>lU8pB>p@ng=f0Jfn=9Ga+c-RHC}q&0Y;1}+Q}ko zx9TZBT3Y(TPD!p$=ew+6IcKrG(xc6$b=phc^sSkiondbmd{*T8F`+3y^W1i_mt5Un zeQ4A3Dc?1J{WuY7gTe~DWM4f3y`M6 literal 0 HcmV?d00001 diff --git a/src/App.tsx b/src/App.tsx index d3a0536..8fb82ef 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -231,47 +231,62 @@ export function App() { const isOffline = !deviceOnline || serverOnline === false; + const updateBanner = swUpdateAvailable && ( +
+ New version available +
+ + +
+
+ ); + // Splash screen while first health check is pending if (serverOnline === null) { return ( -
- -
+ <> +
+ +
+ {updateBanner} + ); } // Offline screen if (isOffline) { - return ; + return <>{updateBanner}; } if (!authed) { - return ; + return <>{updateBanner}; } if (view.name === 'newchat') { return ( - + <> + + {updateBanner} + ); } if (view.name === 'settings') { - return setView({ name: 'sessions' })} />; + return <> setView({ name: 'sessions' })} />{updateBanner}; } if (view.name === 'chat') { return ( - + <> + + {updateBanner} + ); } @@ -285,15 +300,7 @@ export function App() { onInstall={handleInstall} onDismissInstall={dismissInstall} /> - {swUpdateAvailable && ( -
- New version available -
- - -
-
- )} + {updateBanner} ); } diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsx index 576270d..44cd8ca 100644 --- a/src/components/ChatView.tsx +++ b/src/components/ChatView.tsx @@ -27,7 +27,7 @@ function PlanViewer({ plan }: { plan: string }) { if (expanded) { return (
-
+
PLAN