Registry Mirror
Skip to content

Conversation

@saphid

@saphid saphid commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

Thread search excerpts can highlight text inside commit SHAs even though the server ignores those occurrences when deciding what matches.

Deterministic repro on origin/main (8c51815e0dab006104014ea57cf2b1a372c06d52): In a Replay (dev) thread titled Weekly notes, send dead 7dead52bb8 from the composer. Search for dead in the sidebar. The orchestration.searchThreads RPC uses ThreadSearch to accept the standalone match and return the full snippet; ThreadSearchMatchExcerpt then highlights the snippet independently.

  • Observed: The result row renders two <mark> elements. messageMatcher("dead")("7dead52bb8") returns null, but findSearchTokenRanges("dead 7dead52bb8", "dead") returns [{start: 0, end: 4}, {start: 6, end: 10}].
  • Expected: Only [{start: 0, end: 4}] is highlighted. A search for the SHA prefix 7dead still highlights [{start: 5, end: 10}].

Change

Reuse the server matcher's cached hex-run check in the excerpt highlighter so it skips interior SHA hits without rescanning the run for each hit. This fixes the shared ranges used by sidebar and command palette excerpts on web, Electron, and mobile, and by the range-based fallback when seeding web thread find; server ranking and the wire contract are unchanged.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • The regression originally failed on the extra {start: 6, end: 10} range. Running the same fixture on the new base still returns that range. On the rebased head, vp test run packages/shared/src/paletteSearch.test.ts passed all 39 tests, including the SHA prefix check.
  • Isolated Replay web scenario, before rebase: base failed with expected: count 1, observed: count 2; the reviewed patch passed the same assertion. Before/after screenshots, runtime transcript, and runnable scenario.
  • On the rebased head, vp run check:changed exited 0: format, lint, Knip, typecheck, and all 41 affected tests passed.
  • Not shown: Native mobile and Electron shell, command palette interaction, web thread-find seeding, or remote/tunnel sessions.

Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Dec 2, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 1148b54

Macroscope's review found this PR approvable — Search excerpts stop highlighting interior SHA substrings already ignored by search matching, while SHA-prefix matches remain supported. The change is confined to search highlighting and navigation ranges, with no persistent-data or operational effects.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1148b54 and 0f67aaa.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Search matching and highlight range generation now exclude hits inside qualifying hexadecimal IDs. Tests cover excluded interior hits and accepted prefix matches.

Changes: Hexadecimal hit filtering

Layer / File(s) Summary
Shared hexadecimal hit filtering
packages/shared/src/paletteSearch.ts, packages/shared/src/paletteSearch.test.ts
A shared check identifies hits inside qualifying hexadecimal IDs. The message matcher and highlight range finder apply the check. Tests verify that interior hits are excluded while prefix matches are accepted.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: iamshadmantaqi, kliebhan

Merge Risk: Minimal · previous review 1148b

Search excerpts no longer highlight text inside commit SHAs, which matches what the server matches. Prefix matches on a SHA still highlight. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: excerpt highlighting no longer marks substrings inside ignored commit SHAs. The raw summary and objectives both describe the same change in makeInteriorHexHitCheck and find…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives a reproduction and expected behavior. The Change section explains the fix and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: excerpt highlighting no longer marks substrings inside ignored commit SHAs. The raw summary and objectives both describe the same change in makeInteriorHexHitCheck and findSearchTokenRanges. The title follows the conventional commit form and is specific.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives a reproduction and expected behavior. The Change section explains the fix and says server ranking and the wire contract are unchanged. The Scope section justifies why no issue is linked. The Verification section lists focused test results, a before/after scenario, and items not checked. It meets the template's requirements.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6500240 and 1148b54.

Files selected for processing: 2

  • packages/shared/src/paletteSearch.test.ts
  • packages/shared/src/paletteSearch.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 2, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Environment: real web app in Chromium, 1280×800, light theme, isolated fresh database per commit, free Replay (dev) Multi turn recording.

Steps: On each fresh database, create a demo project and a Replay (dev) Multi turn thread titled Weekly notes with an initial Start turn. Open it directly, type dead 7dead52bb8 into the composer, send it, and wait for the replay reply. Search 7dead in the sidebar and capture the SHA-prefix highlight; then search dead and capture the excerpt highlights. The pre-titled thread avoids the auto-title match, equivalent to the reported rename.

Scenario: Search excerpts ignore interior SHA matches and keep prefix matches

Proven: the scenario fails on base 93809d26c2 and passes on head 0f67aaaae7.

Base 93809d26c2 Head 0f67aaaae7
Result ❌ failed
ASSERTION_FAILED: expect.poll(...).toEqual(...) timed out after 15000 ms
last: expected ["dead","dead"] to equal ["dead"]
✅ passed
sha prefix Base 93809d26c2: sha prefix Head 0f67aaaae7: sha prefix
standalone dead Base 93809d26c2: standalone dead Head 0f67aaaae7: standalone dead
failure Base 93809d26c2: failure

Scenario driver · Before recording · After recording

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 2, 2026
@juliusmarminge
juliusmarminge merged commit 7dda56f into pingdotgg:main Dec 2, 2026
58 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants