Skip to content

fix(chat): a search's pick opens the folded failed-requests row its match is in - #3106

Merged
devswha merged 2 commits into
mainfrom
fix/chat-search-folded-failed-requests
Nov 6, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/chat-search-folded-failed-requests

Conversation

@devswha

@devswha devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Fixes #3082.

What

With Settings > Chat > Compaction and failed requests on, a run of back-to-back failed requests is one folded row. Conversation search still finds words of those errors (it reads every non-commentary text part), and a pick scrolled the turn into view but left the matching error folded inside the closed row.

Now a pick whose match is in a failed request opens the row it is folded in:

  • foldedRequestsMatch (src/lib/workBlocks.ts) names the folded row (by its first part's index, the row's failed:<index> memory key) that the turn's first match of the picked words lies in. The first match is the one the search's snippet showed. It returns null when that match is drawn outside every such row.
  • matchPart (shared/conversation-search.ts) is the part the first match begins in. matchRow now reads the store row from it, with no change in what it returns.
  • After revealTurn places the turn, ChatView sets the row's remembered toggle open, so a row the list draws later starts open, and opens a row that is already drawn in place. chatRowMemory (src/lib/chatRowState.tsx) makes a row's memory before the row is drawn. ChatTimeline uses the same helper.

With the setting off nothing changes: there is no row, and the error lines are drawn and searched as before. The server's search is unchanged.

Design: this works like a browser's find-in-page, which opens a closed <details> when the found text is inside it (Chrome's auto-expand of details/hidden=until-found). The pick reveals what it found instead of pointing at a folded row. The Codex and Claude apps have no folded error rows to compare with.

A search for Error also matches the Error: prefix that each line in the opened row leaves out. The pick still opens the right row, and the row is the error row.

Validation

  • Failing first: bun test src/lib/workBlocks.test.ts failed before the helper existed (export missing). It passes now, together with shared/conversation-search.test.ts and server/conversation-search.test.ts (76 pass).
  • Browser: scripts/chat-request-details-demo-regression.ts now folds the row again, searches connection error from the pane's menu, picks the match and expects the row open with the error visible. It ran at 390 and 1280 px, light and dark, with the setting on and off: 8/8 PASS. With this PR's ChatView.tsx change reverted, the new step fails (waitForFunction timeout: the row stays folded).
  • scripts/conversation-search-demo-regression.ts: all PASS at 1280 and 390.
  • bun run check fast on the head merged with origin/main: all ok (typecheck, build, unit 12534 pass / 0 fail).
  • Not run: the full browser suite and the integration suite (CI runs them).

Screenshots (pick of connection error, row opened by the pick):

width dark light
1280
390

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1e21796 and 4ef2715.

Files selected for processing: 8

  • changelog.d/chat-compaction-failed-requests.md
  • scripts/chat-request-details-demo-regression.ts
  • shared/conversation-search.ts
  • src/components/ChatTimeline.tsx
  • src/components/ChatView.tsx
  • src/lib/chatRowState.tsx
  • src/lib/workBlocks.test.ts
  • src/lib/workBlocks.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Reviews at head 4ef2715:

  • omo review: CLEAR.
  • Codex adversarial review (Terra, xhigh): CLEAR, no findings. It ran five folded-match checks and 10,000 randomized comparisons of the refactored matchRow against the previous implementation, and all of them passed.
  • CodeRabbit: did not review this head ("Review limit reached").

Open review threads: 0.

@devswha

devswha commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate (owner-approved): bun run check fast passed at this head, omo CLEAR and Codex Terra xhigh CLEAR at this head, threads resolved, merges cleanly; chat-request-details-demo 8/8 (390/1280 light/dark, setting on/off; fails with the fix reverted) and conversation-search-demo-regression pass. Setting off: unchanged. CodeRabbit was rate-limited. Fixes #3082. Merged without waiting for GitHub CI.

@devswha
devswha merged commit 618b412 into main Nov 6, 2026
18 of 19 checks passed
@devswha
devswha deleted the fix/chat-search-folded-failed-requests branch November 6, 2026 01:54
devswha added a commit that referenced this pull request Nov 6, 2026
…in the failed-requests script (#3111)

## What

`scripts/chat-request-details-demo-regression.ts` fails on main (Browser
regression, other scripts) at line 116 on every phone run:

```
116 |       if (phone) await page.locator(".tab-strip-menu").first().click();
TimeoutError: click: Timeout 30000ms exceeded.
  - waiting for locator('.tab-strip-menu').first()
```

#3106 added a phone step that opens Search conversation from the tab
row's menu button. #3099, merged after it, drops the tab row on phones
(the header title lists the tabs) and moves the pane's actions to the
header's More. #3099 had already moved
`conversation-search-demo-regression.ts` to `.header-more-button`, but
it never saw this new step. This PR moves the step the same way. The
step still opens the pane's menu, picks Search conversation, and asserts
the folded row opens on the pick. No assertion changed.

## Validation

- In `herdr-ci-runner:local` (own `HERDR_TEST_SESSION`): main's version
of the script fails at line 116 as in CI (`TimeoutError ... waiting for
locator('.tab-strip-menu')`); with this change it passes all 8 runs (390
and 1280, light and dark, details on and off).
- `bun run check fast`: pass.
- Skipped: the rest of the browser suite (only this script changed).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat search lands on a failed request folded inside its row (opt-in request details)

1 participant