Skip to content

fix(ui): prevent typing lag in long chat transcripts - #133465

Merged
roboclaw-bot merged 1 commit into
mainfrom
roboclaw/fix-control-ui-typing-lag
Sep 1, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
roboclaw/fix-control-ui-typing-lag

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes an issue where users typing in a long Control UI chat could experience visible input lag because each ordinary character invalidated and rebuilt the surrounding chat pane.

Why This Change Was Made

Keep steady composer edits owned by the textarea and redraw the surrounding pane only when submission eligibility or empty/non-empty control state changes. Slash and skill menus retain their existing update paths, while text direction is updated directly on the textarea.

User Impact

Typing remains responsive in long transcripts without changing Send-state transitions, IME and dictation behavior, slash and skill menus, composer persistence, or typing previews.

Evidence

  • pnpm --dir ui test: 841 files passed; 12,869 tests passed, 1 skipped.
  • chat-stream-runtime-budgets.e2e.test.ts: 5/5 passed against the rebased head, including the long-transcript steady-composer regression.
  • The browser regression asserts ordinary characters cause at most one unrelated host update while empty/non-empty and send-enabled transitions still update correctly.

Worked on by

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 30, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 9:02 PM ET / September 1, 2026, 01:02 UTC.

ClawSweeper review

What this changes

The PR keeps ordinary Control UI composer edits local to the textarea so a long chat transcript is not rebuilt on every keystroke, while retaining control, command-menu, and text-direction updates.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer review. The focused change correctly removes ordinary composer edits from the chat-pane invalidation path, remains absent from current main, and has aligned exact-head behavior proof; exact-head CI is still running and this protected maintainer PR is not eligible for automated cleanup.

Priority: P2
Reviewed head: 99695009db79ed56ab5c77cfe7142c88cebb1d20

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The patch is focused, preserves the surrounding UI invariants, and is supported by exact-head production behavior evidence and boundary regressions.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The changed production owner is the composer input handler; supplied exact-head loopback-Gateway proof exercised a built Control UI with 400 persisted messages, typed the claimed steady-state path, and reported fewer pane invalidations and lower input latency while preserving draft, Send, and direction behavior. Screenshot retrieval was blocked by reviewer DNS, but the submitted real-run trace remains sufficient.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The changed production owner is the composer input handler; supplied exact-head loopback-Gateway proof exercised a built Control UI with 400 persisted messages, typed the claimed steady-state path, and reported fewer pane invalidations and lower input latency while preserving draft, Send, and direction behavior. Screenshot retrieval was blocked by reviewer DNS, but the submitted real-run trace remains sufficient.
Evidence reviewed 7 items Introduced owner-boundary repair: The introduced input path directly updates textarea direction and only requests a pane update when empty/non-empty controls or submission eligibility change.
Caller and persistence boundary: The chat-pane assembler supplies the live draft getter, draft writer, and pane update callback; the draft write therefore does not itself require rebuilding the transcript.
Current main still needs the change: Comparing fetched current main with the exact PR head shows current main retains the unconditional composer requestUpdate path and does not contain this repair.
Findings None None.
Security None None.

How this fits together

The Control UI chat page renders persisted history and a composer in one pane. Composer input changes draft state, menus, direction, and send eligibility; only changes that affect surrounding controls need a pane render.

flowchart LR
A[Persisted chat history] --> B[Control UI chat pane]
C[Composer keystroke] --> D[Composer input handling]
D --> E[Draft, menus, direction, send eligibility]
E --> B
B --> F[Visible transcript and controls]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head required CI is still in progress. Before merge, confirm it completes green and verify that the latest ClawSweeper comment after the force-push has no unmet Rank-up moves; that comment was not available in the supplied hydrated discussion.
  • Complete next step (P2) - No repair lane is needed: no actionable introduced defect was found, and the protected maintainer PR awaits normal exact-head CI and merge review.
Agent review details

Security

None.

PR surface

Source +11, Tests +152. Total +163 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 13 2 +11
Tests 3 152 0 +152
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 165 2 +163

Review metrics

Metric Value Why it matters
Production versus test delta production +13/-2 (net +11); tests +152/-0 The small production increase is justified by retaining direct direction updates and the two control-state predicates after removing unconditional pane redraws.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge the focused owner-boundary repair after exact-head CI succeeds and a maintainer confirms the latest review-state requirements.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge the focused owner-boundary repair after exact-head CI succeeds and a maintainer confirms the latest review-state requirements.

Do we have a high-confidence way to reproduce the issue?

Yes: the submitted exact-head proof exercises built production Control UI bundles with the same long persisted transcript before and after the repair, and the checked browser regression covers the same input path.

Is this the best way to solve the issue?

Yes: the repair changes the composer owner rather than adding a downstream workaround, preserves menu-controlled renders, and directly maintains textarea direction when a render is skipped.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a341cc11c2e8.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This repairs Control UI typing responsiveness in long transcripts without evidence of wider availability, delivery, or security impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The changed production owner is the composer input handler; supplied exact-head loopback-Gateway proof exercised a built Control UI with 400 persisted messages, typed the claimed steady-state path, and reported fewer pane invalidations and lower input latency while preserving draft, Send, and direction behavior. Screenshot retrieval was blocked by reviewer DNS, but the submitted real-run trace remains sufficient.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is the composer input handler; supplied exact-head loopback-Gateway proof exercised a built Control UI with 400 persisted messages, typed the claimed steady-state path, and reported fewer pane invalidations and lower input latency while preserving draft, Send, and direction behavior. Screenshot retrieval was blocked by reviewer DNS, but the submitted real-run trace remains sufficient.

Evidence

What I checked:

  • Introduced owner-boundary repair: The introduced input path directly updates textarea direction and only requests a pane update when empty/non-empty controls or submission eligibility change. (ui/src/pages/chat/components/chat-composer.ts:333, 99695009db79)
  • Caller and persistence boundary: The chat-pane assembler supplies the live draft getter, draft writer, and pane update callback; the draft write therefore does not itself require rebuilding the transcript. (ui/src/pages/chat/chat-pane-render.ts:553, 99695009db79)
  • Current main still needs the change: Comparing fetched current main with the exact PR head shows current main retains the unconditional composer requestUpdate path and does not contain this repair. (ui/src/pages/chat/components/chat-composer.ts:333, a341cc11c2e8)
  • Boundary-level regression coverage: The browser test loads a long transcript, types ordinary text, asserts at most one host update, and verifies send-state and RTL transitions; focused unit tests cover stale draft clearing and offline slash eligibility. (ui/src/e2e/chat-stream-runtime-budgets.e2e.test.ts:616, 99695009db79)
  • Submitted exact-head real behavior proof: The PR discussion reports separately built baseline and candidate production Control UI bundles served by isolated loopback Gateways with 400 persisted messages, including before/after invalidation and input-latency measurements on the exact head. (99695009db79)
  • Recent area routing: Blame identifies a recent modification of the surrounding composer input path by ruel225; its raw parent could not be hydrated locally, so this is routing evidence rather than an introduction claim. (ui/src/pages/chat/components/chat-composer.ts:336, f81afb28435b)

Likely related people:

  • unknown: The blamed commit carries this line unchanged from a recorded parent; no introducing author is attributed. (role: carried-forward source line; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-30T19:05:01.903Z sha e07e06b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T00:24:34.635Z sha ac9884e :: needs maintainer review before merge. :: none

@roboclaw-bot
roboclaw-bot force-pushed the roboclaw/fix-control-ui-typing-lag branch from e07e06b to ac9884e Compare September 1, 2026 00:13
@roboclaw-bot

roboclaw-bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Exact-head live Control UI proof

Tested candidate 99695009db79ed56ab5c77cfe7142c88cebb1d20 against its rebased main parent 1c9770abaf4ae20442122730510b8d447709942b.

Both revisions were fully built with pnpm build, then run as separate real loopback Gateways serving their own production Control UI bundles. Each isolated state store contained the same 400 persisted chat messages. Playwright Chromium typed the same 72-character suffix five times after a non-empty seed. No external provider was called.

Browser Metric main Candidate Change
Unthrottled Chat-pane host invalidations 361 1 -99.7%
Unthrottled Median typing completion 736.7 ms 490.6 ms -33.4%
4× CPU throttle Chat-pane host invalidations 360 0 -100%
4× CPU throttle Median typing completion 1937.4 ms 1384.4 ms -28.5%
4× CPU throttle p95 input-to-paint 59.4 ms 44.4 ms -25.3%
4× CPU throttle max input-to-paint 89.8 ms 60.0 ms -33.2%

Both runs rendered the LONG-TAIL-SENTINEL, preserved the complete typed draft, showed the Send control, and reported no page errors.

Before (main, 4× CPU):

Baseline long-transcript composer

After (candidate, 4× CPU):

Candidate long-transcript composer

Exact-head verification

  • 572 focused composer/chat tests passed (2 browser-only cases skipped in the non-browser unit project).
  • 10/10 composer-catalog browser tests passed, including desktop and mobile whitespace normalization.
  • 5/5 Control UI browser runtime-budget tests passed.
  • node scripts/check-changed.mjs passed with exit 0.
  • pnpm build passed on both baseline and candidate.
  • Structured Codex autoreview ran with gpt-5.6-sol, explicit xhigh reasoning, and P1 scope: no accepted/actionable findings; verdict patch is correct (0.94).

The first full CI run exposed one real interaction: after a skipped steady-state render, the shared draft commit helper could mistake its stale rendered prop for current state and fail to clear a whitespace-only draft on blur. The final head fixes that owner by preferring its live getter and adds direct stale-prop plus offline slash-transition regressions. The two unrelated process-teardown timing failures in that superseded run touched no PR files; the final head receives a fresh full CI run.

The remaining intentionally rendered paths are empty/non-empty control transitions, IME composition, and active slash/skill menus. The proof targets the PR's claimed ordinary steady-state typing path.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 1, 2026 00:17
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 1, 2026
@roboclaw-bot
roboclaw-bot force-pushed the roboclaw/fix-control-ui-typing-lag branch from ac9884e to 9969500 Compare September 1, 2026 00:55
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 1, 2026
@roboclaw-bot
roboclaw-bot merged commit 363a46d into main Sep 1, 2026
174 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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