Repository navigation
fix(control-ui): keep sidebar pin and disclosure slots stable on reload - #190245
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. What this changesThis PR preserves pin-button geometry in cached sidebar rows while keeping pin actions disabled until live rows arrive. Example: Warm reload of a signed-in dashboard with a pinnable session.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open as the maintainer-authored, explicitly paused experiment. Current main still has the cached pin-slot omission; the focused patch has no concrete correctness finding. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI projects live session rows into a bounded IndexedDB sidebar snapshot, restores those rows during reload, and hands their presentation over to the live roster. flowchart LR
A[Live session roster] --> B[Sidebar row projection]
B --> C[Snapshot serializer]
C --> D[Scoped IndexedDB cache]
D --> E[Restored display rows]
E --> F[Sidebar renderer]
B --> F
Technical reviewBest possible solution: Retain the existing snapshot-based fix and let the declared experiment determine whether it should advance beyond draft. Do we have a high-confidence way to reproduce the issue? Source establishes the missing cached pin slot, and the body reports a baseline browser reproduction; this read-only review ran no target code. Is this the best way to solve the issue? The patch is a small, coherent extension of the existing presentation owner: serialize eligibility, restore display geometry, and preserve disabled cached actions without introducing another state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c15da4666d56. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +34, Other +2. Total +42 across 10 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 November 1, 2026, 5:56 AM ET / 10:56 UTC. |
c2999f5 to
a02435c
Compare
a02435c to
a72c90b
Compare
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. |
a72c90b to
e16bc34
Compare
Retain display-only pin eligibility in the bounded sidebar snapshot while cached rows keep actions disabled. Retire the previous disposable sidebar projection; no Gateway state or protocol changes. Prevent the 24 px aside expansion when the live roster replaces cached rows.
e16bc34 to
b358b10
Compare
…ad (openclaw#190245) Cached sidebar rows now keep the geometry of their live row while reconnecting. Previously the snapshot restored `pinnable: false` as live-action authority, so every eligible row's pin slot appeared 24 px late, and a collapsed pinned parent lost its child relationship, so its disclosure appeared late and moved the aside from right 6 px to right 34 px; together that shifted asides by up to 52 px and changed title truncation. The sidebar snapshot owner now retains two display-only facts: pin eligibility (encoding only the uncommon `false`) and the visible child count (omitted for private children). Cached pin and disclosure controls render in their final slots but stay disabled until the live row arrives; child rows and all actions remain live-only. Reader and writer share SIDEBAR_SNAPSHOT_PROJECTION_VERSION (3 -> 4), so old disposable sidebar records are dropped once after upgrade and refilled from the live roster. Proof: 11 interleaved AWS pairs per route plus A/A, real-Gateway warm reloads: max aside movement 52 -> 0 px and title movement 32 -> 0 px in 11/11 on chat and dashboard; snapshot +0.182%; CLS improved; timing secondaries within A/A. Runtime +13 LOC. Snapshot-owner and native warm-reload regressions fail before the fix. Exact-head CI green; full UI 887 pass / 2 fail, both reproduce on main.
What Problem This Solves
Fixes sidebar titles and action areas shifting during a signed-in warm reload of a chat or dashboard deep link: eligible rows gain a 24 px pin action, and a collapsed pinned parent gains a child disclosure that moves its action area another 28 px.
User Impact
Cached sidebar rows reserve their final pin and child-disclosure geometry from the first paint. Pin and child actions stay disabled until live row facts arrive. No child rows or child identities are fabricated from the cached count. The disposable browser projection advances once, from 3 to 4, so an older cached sidebar refills once after upgrading.
Why This Change Was Made
The existing sidebar snapshot intentionally restored
pinnable: falseto keep cached rows display-only (introduced in561d92da3a28, #168206). Rendering used that live-action authority to decide the pin's width. The same snapshot retained rendered children but lost a collapsed parent's known child count: restore derives child keys only from rendered child rows. Its disclosure therefore appeared only with the live roster. Pin eligibility depends on session lineage, not the hello catalog, owner filter or pin state.The snapshot owner now retains compact display facts for both controls, including recapture while live descriptors are pending. The native controls use those facts for geometry and stay disabled on cached rows. Child keys and action authority remain live-owned. The renderer replaces the presence-only child memo with one count derivation, and snapshot reader/writer share one projection-version constant. No new store, config, server schema or protocol changes.
Evidence
Final head
b358b103bba525784e4788948dd2897f54ce2d77against main72a691e5f732b04a53ffd9e83f96a61bc16d2016. AWSc7a.4xlarge, leasecbx_89e1e442999b, run. Both arms and A/A controls run on the same quiet instance, using repository Playwright Chromium, unprofiled.The real-Gateway fixture uses signed-in HttpOnly proxy admission, native protected-entry reloads, an isolated Gateway and QA loopback model, 3,000 synthetic sessions, archived target sessions, personal pins and collapsed pinned parents. Sidebar preferences match the reported shape: Involving me, category, Created, five collapsed sections, preview off, empty groups always, 97 groups / 102 section-order entries. No live operator state or private captures are used.
Geometry gate
A/A reproduces 24 px pin width, 28 px disclosure offset and 52 px maximum aside movement in every pair on both routes. Candidate title-box movement is also 32 → 0 px in every pair. Referencing geometry at the first app candidate compositor frame yields the same 52 → 0 px result on all 22 candidate reloads.
Actual native sidebar record: 176,690 → 177,012 bytes (+322 / +0.18224%) on both routes, under the +1% cap. Team-scale model: 139,560 → 139,587 bytes (+27 / +0.01935%).
Timing secondary IQRs overlap and pair signs are mixed. For example, chat hello has a +25.6 ms median paired delta (6/11 worse), versus +29.3 ms in A/A (7/11 worse); chat sidebar fill is +24.7 ms (7/11 worse), versus +37.1 ms in A/A (9/11 worse). No secondary crosses the declared regression rule. These data support a geometry fix, not a wall-clock speedup claim.
Real-Gateway timing controls
Eleven interleaved AB/BA warm pairs on each route plus eleven A/A pairs. Median [Q1, Q3], milliseconds except CLS.
hellois after connection-owner hello handling.paintedRowsis native Element Timing;finalRowsandsidebarFillare DOM milestones, not paint timestamps. PaintHolding calibration passed. Full per-frame geometry reports and the before/after first app compositor captures are retained locally. The remaining remote raw frames were lost during the fresh-checkout main control setup; the reports and measurement results were already downloaded.Every paired delta (candidate minus baseline)
aa-chat / candidate
aa-dashboard / candidate
ab-chat / candidate
ab-dashboard / candidate
Team-scale bench
Eleven baseline/candidate/baseline triples per route, live-fast latency profile, warm reload, external LoAF and RPC probes. This uses production UI bundles with synthetic RPC; the real-Gateway results above independently cover live admission and roster settlement.
candidate-2is the A/A baseline repeat. The bench exposes native painted transcript rows on both routes, but no final-row DOM timestamp.Every paired delta (candidate minus baseline)
chat / candidate
chat / candidate-2
dashboard / candidate
dashboard / candidate-2
Native regressions and validation
The snapshot-owner regression checks eligibility and collapsed disclosure through structured cloning, restore and recapture without restoring mutation authority or inventing loaded children. The native warm-reload regression covers a collapsed pinned parent on chat/dashboard, unchanged and changed rosters, disabled cached disclosure clicks, and all row-aside rectangles through live settlement. Both regressions fail on baseline and pass on the candidate; the disclosure regressions also fail on the pin-only head. Existing expanded-child and live-row behavior remain covered by the full UI suite.
Exact-head CI is green. Focused unit tests: 99 passed. All 3 native warm-roster cases passed (Vitest duration 43.54 s). Baseline owner and native regressions fail for the missing display facts; the disclosure regressions also fail on the pin-only change. Focused lint passes.
Measured wall times for
pnpm test <file> --maxWorkers=1on the AWS lease:ui/src/components/sidebar-snapshot-model.test.tsui/src/pages/chat/sidebar-snapshot-store.test.tsui/src/pages/chat/session-snapshot-store.test.tsui/src/components/app-sidebar-session-row-render.test.tsxThe required full UI invocation ran once on the final head:
892 spec files: 887 passed, 2 failed, 3 skipped. 3,379 tests: 3,373 passed, 2 failed, 4 skipped. Vitest duration: 3,412.31 s. The complete file inventory and log are retained locally. Both failures reproduce against the exact pinned main source in the main control run, on the same AWS lease, after reversing the complete PR and rebuilding main. The control restores the exact candidate source and verifies a clean tracked tree afterward.
ui/src/e2e/chat-outbox-migration.e2e.test.ts:71extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts:315Existing skipped specs:
desktop-resize.real-gateway,chat-steer-deferred-custody.real-gateway, anddeepseek-search.real-gateway. One existing creator-review case is also skipped. This diff adds no skips or expected failures.Changed-file validation passes its core/UI typechecks, lint, formatting, controllers and ratchets. Its sole failure is the unused export
src/infra/sqlite-native-runtime.ts: assertSafeSqliteRuntimein the production and full-tree Knip scans. The canonical unused-export check reproduces that exact finding on pinned main (exit 1, 106.75 s); the script scan passes. All three control commands return exit 1 for their matching inherited failures. These unrelated owners are unchanged.The measurement/full-suite run completed its validation, but its final archive command exited 1 because it created an archive inside the directory being archived. A subsequent fresh-checkout control setup removed that remote scratch directory. The already-downloaded full geometry reports, benchmark summaries, full-suite log, focused logs and inspected before/after captures remain intact; remaining raw frames were lost. The corrected control archive was written outside its source directory, downloaded and verified before releasing the lease.
Synthetic before/after
Inspected complete captures, synthetic data only. These are actual first app candidate compositor frames, not an old surface held across navigation. Geometry is supported by the per-frame rectangles and baseline-red native regression, not inferred from a still image.
Size and review
+13 net runtime LOC, including +7 for disclosure. Required filtered stat: six files, 24 insertions / 9 deletions (+15, including two allocation lines). The growth retains two previously missing display facts while preserving live-only actions; the old presence-only child memo and duplicated version literals are removed. Test growth is exactly 78 lines, explicitly allocated to owner/recapture and native warm-reload regression coverage in existing fixtures, without baseline slack. No changelog edit; this body provides release-note context.
Codex autoreview is clean through P2. Earlier CI caught an unnecessary boolean comparison and JSON deep-cloning in the cache tests. The test-only corrections use negation and the cache’s native structured cloning, were independently re-reviewed, and were pushed. No CI rerun was used to chase green. Final CI and full UI results are listed above. This PR is ready for the campaign lead's review and is not merged.
All five task-owned AWS leases are released (
cbx_5928f9c6f5da,cbx_a124bc76574f,cbx_43739e00e65b,cbx_fdf2119341a6,cbx_89e1e442999b). The final lease release is verified by coordinator state. Test-owned Gateways are stopped; no operator Gateway was used.