Repository navigation
fix(ui): keep startup and diagram assets within budget - #157161
Conversation
Restore Mermaid 11.17.2 and its lockfile graph to bring the deferred renderer below the existing 960 KiB gzip limit. Preserve the released v2026.9.6 diagram contract and opaque-frame sanitizer; Mermaid 12-only diagram and ELK capabilities are rolled back.
|
🦞👀 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: needs maintainer review before merge. Reviewed September 24, 2026, 12:38 PM ET / 16:38 UTC (Revision 8). ClawSweeper reviewWhat this changesThe branch restores the released Mermaid version for web and native diagrams, loads English Settings section labels with Settings, updates native license notices, and adds a required source to the PR wrapper inventory. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Current main still exceeds the reported renderer budget and keeps the Settings section labels in the eager catalog. The branch remains useful, and the earlier native notice finding has been resolved. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI and native chat use a shared Mermaid renderer to turn diagram source into sanitized images. Settings routes load translated section labels from the UI catalog before displaying headings or search results. flowchart LR
A[Chat diagram source] --> B[Pinned Mermaid renderer]
B --> C[Sanitized diagram]
C --> D[Web and native chat]
B --> H[Native license notices]
E[Settings route or search] --> F[Lazy English labels]
F --> G[Settings headings]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -711, Tests +58, Config 0, Other -1454. Total -2107 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the released renderer version and complete native notices within the existing budgets; revisit Mermaid 12 capabilities in a separately budgeted renderer update. Do we have a high-confidence way to reproduce the issue? Yes. Current main pins Mermaid 12 and the existing performance check enforces a 983,040-byte renderer limit; the PR records a pre-fix build above that limit. This read-only review did not rerun the build. Is this the best way to solve the issue? Yes. The branch restores the shipped renderer pin without raising budgets and uses the existing lazy Settings registrar while preserving translation keys and the shared English object. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 43d35bd4ca10. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@clawsweeper re-review The inspected, synthetic before-and-after Mermaid screenshots are now embedded in the PR body and were also delivered in the originating chat. Both images were verified to load on the public PR page. The same fenced source renders before and after, and both Show source → Show diagram roundtrips passed without page errors. The visible connector geometry difference is documented. Exact-head CI is green. The separate inherited registry lint failure was fixed on main by #157168; its original failed local check remains disclosed. |
|
🦞👀 Re-review progress:
|
* commit '02ad6b76b1a2ee2b414b170072e6e3e606fda3d4': (122 commits) fix(build): scope normalization declarations to package sources (#157174) fix: exit after validating Codex model references (#157323) fix(gateway): guard workspace adoption during active work (#157259) fix(update): rebuild stale Git runtimes when source is already current (#156996) fix: require a click before diagnosing failed updates (#157359) test(release): provide sealed artifact inputs to writer fixtures fix(ios): preserve chat state and adapt layout when iPad windows resize (#156683) fix(test): prepare native UI fixtures before compilation fix(test): await outbound delivery readiness before assertions fix: clarify deferred Codex catalog refresh warnings (#157352) fix(skills): refresh skills after watched directories are replaced (#156324) ci: reduce Node fixture overhead and defer seven release matrices (#157341) chore(test): stop Codex Computer Use and Signal batching tests flaking under load (#157334) fix(gateway): retain owned suspension status during restart (#157258) fix(ci): scope desktop status assertions to the selected worker chore(i18n): refresh native locales (#157337) test(daemon): use the native PowerShell probe budget (#157289) fix(exec): avoid gateway stalls during background task writes (#157177) test(cli): isolate preaction title setter state fix(test): synchronize Git backoff cancellation readiness (#157315) ...
|
Merged via squash.
|
* fix: keep Mermaid diagrams within the asset budget Restore Mermaid 11.17.2 and its lockfile graph to bring the deferred renderer below the existing 960 KiB gzip limit. Preserve the released v2026.9.6 diagram contract and opaque-frame sanitizer; Mermaid 12-only diagram and ELK capabilities are rolled back. * perf(ui): load Settings section labels with Settings * fix(native): align Mermaid 11 license notices * fix(ci): include plugin-state contract in PR wrapper --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
The Control UI exceeds its asset budgets after the Mermaid 12 upgrade and recent startup growth.
User Impact
Restores the diagram renderer used by the current stable release and loads Settings section labels only when Settings needs them. Settings labels stay unchanged. Mermaid 12's new diagram families and built-in ELK layout are deferred with the rollback to 11.17.2; diagram connector geometry can differ between these versions.
Why This Change Was Made
The isolated renderer serves Mermaid's complete classic bundle, which grew beyond its budget in version 12. Restoring the released pin brings it back under the existing cap. Moving section labels into the existing lazy Settings catalog also removes unnecessary startup bytes without changing translation keys or generated translations.
Original Evidence (
19d4df17, historical)src/infra/agent-run-registry.tshad 704 counted lines against its 700-line cap. That separate repair landed in refactor: share active run state precedence #157168. The final import-cycle check was not reached in that local attempt.19d4df173f0bc4844c850f1cc25b6490278ff76b. This receipt predates the native notice correction and main integration.Native Notice Correction
The Mermaid 11 source-map audit confirms that ELK and Chevrotain implementation code are absent from the restored classic bundle. The correction removes their two complete shared notice sections, four Android/iOS license files and two Android inventory expectations. All remaining license texts, including both DOMPurify versions, stay unchanged. No runtime production code changes.
Historical corrected-source validation passed at
492492ceebaaebd0e0554dda626b5a926b22ddc6:Focused iOS tests were not run on the Linux runner. The iOS resource-folder declaration, dynamic loader and existing tests were inspected; retained attributions are unchanged. These
492492cecomponent results remain historical. The integrated candidate preserves the Mermaid package/build inputs, native notice owners/tests/resources, Android Gradle inputs, dependency pins, and lockfile byte-for-byte. Main independently changed the English catalog; current-head CI below validates that integration.Evidence
Current head:
19c426e034f143afe5cf695b3f78033442230f6e. The prior signed integrationc02c3259incorporates pinned main02ad6b76, including the canonical release-artifact fixture repair3928d51b. The original 13-path product change is preserved.The current head adds one native wrapper inventory entry for the existing plugin-state contract. PR #157333 moved that contract into an eager worker import on main but omitted it from the wrapper's copied source inventory. The prior merged CI context exposed 12 failures across wrapper import, lease and refresh fixtures. This one-line packaging repair includes the contract without pulling in the intentionally lazy plugin-state implementation. Independent review and scoped P0–P2 autoreview found no actionable findings. The PR now changes 14 paths.
Prior integrated CI passed the changed product owners: all UI shards, the three Settings cold-loading cases, i18n, build artifacts and Android's whole third-party unit-test task. Strict gzip measurements were startup JavaScript 370,016 / 371,332 bytes, CSS 51,170 / 51,200, and Mermaid 974,554 / 983,040. The previously failing release-artifact suite also passed all 64 tests. Exact-head ClawSweeper found no actionable issue. Overall CI remained failed because of the wrapper inventory omission; those failures are not relabeled as passes.
Current-head CI passed at
19c426e034f143afe5cf695b3f78033442230f6e: 181 successful jobs and 9 intentionally skipped jobs. Its actual merged checkoutd3cf20e5includes the eager-import change and this inventory repair. The whole eager-import-closure suite passed 15/15 and operation-lock suite 146/146; main-refresh and worktree-provision are covered by the successful full CI inventory, without separately extracted file counts. All three UI shards, UI performance/i18n, build artifacts, Android's whole third-party unit-test task and iOS smoke passed. Current gzip sizes are startup JavaScript 370,049 / 371,332 bytes, CSS 51,170 / 51,200, and Mermaid 974,554 / 983,040. Exact-head ClawSweeper revision 8 reports no actionable findings, before-merge items, or rank-up moves. Native final qualification and merge remain pending.Visual Comparison
Inspected synthetic screenshots below use identical diagram source, a 1440 × 1000 viewport, and the light theme in the normal-built Control UI with its mock Gateway. Before: baseline
b078de41c413with Mermaid 12.0.0. After: published head19d4df173f0bwith Mermaid 11.17.2. Both render the four-node flowchart and preserve the exact source through Show source → Show diagram. Renderer requests returned 200 and both final captures had zero page errors. The small connector/layout difference is visible; this is one desktop flowchart comparison, not exhaustive diagram-family or native-app proof.