Repository navigation
fix(ui): keep logs following after row resize compensation - #188617
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 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 changesRead back the actual Logs scroll offset after retrying row-height compensation so subsequent measurements preserve following. Example: Several visible rows grow while following a 500-row Logs stream.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused correction to Logs scroll compensation that current main still needs; no definite introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI Logs page supplies retained entries to LogsView, which uses TanStack Virtualizer and the shared layout scheduler to render measured rows and maintain the viewport. flowchart LR
A[Gateway log entries] --> B[Logs page retained buffer]
B --> C[LogsView]
C --> D[TanStack Virtualizer]
D --> E[Measured rows and spacer]
E --> F[Browser scroll offset]
F --> D
Technical reviewBest possible solution: Keep the existing virtualizer as the scrolling owner and synchronize its offset immediately after post-commit compensation. Do we have a high-confidence way to reproduce the issue? The source exposes the stale-offset path and the contributor reports a base-failing regression; exact-head CI independently demonstrates unresolved Logs following, but this review ran no reproduction. Is this the best way to solve the issue? The patch is the smallest focused correction using existing owners: it reuses the observer callback, preserves scrolling state, and adds no parallel state or production test seam. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f9b9af087c59. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource 0, Tests +127, Other +2. Total +129 across 3 files. Added test files: 0. View PR surface stats
Review metrics
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 October 30, 2026, 3:06 PM ET / 19:06 UTC. |
Apply pending append and trim anchors after Solid commits the published spacer and keyed row window. Keep actual offset readback ahead of later row measurements so auto-follow survives an in-flight response while hidden. Cover the hidden append with a real visibility owner and suspended RAF. The exact prior head fails the newest-row assertion; the repaired view and LogsPage tests pass 23/23. UI types, scoped lint/format, production Knip and the test-line ratchet pass. Independent P2 review found only the old index snapshot defect; staging this complete tested tree resolves that finding.
…-compensation-readback
|
Merged via squash.
|
…188617) * fix(ui): keep logs following after row resize compensation * fix(ui): settle log compensation before queued measurements * test(ui): await resized transcript and stable picker targets * fix(ui): apply log append anchors after layout commits Apply pending append and trim anchors after Solid commits the published spacer and keyed row window. Keep actual offset readback ahead of later row measurements so auto-follow survives an in-flight response while hidden. Cover the hidden append with a real visibility owner and suspended RAF. The exact prior head fails the newest-row assertion; the repaired view and LogsPage tests pass 23/23. UI types, scoped lint/format, production Knip and the test-line ratchet pass. Independent P2 review found only the old index snapshot defect; staging this complete tested tree resolves that finding.
What Problem This Solves
Logs can stop following new entries when wrapped rows resize before their compensation scroll is reported, or when an in-flight poll finishes while the tab is hidden. Auto-follow stays enabled while the viewport remains near the previous end.
User Impact
Appended logs remain reachable and continue following when the user returns to the tab. Reader wheel, touch and keyboard input retains control of the viewport. No configuration or migration is needed.
Why This Change Was Made
The virtualizer's append/trim anchor was applied before Solid committed the new spacer and row window, so its end command used the old DOM scroll maximum. Normal animation-frame reconciliation could correct that target, but a hidden tab can suspend frames beyond the library's five-second reconciliation lifetime. The existing post-layout owner now applies the anchor after the published window commits. Its memoized height and key-extractor identity cover both size changes and same-height trims without adding a second follow-state owner.
After compensation, the same owner reads the actual scroll offset through the existing observer before another row measurement can consume the previous offset. The existing Subagents test repair polls its original containment inequalities until ResizeObserver publishes the narrowed transcript width; it retains the scrolling and readability assertions.
Evidence
cb9b34c393ecfs-safe0.26.14 install to the already-declared 0.26.15 before the typecheck recheck. The test's deliberate frame-callback snapshot has an explained lint exception.pnpm deadcode:knippasses.d1e8dfbc1a44: 6,313,957 lines / ceiling 6,346,002, with 32,045 lines of headroom. Allocation 281 matches net growth: Logs 277 + Subagents 4. Main’s measured-headroom repair (#188780) was merged after the previous CI run failed this gate; the four authored files remain byte-identical to the reviewed and locally tested candidate.findings, notscoped-clean.cb9b34c393ecfailed the WebKit 1440 px initial-newest-row wait and Quiet automation'supdatedAtequality. Both exact names passed scheduled main 41123124777; neither failure is claimed inherited. Both pass in the final exact-head CI below.d1e8dfbc1a44. No CI rerun was used.The subsequent CI run 41139455866 on
50637db91256passed the UI E2E and real-Gateway jobs and failed only the test-line ratchet. The finald1e8dfbc1a44head incorporates #188780 and passed exact-head CI. Native completed-evidence recovery merged it as769373dc062a9ce083c6ca34a352d179391ce192; native closeout completed.The hidden-append regression proves a reachable bug independently of the earlier WebKit CI failure. An unchanged source-Vite replay of that WebKit case passed once on
cb9b34c393ec; it does not establish shipped-bundle equivalence or explain the CI failure. No timing improvement is claimed. The final follow-up did not run another local build or E2E suite; full replacement-head CI covers the affected browser contracts, including reader takeover and retained-size trimming.Earlier same-machine production builds measured startup JS gzip 88,757 → 88,753 B for the original repair and 88,753 → 88,754 B for the scheduling repair. Startup CSS remained 33,559 B with 3 JS / 1 CSS requests. These are the retained build measurements from those revisions, not a fresh final-head build claim.
The complete focused delta remains four files, +319/−28 lines. Logs production is 408 → 416 LOC; its test is 138 → 415 LOC. The Subagents test adds four net lines. Solid refactor counts remain zero for feature effects, render effects, untrack, direct listeners, DOM queries, flush, owner APIs and component cleanup; memo count is 9 → 10, with two existing layout-measurement owners unchanged. No dependency declaration or performance budget changes.
The byte-identical screenshots show the normal settled synthetic Logs state; the behavioral regressions establish the interaction repair.