Skip to content

fix(ui): read the live sidebar roster during cache handoff - #170708

Merged
steipete merged 2 commits into
mainfrom
dbasync/redmain-sidebar-live
Oct 13, 2026
Merged

steipete merged 2 commits into
mainfrom
dbasync/redmain-sidebar-live

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The cached sidebar briefly erased every session row while switching to live data, even though the final list, selected rail item, and agent cards were correct. Scheduled main run 38352378612, job 115147563472, caught the empty intermediate list in the unchanged cold-load no-flicker test.

The regression followed 1e157e0 (#170625): roster notifications began scheduling the parent sidebar first, but the parent still consumed a roster copy published in the child's later render. Cache release used the current roster owner while row projection used the stale copy.

The row projection now reads the roster owner synchronously and memoizes by result, agent IDs, and collapse presentation state. The child publishes only its collapse state. This deletes the stale result/agent copy, preserves coalesced rendering, and adds no readiness latch or duplicate check.

Evidence

  • Existing regression: ui/src/e2e/sidebar-cold-load.e2e.test.ts, “restores the sessions view and pinned rail before hello through late counts and plugins”. The original assertion and fixture are unchanged; blob 00389c0e7f69d5ce7ec0803509f93a2accee46e8 matches the failed scheduled head.
  • Changed-file oxfmt, oxlint, and git diff --check passed. One isolated Codex autoreview completed scoped-clean for P0–P2. The original unchanged cold-load case passed on candidate 294f20f in hosted run 38356076249/job115159173905: 4.773 seconds for the case, 23.80 seconds for the filtered file (one pass, one intentionally filtered case). Its source guard and post-run unchanged-source check passed.
  • No local tests or broad scans; no SQL harness. This is a UI state-ownership repair with no SQL, schema, SDK, T1, or warmed-path statement/request claim.

Size: two production files, +23/-22 lines, plus a test-only follow-up (+11/-4). No security or authority checks removed. No added dependency, settings, or visual design change.

The first PR CI run (38354699175, job 115155053739) failed the unchanged hover-marquee reconnect test once: computed horizontal transform remained 0 until the default polling deadline. The exact original case subsequently passed on both direct base 03fb581 and candidate 294f20f in hosted run 38356084768 (1278ms and 1273ms respectively). That is non-reproduction, not evidence of an inherited failure or a proven repair of its original cause.

A test-only follow-up controls the existing 500ms reveal delay with fake timeout APIs and removes its 650ms real sleep. It waits for the scrolling state while browser visibility/layout callbacks remain native, then retains the original computed DOMMatrix transform < -1 assertion. No timeout is increased, no production code changes, and the browser geometry and CSS transition are still exercised.

Changed-file formatting, lint and git diff --check passed. No local test or broad scan was run. One incremental isolated Codex review completed scoped-clean for P0–P2 (second and final review round for the PR). Hosted verification of the revised fixture remains pending; do not treat the passing original base/head replay as proof of this later change.

Final candidate 67ca1c55e85be01334cf0165271e5adcd394ed63: ordinary CI 38357112216 passed all three UI shards and selected UI E2E. The changed marquee file passed both cases; the reconnect case took 185 ms (job 115162807105). T1 remained 454, compatibility calls 9, and dialect findings 0.

Review follow-up: replacing the browser assertion poll with an explicit visibility/layout completion signal is a test-determinism improvement, not a demonstrated product, data-loss, or security defect. The fixture still waits on native browser callbacks and retains the native transform assertion. Record stronger synchronization as a follow-up under the relaxed landing policy; no new production test hook is added. The original intermittent failure remains unproven, although both original base/head replays and the revised candidate pass.

Read live roster data directly from its owner when projecting sidebar rows. Keep only collapse presentation state in the child so parent-first coalesced updates cannot briefly render an empty stale roster after releasing the cached snapshot.
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T06:34:49.656353Z 67ca1c5 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67ca1c55e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +68 to +73
await expect
.poll(async () => {
await vi.advanceTimersByTimeAsync(500);
return disconnectedLabel.classList.contains("hover-marquee--scrolling");
})
.toBe(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace reconnect polling with deterministic synchronization

This newly added expect.poll loop violates the repository’s explicit prohibition on polling in new or changed tests. Because the condition depends on native visibility/layout callbacks, retry count and elapsed time vary with browser scheduling; await an explicit layout/visibility completion signal, then advance the fake clock once and assert directly.

AGENTS.md reference: AGENTS.md:L88-L88

Useful? React with 👍 / 👎.

@steipete

Copy link
Copy Markdown
Contributor Author

The polling suggestion is a test-determinism improvement rather than a demonstrated P1 product, data-loss, or security defect. The changed fixture controls the reveal timer while native visibility callbacks, layout, and the final transform assertion remain real. Both changed-file cases pass on the final head (reconnect: 185 ms). Stronger explicit synchronization is recorded as a follow-up under the relaxed landing policy; the original intermittent failure remains unproven.

@steipete
steipete merged commit 4ef51a7 into main Oct 13, 2026
97 of 100 checks passed
@steipete
steipete deleted the dbasync/redmain-sidebar-live branch October 13, 2026 06:42
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…enclaw#170708)

Read the live sidebar roster at the parent render boundary instead of a child-published copy, retaining collapse state publication. This removes the transient empty restored-session projection.

The unchanged original cold-load regression passes, and all selected final-head CI checks pass. Stabilize marquee reveal timing with the existing fake timer while retaining native transform assertions; its original intermittent failure remains unproven. Stronger deterministic browser synchronization is a recorded review follow-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant