Repository navigation
perf(ui): speed up formatted transcript search - #190238
Conversation
Keep formatted-text, source-link, Unicode, and recovered-message search from #170434 while skipping Markdown parsing for unambiguous prose and preparing each query once per filter pass. Preserve the highlight owner and its viewport lifecycle. Thanks to @holgergruenhagen for the original correctness fix.
|
🦞👀 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 changesThis PR skips Markdown parsing for unambiguous prose and prepares transcript search queries once per filter pass. Example: Search a 400-message conversation for “message 17.” in Chromium mobile.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR delivers a focused, measured search optimization with no actionable code findings; inherited browser-test failures still leave the required CI gate red. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI projects loaded and recovered messages into searchable transcript rows; source text and rendered-text projections determine visibility, while the existing highlight owner marks visible matches. flowchart LR
A[Search query] --> B[Prepared matcher]
C[Loaded and recovered messages] --> B
B --> D[Source text comparison]
B --> E[Visible text projection]
E --> F[Prose check or Markdown parser]
D --> G[Filtered transcript]
F --> G
G --> H[Existing highlights]
Technical reviewBest possible solution: Retain this small optimization in the existing search owners and land it after the required CI gate is resolved. Do we have a high-confidence way to reproduce the issue? Current-main source shows repeated query preparation and cold Markdown parsing for ordinary prose; the supplied interleaved browser campaign measures that cost, but this read-only review did not execute a reproduction. Is this the best way to solve the issue? The smallest complete optimization skips unnecessary parsing at the existing visible-text owner and shares query preparation within each filter pass while preserving the established matching contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f7d677435070. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +12, Other +2. Total +19 across 6 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 November 1, 2026, 5:41 AM ET / 10:41 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…0238) Keep formatted-text, source-link, Unicode, and recovered-message search from openclaw#170434 while skipping Markdown parsing for unambiguous prose and preparing each query once per filter pass. Preserve the highlight owner and its viewport lifecycle. Thanks to @holgergruenhagen for the original correctness fix.
What Problem This Solves
Transcript search reparses ordinary prose as Markdown while a reader types, adding work to every search through a large conversation.
User Impact
Search stays responsive while preserving formatted-text matches, source/link-target matches, Unicode matching, recovered replies, and visible highlights from #170434. Thanks to @holgergruenhagen for that correctness fix.
Why This Change Was Made
Source-mapped traces of the 400-message
chat-actions-searchscenario attributed about 10 ms to cold visible-text parsing, versus roughly 1 ms to highlight refresh. The existing visible-text owner now skips parsing for unambiguous letter-led prose lines and keeps its existing immutable-message cache. Everything with potentially significant Markdown syntax still uses the original parser. Each filter pass prepares the query once for its messages. The highlight owner and transcript windowing are unchanged.Evidence
Acceptance was set before measurement: 20 serial base/head/base-control triplets for Chromium and WebKit, desktop and mobile, localhost 1×; retain the 11 typed characters, matching-row assertion, close, draft preservation, and focus restoration. Review medians, p95s, ranges, and A/A controls; no attributable regression beyond the campaign's band. This is the production renderer with a synthetic Gateway, not provider-latency proof.
All 240/240 observations passed (20 triplets per engine/viewport); every action recorded 26 native input events, one matching message, no action RPCs, and preserved the focused draft on close. Chromium recorded zero long tasks. Host 1-minute load was 9.86–16.36. A/A script medians changed +0.14% desktop / +0.89% mobile.
Times below are median / p95 in ms. Chromium script/task use thread CPU; WebKit application time uses native input-to-last-DOM-commit elapsed time, not CPU.
The mobile script median is 113.62 ms, still 6.52 ms above the historical 107.1 ms target. This lands the measured search-owner win without changing the highlighter or the separately owned transcript-windowing work. The final diagnostic profiles place the remaining dominant cost in transcript grouping, rendering and layout; further search-owner changes are not justified by those samples. All wall/application and input-frame p95s hold or improve. Desktop style/layout medians moved +1.01%/+0.83%, with better p95s, within the stated band.
Full distributions and A/A controls (median / p95, min–max)
Host load (1 min): 9.86–16.36
pnpm tsgo:uigit diff --checkpnpm deadcode:knip)ea19b6f716c, with unchanged parser/plugin context; no actionable findingsThe new test coverage protects whitespace-spanning prose, Unicode simple folding, and ordered-list markers. One fixture initially compared a trailing newline that the existing message normalizer trims; the corrected fixture passes. No retries were used to conceal a product failure.
Touched production LOC: 1,742 → 1,747 (+5); tests +12. The additional code is the narrow prose check and a shared query-preparation closure. Refactor-checklist counts remain zero for effects, render effects,
untrack, direct DOM listeners/queries,flush, and owner APIs in the four touched production files. No dependency, public API, configuration, or lazy-boundary change.CI attribution
The full UI run 41297490931 reports these inherited failures:
Solid preserves presentation contracts in light desktopSolid preserves presentation contracts in light mobileSolid preserves presentation contracts in dark desktopSolid preserves presentation contracts in dark mobilestarts an empty cloud workspace before the default folder Git check finishesThe same cases and assertions fail in completed UI jobs of scheduled main run 41297432333: presentation job 124821331979, and empty workspace job 124821331928. The older completed scheduled main run 41293098118 also has the identical empty-workspace assertion. The current scheduled run is still in progress at this observation; the cited UI jobs are complete.
The presentation failures lose background, overflow and radius when the fixture moves the skeleton into a fresh shadow root. The empty-workspace test expects a visible description but receives
New workspace. Ten relevant owner, stylesheet, fixture and test blobs are identical between CI's tested merge2a23608d3dd5a7c1de4119f5dfdf19871c8c0466, its protected-main parent0f548caee9b81f60673d13efe2311fcf046a542a, and the scheduled-main head. The tested PR merge changes only the six transcript-search files. The empty-workspace log redacts the full title; the name above comes from that unchanged file's sole test.Auto-merge was retired through native recovery; the reviewed head is unchanged. The full PR run is complete: {'success': 40, 'failure': 3, 'skipped': 25}. The only failed nonaggregate jobs are the two inherited UI jobs above; independent security-fast passed. Native inherited-failure admission retains the failed CI result rather than describing it as green.