Skip to content

fix: keep your place when closing chat search during a reply - #208093

Merged
daniel-lxs merged 5 commits into
mainfrom
openclaw/chat-search-close-loses-place-02ba98
Nov 29, 2026
Merged

daniel-lxs merged 5 commits into
mainfrom
openclaw/chat-search-close-loses-place-02ba98

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #208010, #207673

What Problem This Solves

While a reply is streaming, closing a search that found no earlier messages can jump from the message you were reading to the bottom of the chat. The same search in a completed chat keeps your place.

User Impact

Close the search and the message you were reading stays at the same position in the transcript. The reply keeps streaming. There is no new setting or migration.

Why This Change Was Made

The live reply stays on screen during search, even when none of the saved messages match. The scroll anchor treated that live row as a history result and skipped restoring the saved position. I changed only what the existing anchor receives: a stream-only projection has no history row to return to. The separate decision about whether to show “No matches” is unchanged, so the UI does not put that notice above a highlighted live reply.

This builds on #208010, which is already in the tested main revision. It does not change first-match navigation, follow-to-latest behavior, or the anchor implementation from #207673.

Evidence

I tested the real Control UI and Gateway in Chromium on Crabbox AWS, with 78 synthetic history messages and a loopback provider holding an actual response stream open. I scrolled up, opened Find from the composer, entered an absent term, received another reply delta, and closed Find before the reply finished.

  • Main 3f6e3a9: the first visible message changed from note 56 to 74; distance from the bottom went from 1,962 px to zero.
  • Head 27fd5fe: note 56 stayed first, 14.58 px from the transcript top before search and 14.08 px after. The reply remained active.
  • The focused Chromium regression failed on main; all five cases passed on head. The production build, formatting, and UI typecheck passed.
  • The controller guard flagged the same three pre-existing querySelector calls in chat-pane-shared.ts on both main and head. I did not change that file. I did not test Safari or Firefox.

Clean comparison

Before: On main, note 74 is clipped at the top and the live reply is visible below it.

Main after closing search: the reader has jumped to the bottom

After: On the fix, note 56 is still first while the reply continues below the viewport.

Fix after closing search: note 56 is still first

Annotated comparison

Main: the top edge now clips note 74 instead of showing note 56

Fix: the original reading position at note 56 is retained

Both captures are from the same 1180 × 760 Chromium flow. The transcript change and its browser regression test match the files tested on AWS. In a separate Chromium run with a mocked Gateway, main 5b7efcd lost the saved message and all five cases passed on 76b19b5 with the same test file.

Worked on by

Work sessions

Linked for team reference; these sessions aren’t public.

🦞 Made with OpenClaw

roboclaw-bot and others added 2 commits November 29, 2026 06:52
Treat retained stream rows as empty for history-anchor restoration, without changing live output, highlights, or the no-match status.

Co-authored-by: daniel-lxs <[email protected]>
Worked on by:
- @daniel-lxs

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: e8317902-da43-4506-8e62-273dc793bc3c
@clawsweeper

clawsweeper Bot commented Nov 29, 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 P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 29, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 29, 2026 07:03
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR restores the saved reading position when an empty chat search closes while a reply is streaming.

Example: Read note 56 in a 78-message chat, search for an absent term during a reply, then close search.

  • Before: The transcript jumps to the bottom, with note 74 clipped at the top.
  • After: Note 56 remains at its original screen position while the reply continues.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal owner-level repair with inspected browser evidence and a focused regression; current-head CI is still completing.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The public scenario and inspected screenshots exercise the Control UI with a real Gateway and held-open response stream, showing note 56 retained after closing search; Chromium is covered, while Safari and Firefox remain untested.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Closing a search with no matching history during a reply loses the message the reader was viewing.
Reason: This maintainer-authored repair restores established reading-position behavior with a narrow change and no new setting or policy.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a concrete reading-position bug still present on current main, with a focused implementation and no actionable findings.

Reviewed head: 0082d5e9e81b6ca52469fe18bad9b90b67a65610

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI projects loaded history and live replies into transcript rows, then supplies search state to the existing scroll-anchor owner to restore the reader’s position.

flowchart TD
  A[Loaded history and live reply] --> B[Search filtering]
  B --> C[Transcript projection]
  C --> D[Visible transcript rows]
  C --> E[History emptiness signal]
  E --> F[Existing scroll anchor]
  F --> D
Loading

Technical review

Best possible solution:

Use the existing anchor’s empty-history signal for stream-only search projections, as this PR does.

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

Current-main source establishes the failure path, supported by the supplied before/after Chromium scenario; this read-only review did not execute target code.

Is this the best way to solve the issue?

The patch corrects the projection’s input to its existing anchor owner and preserves live rendering, search status, and the earlier restoration mechanics.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b904594b0377.

Provenance checked

  • Search emptiness supplied to transcript restoration keeps the original intent (95df0c9: Restore the saved visible message after closing or clearing an empty search; the original work credited the message-anchor approach from fix: retain chat reading position after an empty search #152095.)
  • Separate no-match status from live activity keeps the original intent (bcc4aba: Report no matching loaded messages even when a collaborator’s typing preview remains visible.)
  • Fixed search-return geometry keeps the original intent (f10c999: Prevent empty-viewport offset changes from moving the saved return target while ordinary history anchors continue following reader movement.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 95df0c9 adds ui/src/e2e/chat-empty-search-return.e2e.test.ts:44 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 95df0c9f398a; files: ui/src/e2e/chat-empty-search-return.e2e.test.ts)
  • Daniel: Raw commit 835b91f adds ui/src/e2e/chat-empty-search-return.e2e.test.ts:45 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 835b91f67814; files: ui/src/e2e/chat-empty-search-return.e2e.test.ts)
  • Peter Steinberger: Raw commit d7578af adds ui/src/pages/chat/components/chat-transcript-projection.ts:2 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d7578af82d24; files: ui/src/pages/chat/components/chat-transcript-projection.ts)

PR surface

Source +3, Tests +22. Total +25 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 6 3 +3
Tests 1 26 4 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 32 7 +25

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

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:

  • 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-29T07:08:03.891Z sha 7b68bc9 :: passed. :: none
  • reviewed 2026-11-29T07:45:12.101Z sha cdf8ed5 :: passed. :: none
  • reviewed 2026-11-29T08:12:18.229Z sha 76b19b5 :: passed. :: none

Reviewed November 29, 2026, 4:19 AM ET / 09:19 UTC (Revision 4).

@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@clawsweeper clawsweeper Bot added the rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. label Nov 29, 2026
@clawsweeper clawsweeper Bot removed the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Nov 29, 2026
@daniel-lxs
daniel-lxs merged commit 3827848 into main Nov 29, 2026
93 checks passed
@daniel-lxs
daniel-lxs deleted the openclaw/chat-search-close-loses-place-02ba98 branch November 29, 2026 09:33
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 30, 2026
…w#208093)

Restore the saved reading position when closing a search that leaves only the streaming reply visible. Keep the live reply and search highlights on screen.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: e8317902-da43-4506-8e62-273dc793bc3c
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 impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS 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.

2 participants