Commit ee6df29
committed
fix(search): rank blocks/tools by name so exact name matches win
Blocks and tools were ranked against their full searchValue (name + type + every
command-searchable option label), so an exact name match couldn't earn the
exact-match bonus and paid a length penalty inflated by option text — e.g.
"Agent" lost to "Pi Coding Agent" for the query "agent". Rank by name first via
a new optional secondary accessor on filterAndSort/filterAndCap, falling back to
searchValue only when the name doesn't match, so an exact name match always wins
while a block stays findable by an option label.1 parent 3107b1b commit ee6df29
3 files changed
Lines changed: 98 additions & 22 deletions
File tree
- apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
582 | 581 | | |
583 | 582 | | |
584 | 583 | | |
585 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
586 | 590 | | |
587 | 591 | | |
588 | 592 | | |
589 | 593 | | |
590 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
591 | 600 | | |
592 | 601 | | |
593 | 602 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
245 | 286 | | |
246 | 287 | | |
247 | 288 | | |
| |||
Lines changed: 42 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
246 | 265 | | |
247 | | - | |
248 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
249 | 269 | | |
250 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
251 | 276 | | |
252 | 277 | | |
253 | 278 | | |
254 | | - | |
| 279 | + | |
255 | 280 | | |
256 | 281 | | |
257 | 282 | | |
258 | 283 | | |
259 | 284 | | |
260 | 285 | | |
261 | 286 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
267 | 290 | | |
268 | 291 | | |
269 | 292 | | |
270 | 293 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
276 | 297 | | |
277 | | - | |
278 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
279 | 305 | | |
280 | 306 | | |
0 commit comments