Repository navigation
perf(workboard): reduce per-card observer and listener overhead - #183763
Conversation
Keep status dismissal listeners only while open or hover-pending, and share popover positioning listeners within each document. Pool label resize observation while retaining the existing measurement frame batch. Preserve pending-hover dismissal and native popover behavior. Cover independent retirement and idempotent label cleanup after a newer sibling pool is created. Source reviewed at P0-P2 with no actionable findings. Runtime, type, lint, build, and performance validation remain held for the coordinated proof run.
Target the inert board-name span for pointer parking and cancellation proof. Retain native Chromium exit receipts without replacing a primary close failure.
Share label resize observations and retain global positioning and dismissal listeners only while needed. Preserve native popover cancellation, placement, and independent target cleanup. Keep mobile resource proof touch-enabled.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR shares Workboard label observers and registers shared popover listeners only while needed. Example: Open a Workboard containing 1,000 labeled cards on desktop.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it delivers a substantial resource reduction on large Workboards, and the reviewed diff introduces no concrete correctness or security defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe bundled Workboard plugin renders Gateway card and session data in the Control UI; browser resize, pointer, scroll, and keyboard events drive label layout and popover presentation. flowchart TD
A[Gateway card and session data] --> B[Workboard Solid cards]
B --> C[Shared label observer]
C --> D[Existing batched label measurement]
E[Browser input and viewport events] --> F[Active popover environment]
F --> B
D --> B
Technical reviewBest possible solution: Retain the shared resources in the existing Workboard presentation owners and land after required CI completes. Do we have a high-confidence way to reproduce the issue? Current-main source allocates observers and global listeners per mounted card, matching the supplied 1,000-card browser measurements; no target code was executed during this read-only review. Is this the best way to solve the issue? The change removes repeated native registrations at their existing owners, preserves label batching and dismissal policies, and keeps plugin code within its public integration boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8f4fe7407101. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +189, Tests +257, Other +1049. Total +1495 across 12 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 25, 2026, 2:30 PM ET / 18:30 UTC. |
Preserve both resource scenario families and native service-worker bypass guards. Use the shared event-and-phase listener counter from main for Workboard diagnostics; production components and tests are unchanged.
Assert disposal of the mounted Memory stylesheet handles, and pause the real desktop section animation at creation without changing process animation counters. Wait for chat route readiness before native focus activation. Share a bounded foreground-readiness wait for the cold hovercard and nested task PR metadata while retaining authority and metadata assertions.
Preserve both Workboard and heavy-content fixture options while integrating current main. Workboard runtime and repaired E2E sources remain unchanged. The prior exact-head dispatch stopped before tests because GitHub retained the earlier PR merge ref.
|
Merged via squash.
|
…claw#183763) * perf(workboard): share card observers and popover listeners Keep status dismissal listeners only while open or hover-pending, and share popover positioning listeners within each document. Pool label resize observation while retaining the existing measurement frame batch. Preserve pending-hover dismissal and native popover behavior. Cover independent retirement and idempotent label cleanup after a newer sibling pool is created. Source reviewed at P0-P2 with no actionable findings. Runtime, type, lint, build, and performance validation remain held for the coordinated proof run. * fix(workboard): declare modal action element for JSX * test(workboard): hover cards before native menu proof * test(workboard): isolate browser resource observations * test(workboard): scope popover resource assertions * test(ui): repair neutral workboard resource interactions Target the inert board-name span for pointer parking and cancellation proof. Retain native Chromium exit receipts without replacing a primary close failure. * test(ui): stabilize asynchronous E2E readiness Assert disposal of the mounted Memory stylesheet handles, and pause the real desktop section animation at creation without changing process animation counters. Wait for chat route readiness before native focus activation. Share a bounded foreground-readiness wait for the cold hovercard and nested task PR metadata while retaining authority and metadata assertions.
What Problem This Solves
Large Workboards retain thousands of global listeners and roughly one label ResizeObserver per card, even with their popovers closed.
User Impact
A 1,000-card Workboard keeps far fewer observers and global listeners while preserving menus, status popovers, and label overflow. Event-dispatch script CPU improved by 3.70% in the measured desktop workload; this is not an overall latency claim.
Why This Change Was Made
Share label observations per document while retaining the existing batched measurements. Register shared positioning and dismissal listeners only while a popover is open or a hover deadline is pending, then release them when the last consumer retires. Native cancellation, placement, and independent target cleanup remain intact.
Evidence
Runtime evidence compares native Workboard source from
ce3e893fcc72and9af2f95d4354. Desktop counts use the retainedce96af7ffd30harness; desktop CPU and desktop screenshots usee93ef0f0112. Corrected touch-enabled mobile counts and screenshots use measured harness2750a6d4d04a; the complete plugin source, compiled generations, and asset hashes match the earlier runtime pair. These are production renderers with synthetic Gateway data, not real-Gateway latency measurements. Retained pre-integration shipping-byte checks compare39ceca404cecwith2750a6d4d04a.Integrated
mainat3c4d8d99cfc5after the Browser resource lane landed. The resolution preserves both scenario families and mobile context options, combines their native service-worker bypass guards, and adopts main’s generic event-and-phase listener counter. Workboard diagnostics now consume that existing counter; the older scalar projection is gone. Workboard production and test sources, and the observation-browser helper, are byte-identical to the measured head. The four-file integration delta passed a separate independent review, scripts types, scoped lint, and formatting. The integrated head's full CI run passed its UI unit shards and performance check, but three E2E assertions failed. The follow-up below changes only those tests; the Workboard runtime remains byte-identical. Retained evidence is labeled by its tested head.The CI follow-up keeps the original behavior contracts: Memory records the mounted stylesheet handles and verifies those exact nodes detach; Session Details pauses its real body animation at creation while preserving the row/envelope counters; task PRs wait for the existing chat-route readiness before focus and use a named 30-second foreground-card and metadata wait within the existing 120-second test limit. The task CI trace spent 16.278 seconds in branch-cache work before metadata started, beyond the earlier 15-second poll. Nested PR metadata and authority assertions remain intact.
No inherited-failure exemption is claimed. Memory passed on both base
3c4d8d99cfc5and runtime head413b6af24675; baseline Session attempts hit Chromium context-creation crashes, while the baseline task-PR retry timed out earlier waiting for its focus-opened hovercard. The repaired tests passed focused types, lint, formatting, and a complete independent P0–P2 review. The final focused local attempt passed the owned-stylesheet test. Session Details stopped at a Chromium context-creation SIGSEGV before its assertions. The task-PR card wait hit its old 10-second limit; retained diagnostics then showed the card visible at 11.38 seconds, with focus and foreground acknowledgement intact. The final one-line follow-up applies the same 30-second readiness bound to that card wait. It has fresh types, formatting, lint and independent review; it is not claimed as a passing local browser replay. Replacement-head CI completed successfully on82cc36ecf109: 49 jobs passed, 24 were skipped, and none failed. The latest normal main merge at82cc36ecf109preserves every Workboard runtime, fixture, and repaired E2E file byte-for-byte. It only composes main’s heap/heavy-content harness additions with the Workboard scenario flags. This two-file integration passed scripts types, scoped lint/format, and a separate independent P0–P2 review with no actionable findings. The previous manual CI dispatch stopped before tests because GitHub retained a stale PR merge ref; a normal main merge and push triggered fresh PR CI on82cc36ecf109. Its exact-head preflight passed, confirming the fresh run accepted the PR identity; the complete run is now green.82cc36ecf1091d86233138408d462ba8941f3658/9141755ddadb3ad69fd123f4bc46f05a4aeba93a2750a6d4d04a/39ceca404cecindex.lock. The coordinator removed that empty orphaned lock; fresh native initialization, PR-head checkout, and exact-head artifact validation then completed successfully. Historical local test failures remain recorded in the validated review. The earlier auto request was confirmed cancelled, so landing uses reviewed replacement recovery.82cc36ecf109(observed 2026-10-25 21:17 UTC): 49 jobs passed, 24 skipped, zero failures. All 3 UI unit shards, all 7 Control UI E2E shards, both real-Gateway shards, performance, preflight, security-fast, and PostgreSQL conformance passed;ci:fullretained. The separate browser-extension job was skipped; the run does not claim coverage beyond its selected jobs.413b6af24675)2750a6d4d04a)ci:fullinventory retains its explicit WebKit/release-only exclusions; other jobs were still finishing at this observation.2750a6d4d04apassed with no findings; the integration preserves all runtime sourcesThe event-dispatch improvement is modest. Remount task CPU changed +0.68% median / +1.81% p95 and wall time +0.98% / +2.26%. The shared host load was about 21–46; another lane's closeout unexpectedly installed cached dependencies for a reported 9.6 seconds, with exact overlap unknown. All 80 A/B and 40 A/A observations are retained without adjustment or exclusion. The corrected mobile pair proves counts and behavior only; it makes no timing claim. All captured browser identities retired, with no remaining or unknown identities.
Idle observations are descriptive single samples, not an energy claim. Visible interrupt wakeups were 193 → 197 on desktop and 230 → 354 at mobile width; both had zero package-idle wakeups. The native idle path and historical narrow-screen captures use mobile width without touch emulation. All four hidden wakeup totals remain unknown. The three recovery cells repeat only setup failures after adding Workboard to the existing service-worker bypass guard; the original failures remain retained.
The older
e93ef0f0112mobile counts and screenshots also used a 390 × 844 desktop context without touch emulation. They remain historical evidence and are not relabeled. The corrected mobile pair checks actual renderer capabilities, preserves the same native plugin generations, and supplies the mobile screenshots below. Earlier full-Chromium shutdown crashes and fixture setup failures remain separate failed attempts.Against integrated main across the 13 changed paths, runtime LOC is 735 → 923 (+188); tests 1,987 → 2,259 (+272); measurement harness 3,786 → 4,719 (+933); type/baseline support 17 → 18 (+1). Total scoped LOC is 6,525 → 7,919 (+1,394). The three CI test repairs add 15 net lines. The additional runtime code replaces per-card resource ownership; the fixture covers distinct native cancellation, positioning, cleanup, CPU, and idle paths.
Release-note context: reduce Workboard card observer/listener overhead while preserving menus, status popovers, and label overflow.
Screenshots