test(CommandPalette): cover the b24ui-only useTokenSearch argument - #369
Open
IgorShevchik wants to merge 1 commit into
Open
test(CommandPalette): cover the b24ui-only useTokenSearch argument#369IgorShevchik wants to merge 1 commit into
useTokenSearch argument#369IgorShevchik wants to merge 1 commit into
Conversation
IgorShevchik
force-pushed
the
claude/search-mark-boundary
branch
from
August 13, 2026 06:37
8d757c7 to
e1b1968
Compare
useTokenSearch argument
8 tasks
`highlight()` takes a fifth parameter that upstream does not have, and it had no
test at all. `c502157b` added `tokens`/`minTokenLength` and `6743f793` the
parameter itself, both against the file's old name `src/runtime/utils/fuse.ts`;
both shipped in v2.8.0. The later port `557a5178` renamed the file to
`search.ts` and carried the divergence across, so a pickaxe on the current path
returns only that port — `--follow` is needed to see the two commits that
introduced it. Replaying upstream's four-parameter signature would therefore
have dropped a shipped feature with nothing going red.
The unit cases pin the threshold the argument moves: the whole term's length
when off, the shortest word's when on, with the fallback to the whole term when
the tokenizer matches nothing — an emoji-only query matches no `\p{L}`, and the
threshold must stay the term's length rather than collapsing to zero and marking
everything. They fail against a revert to upstream's signature.
The component cases cover the wiring, which the unit tests cannot: `matches` is
only populated when `includeMatches` is set, which `CommandPalette` leaves to
the caller, so no existing case in that file reached `highlight()` at all — the
`with searchTerm` snapshot contains no `<mark>`. They fail if the fifth argument
stops being forwarded from `processGroupItems`.
No `src/` change. Recorded as a §2 invariant in `.sync/PORTING.md`, with the
note that upstream itself was not re-inspected — the divergence is established
from b24ui's own history.
Closes #363
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LWWrBHgfqGSbeU3V6UuMF8
IgorShevchik
force-pushed
the
claude/search-mark-boundary
branch
from
August 13, 2026 08:01
e1b1968 to
bd740b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Closes #363.
Type of change
Description
highlight()takes a fifth parameter,useTokenSearch, that upstream does not have — and it had no test at all.Where it came from.
c502157badded thetokens/minTokenLengthpair and6743f793the parameter itself, both against the file's old namesrc/runtime/utils/fuse.ts; both shipped in v2.8.0. Immediately beforec502157bthe function took four parameters and computed nominTokenLength, which is what establishes it as locally authored — not the absence of anUpstream:trailer, which is too sparse a convention here to carry an inference (16 of ~3200 commits).Why nobody noticed. The port
557a5178renamedfuse.tstosearch.tsand carried the divergence across, sogit log -S useTokenSearch -- src/runtime/utils/search.tsreturns exactly one commit — that port, which does carry a trailer.--followis needed to see the two that introduced it.Why it matters. Replaying upstream's four-parameter signature would drop a feature shipped in v2.8.0 and nothing would go red.
Unit cases pin the threshold the argument moves: the whole term's length when off, the shortest word's when on, and the fallback to the whole term when the tokenizer matches nothing — an emoji-only query matches no
\p{L}token, and the threshold must stay the term's length rather than collapsing to zero and marking everything.Component cases cover the wiring, which the unit tests cannot reach.
matchesis only populated whenincludeMatchesis set, whichCommandPaletteleaves to the caller — so no existing case inCommandPalette.spec.tsreachedhighlight()at all, and thewith searchTermsnapshot contains no<mark>. These fail if the fifth argument stops being forwarded fromprocessGroupItems.Recorded as a §2 invariant in
.sync/PORTING.md, stating plainly that upstream itself was not re-inspected — the divergence is established from b24ui's own history.Checklist
Verified failing against a revert to upstream's four-parameter signature, and against dropping the fifth argument at the call site.
eslintandvue-tsc --noEmitclean.