2.6 KiB
2.6 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick-260611-tfc | 01 | pwa-sw |
|
|
|
|
|
|
Quick Task 260611-tfc: Fix WR-01 sw.ts notificationclick openWindow Fallback
One-liner: notificationclick handler extended with .then(navigated===null → openWindow) + .catch(→ openWindow) so the new-window fallback is reachable on both focus rejection and null navigate.
What Was Done
Fixed WR-01 from .planning/phases/13-real-lint-gate-eslint/13-REVIEW.md.
The focusable-client return inside the for (const client of clientList) loop was:
return client.focus().then(() => client.navigate(url));
Two failure modes made the openWindow fallback unreachable:
navigate()resolvingnull(browser rejected the navigation) — the chain resolved successfully, so the post-loop fallback was never reached.focus()ornavigate()rejecting (window closed betweenmatchAllandfocus) — the rejection propagated intoevent.waitUntil, marking the click as handled without opening a new window.
Applied the canonical replacement per the review:
return client
.focus()
.then(() => client.navigate(url))
.then((navigated) => {
if (navigated === null && self.clients.openWindow)
return self.clients.openWindow(url);
})
.catch(() => {
if (self.clients.openWindow) return self.clients.openWindow(url);
});
All surrounding behaviour preserved: event.notification.close(), url extraction + eslint-disable comments, matchAll options, and the post-loop no-focusable-client fallback.
Verification — Exit Codes
| Command | Exit |
|---|---|
pnpm lint |
0 |
pnpm typecheck |
0 |
pnpm --filter @familysync/pwa test |
0 (191/191 pass) |
pnpm --filter @familysync/pwa build |
0 (dist/sw.js emitted) |
Deviations from Plan
None — plan executed exactly as written.
Self-Check: PASSED
apps/pwa/src/sw.tsmodified: confirmed- Commit
af78cccexists: confirmed git diff --diff-filter=D HEAD~1 HEAD: no deletions- Only
apps/pwa/src/sw.tschanged (git diff --stat= 1 file, 10 insertions, 1 deletion)