Repository navigation
fix(ui): avoid native notification downloads in browsers - #138541
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 4:58 PM ET / 20:58 UTC. ClawSweeper reviewWhat this changesThe PR defers the native notification bridge until a WebKit host exposes its notification handler, updates the generated boot-module manifest, and adds browser/native-host bootstrap coverage. Merge readiness⛔ Blocked before merge - 3 items remain Keep open. Current main still eagerly imports and constructs the native notification bridge for browser startup; this branch fixes that boundary. No P0–P2 functional or security defect was found, but the new lazy import needs the repository-required runtime-module boundary and exact-head CI is still incomplete. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI boot sequence prepares host-specific capabilities before routing and Gateway startup. Native notification state is then consumed by the chat-send and Settings flows, while ordinary browsers use Web Push instead. flowchart LR
A[Browser or WebKit host] --> B[Control UI bootstrap]
B --> C{Notification handler present?}
C -->|Yes| D[Load native notification bridge]
C -->|No| E[Skip native bridge]
D --> F[Gateway and routing startup]
E --> F
F --> G[Chat send and Settings]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +17, Tests +162. Total +179 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Move the lazily loaded notification implementation behind a Do we have a high-confidence way to reproduce the issue? Yes, from source: current main statically imports and constructs the native bridge during all Control UI bootstraps, and the generated shared boot manifest includes it. The supplied source E2E also defines the browser-versus-native-host scenario, though it was not executed in this read-only review. Is this the best way to solve the issue? Yes, with one correction: bootstrap is the correct owner because a handler check inside the capability would still download and evaluate it. The lazy implementation should use the required Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f14b1027271c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
975cb61 to
b5e576a
Compare
|
The exact reviewed head For the P3 naming recommendation, retain the existing The full refreshed five-file independent P2 review is clean, all 85 focused owner/caller tests pass, and all five candidate files are byte-identical across the required refresh to inherit the already-landed settings-test repair in #138482. Production delta remains +18 lines for conditional initialization and lifecycle ownership. No translation data, notification policy, budget, assertion, or timeout was weakened. Proceeding through native prepare and merge; this records the maintainer decision and review follow-through, not a completed merge. |
|
Merged via squash.
|
…8541) * perf(ui): defer native notification bridge loading * test(ui): serialize native notification source proof * test(ui): type injected proof on browser window
What Problem This Solves
Browser startup loaded the native desktop notification bridge even though that capability only exists in a WebKit host. The unchanged startup-size guard was already failing on the translation PR's base; the generated native translations do not enter the Control UI bundle.
Why This Change Was Made
Load the notification capability only when the native host exposes its message handler. The existing startup lifecycle awaits initialization before Gateway/routing, fences an aborted import, and owns disposal. Native permission requests remain synchronous in the Send gesture, and notification messages and policy stay unchanged.
This follows the adjacent native-device-settings startup path. The 18-line production increase provides the conditional import, readiness, and cleanup boundary without adding a loader framework, option, dependency, or budget change. The test and test-support delta is +162 lines; the generated manifest delta is one removed line.
User Impact
Browsers download less startup JavaScript. Native notification permission and background-completion behavior retain their existing owner and interface.
Evidence
Windowtype. Extendingtypeof windowresolves the reproduced diagnostic; only the erased annotation and formatting changed, with the same message and gesture assertions./newand/chatcapture tool. Current main already contains the neighboring graph maintenance; this diff removes the native parser from shared browser chunks.The owned Testbox needed the existing browser setup helper to provision recording and pinned Chromium artifacts. Final commands passed; the lease was stopped after collecting evidence. The screenshots show the synthetic browser before Send and the native-host exchange after completion.
Local full type checks could not use the borrowed worktree dependencies: fs-safe 0.5.6 differs from the pinned 0.7.2, and installed grammY types and Mermaid/Pako declarations lag the checkout. Exact-head hosted CI remains the landing gate.
The final CI run inherited the older settings-layout cold-boot test and recorded idle script failures during document replacement. Refreshed onto main to inherit the existing repair in #138482, which keeps each observed document alive and retains all genuine network/error assertions. The old log contains URLs only, so the precise transport error was not recovered. All five candidate files are byte-identical across this required refresh; the new exact-head CI remains the landing gate.
The wider notification-delivery feature in #133164 overlaps this startup owner and should retain this host-conditional loading boundary when refreshed. This PR changes no delivery policy or protocol.