Align Command search with Fuse fuzzy matching #314

Closed
opened 2026-06-05 20:12:10 +00:00 by steve · 0 comments
Owner

Icon picker and several Command popovers use bits-ui computeCommandScore or substring filtering instead of the Fuse-based fuzzySearch() used by the command palette.

Problem

  • icon-list.svelte ranks icons with computeCommandScore and debounced oninput, diverging from command palette behavior.
  • Default bits-ui Command filtering also uses computeCommandScore.
  • plugin-bases autocomplete uses .includes() substring matching.

Goal

Unify Command search on Fuse via shared helpers in @lapis-notes/ui.

Scope

Command.Input / Command.Root only. Do not migrate non-Command computeCommandScore call sites.

Non-goals

Menu filtering, tags view, frontmatter pill editor.

Acceptance Criteria

  • commandFuzzyFilter helper exported from @lapis-notes/ui with unit tests.
  • Command.Root wrapper defaults filter to commandFuzzyFilter.
  • icon-list.svelte uses fuzzySearch with bound query.
  • autocomplete.svelte uses fuzzySearch instead of .includes().

Implementation Notes

Add command-fuzzy-filter.ts, default filter in command.svelte, refactor icon-list and bases autocomplete.

Suggested Files or Specs To Inspect

  • packages/ui/src/lib/fuzzy-search.ts
  • packages/ui/src/lib/components/ui/command/command.svelte
  • packages/api/src/lib/components/icon/icon-list.svelte
  • packages/plugins/plugin-bases/src/bases-view/components/autocomplete.svelte

Validation Commands

  • pnpm --filter @lapis-notes/ui check:all
  • pnpm --filter @lapis-notes/api check:all
  • turbo run check:all --filter=@lapis-notes/plugin-bases...

Follow-up Tasks

Implementation Summary

Added commandFuzzyFilter/createCommandFuzzyFilter in @lapis-notes/ui with unit tests and defaulted Command.Root filter to Fuse. Refactored icon-list to bind query and batch-filter with fuzzySearch; migrated plugin-bases autocomplete from substring includes to fuzzySearch. Validated with ui vitest, api svelte-check, and spec:lint.

Icon picker and several Command popovers use bits-ui `computeCommandScore` or substring filtering instead of the Fuse-based `fuzzySearch()` used by the command palette. ## Problem - `icon-list.svelte` ranks icons with `computeCommandScore` and debounced `oninput`, diverging from command palette behavior. - Default bits-ui Command filtering also uses `computeCommandScore`. - `plugin-bases` autocomplete uses `.includes()` substring matching. ## Goal Unify Command search on Fuse via shared helpers in `@lapis-notes/ui`. ## Scope Command.Input / Command.Root only. Do not migrate non-Command `computeCommandScore` call sites. ## Non-goals Menu filtering, tags view, frontmatter pill editor. ## Acceptance Criteria - `commandFuzzyFilter` helper exported from `@lapis-notes/ui` with unit tests. - `Command.Root` wrapper defaults `filter` to `commandFuzzyFilter`. - `icon-list.svelte` uses `fuzzySearch` with bound query. - `autocomplete.svelte` uses `fuzzySearch` instead of `.includes()`. ## Implementation Notes Add `command-fuzzy-filter.ts`, default filter in `command.svelte`, refactor icon-list and bases autocomplete. ## Suggested Files or Specs To Inspect - `packages/ui/src/lib/fuzzy-search.ts` - `packages/ui/src/lib/components/ui/command/command.svelte` - `packages/api/src/lib/components/icon/icon-list.svelte` - `packages/plugins/plugin-bases/src/bases-view/components/autocomplete.svelte` ## Validation Commands - `pnpm --filter @lapis-notes/ui check:all` - `pnpm --filter @lapis-notes/api check:all` - `turbo run check:all --filter=@lapis-notes/plugin-bases...` ## Related Issues ## Follow-up Tasks ## Implementation Summary Added commandFuzzyFilter/createCommandFuzzyFilter in @lapis-notes/ui with unit tests and defaulted Command.Root filter to Fuse. Refactored icon-list to bind query and batch-filter with fuzzySearch; migrated plugin-bases autocomplete from substring includes to fuzzySearch. Validated with ui vitest, api svelte-check, and spec:lint. <!-- backlog:task_id=TASK-COMMAND-FUZZY-SEARCH source_spec=packages/ui/spec.md -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#314
No description provided.