Commit dd0b8b9
perf(cmdk): Score each candidate field individually in scoreNode
Instead of joining label, details, and keywords into a single string
and running fzf once, score each field independently and return the
best match. This has two benefits:
- Avoids false cross-field subsequence matches that could arise when
the tail of one field and the head of the next happen to satisfy a
pattern across the join boundary.
- Allows fzf's built-in exact-match bonus to fire naturally (e.g. when
the query equals the label exactly), without needing a manual boost
at the call site.
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>1 parent e2b0710 commit dd0b8b9
1 file changed
+15
-3
lines changedLines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
424 | | - | |
425 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
426 | 438 | | |
427 | 439 | | |
428 | 440 | | |
| |||
0 commit comments