Skip to content

fix(ui): keep logs following after row resize compensation - #188617

Merged
steipete merged 8 commits into
mainfrom
fix/logs-compensation-readback
Oct 30, 2026
Merged

steipete merged 8 commits into
mainfrom
fix/logs-compensation-readback

Conversation

@steipete

@steipete steipete commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Check Result
Original resize-compensation regression The base moves scrollTop 21,716 → 21,669 on the next resize; the repair preserves the end position. Both direct and already-queued resize schedules are retained.
Hidden in-flight append on exact cb9b34c393ec Intended red: after 5,145 ms and exactly two requests, row 1,000 is absent; visible rows remain 482–507 (top 21,582 / height 44,252 / viewport 634). The real visibility owner stops hidden polls and issues one catch-up request.
Candidate Logs view and page tests 23/23 pass in one run, including both resize schedules, the hidden append, initial loads, request ownership, quiet serialization, filters and explicit re-enable-follow behavior.
UI types, scoped lint and formatting Pass. A frozen install corrected a stale local fs-safe 0.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.
Production unused-code check Canonical pnpm deadcode:knip passes.
Native test-line ratchet Pass on 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.
Independent P2 review Three passes completed. One finding identified the old index snapshot's pre-publication anchor application; the candidate fixes that finding. No additional P0–P2 defect was established. The review status was findings, not scoped-clean.
Prior integrated-head CI Run 41127778122 on cb9b34c393ec failed the WebKit 1440 px initial-newest-row wait and Quiet automation's updatedAt equality. Both exact names passed scheduled main 41123124777; neither failure is claimed inherited. Both pass in the final exact-head CI below.
Final exact-head CI CI 41144405917 and Workflow Sanity 41144405868 both passed on d1e8dfbc1a44. No CI rerun was used.

The subsequent CI run 41139455866 on 50637db91256 passed the UI E2E and real-Gateway jobs and failed only the test-line ratchet. The final d1e8dfbc1a44 head incorporates #188780 and passed exact-head CI. Native completed-evidence recovery merged it as 769373dc062a9ce083c6ca34a352d179391ce192; 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.

Before: settled synthetic Logs view

After: settled synthetic Logs view

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 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-30T23:27:33.937444Z d1e8dfb 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.

@steipete
steipete enabled auto-merge (squash) October 30, 2026 18:59
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Read 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.

  • Before: The reported regression moves scrollTop from 21716 to 21669 on the next resize and loses the tail.
  • After: The added regression preserves forward position and reaches the newest row after appending to 1,000 rows.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The correction is focused and source-supported, but the failed browser scenario limits validation confidence.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected screenshots show settled Logs, while the reported regression exercises the real view with simulated browser geometry.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Logs can stop following new entries after visible rows change height.
Reason: The maintainer-authored direction restores existing behavior with a narrow correction and preserves the established scrolling owner.

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
Reviewed head: 11e825c781e4f3c363d2f2813e33bfc76b5734f4

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported local browser pass is contradicted by exact-head mobile WebKit initial-follow failure; baseline or head-versus-revert evidence is needed to attribute it.
Agent review details

How this fits together

The 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
Loading

Technical review

Best 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

  • Logs offset observation and post-commit compensation keeps the original intent (516bbeb: Keep newest rows reachable while preserving reader intent and retry compensation after Solid commits the spacer.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source 0, Tests +127, Other +2. Total +129 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 8 8 0
Tests 1 127 0 +127
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 3 137 8 +129

Review metrics

Metric Value Why it matters
Production versus test growth Production +8/-8; tests +127/-0 Production remains the same size; the added test exercises a distinct resize/event-ordering failure through the real view and virtualizer.

Labels

Label changes:

  • add P2: Loss of Logs following disrupts live diagnostics but does not establish lost log data or a blocked core workflow.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Loss of Logs following disrupts live diagnostics but does not establish lost log data or a blocked core workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attribute the exact-head failed checks using baseline or head-versus-revert evidence, especially mobile WebKit initial following.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 3:06 PM ET / 19:06 UTC.

@steipete
steipete disabled auto-merge October 30, 2026 19:17
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.
@steipete
steipete merged commit 769373d into main Oct 30, 2026
98 checks passed
@steipete
steipete deleted the fix/logs-compensation-readback branch October 30, 2026 23:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant