Repository navigation
fix(ui): read the live sidebar roster during cache handoff - #170708
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
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. |
There was a problem hiding this comment.
💡 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".
| await expect | ||
| .poll(async () => { | ||
| await vi.advanceTimersByTimeAsync(500); | ||
| return disconnectedLabel.classList.contains("hover-marquee--scrolling"); | ||
| }) | ||
| .toBe(true); |
There was a problem hiding this comment.
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 👍 / 👎.
|
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. |
…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.
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
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.