Migrate remaining computeCommandScore call sites to Fuse #318

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

Follow-up to #314: several menus and search lists still used bits-ui computeCommandScore.

Problem

Menu filtering, tags view, metadata autocomplete, and all-properties search used computeCommandScore instead of the shared Fuse scorer.

Goal

Use fuzzyMatchScore from @lapis-notes/ui everywhere per-item fuzzy ranking is needed.

Scope

All remaining computeCommandScore call sites in api, plugin-markdown, and workspace.

Non-goals

Changing batch fuzzySearch consumers or Command wrapper defaults from #314.

Acceptance Criteria

  • No computeCommandScore imports remain in implementation code.
  • fuzzyMatchScore exported as the canonical per-item scorer; commandFuzzyFilter remains an alias.
  • Menu, tags, frontmatter autocomplete, and all-properties use fuzzyMatchScore.

Implementation Notes

Rename factory to createFuzzyMatchScore, alias commandFuzzyFilter, migrate five call sites, update test mocks.

Suggested Files or Specs To Inspect

  • packages/ui/src/lib/command-fuzzy-filter.ts
  • packages/api/src/lib/menu.svelte.ts
  • packages/workspace/src/lib/views/tags/tags.svelte
  • packages/plugins/plugin-markdown/.../widgets.ts, PillListEditor.svelte, all-properties.svelte

Validation Commands

  • pnpm --filter @lapis-notes/ui check:all
  • pnpm --filter @lapis-notes/api check:svelte
  • pnpm --filter @lapis-notes/workspace check:svelte
  • vitest run for plugin-markdown frontmatter tests

Follow-up Tasks

Implementation Summary

Exported fuzzyMatchScore/createFuzzyMatchScore as the canonical per-item Fuse scorer (commandFuzzyFilter remains an alias). Replaced all computeCommandScore call sites in menu.svelte.ts, tags.svelte, PillListEditor, widgets.ts, and all-properties.svelte. Updated frontmatter test mocks. Validated with ui vitest, api/workspace svelte-check, and plugin-markdown frontmatter tests.

Follow-up to #314: several menus and search lists still used bits-ui `computeCommandScore`. ## Problem Menu filtering, tags view, metadata autocomplete, and all-properties search used `computeCommandScore` instead of the shared Fuse scorer. ## Goal Use `fuzzyMatchScore` from `@lapis-notes/ui` everywhere per-item fuzzy ranking is needed. ## Scope All remaining `computeCommandScore` call sites in api, plugin-markdown, and workspace. ## Non-goals Changing batch `fuzzySearch` consumers or Command wrapper defaults from #314. ## Acceptance Criteria - No `computeCommandScore` imports remain in implementation code. - `fuzzyMatchScore` exported as the canonical per-item scorer; `commandFuzzyFilter` remains an alias. - Menu, tags, frontmatter autocomplete, and all-properties use `fuzzyMatchScore`. ## Implementation Notes Rename factory to `createFuzzyMatchScore`, alias `commandFuzzyFilter`, migrate five call sites, update test mocks. ## Suggested Files or Specs To Inspect - `packages/ui/src/lib/command-fuzzy-filter.ts` - `packages/api/src/lib/menu.svelte.ts` - `packages/workspace/src/lib/views/tags/tags.svelte` - `packages/plugins/plugin-markdown/.../widgets.ts`, `PillListEditor.svelte`, `all-properties.svelte` ## Validation Commands - `pnpm --filter @lapis-notes/ui check:all` - `pnpm --filter @lapis-notes/api check:svelte` - `pnpm --filter @lapis-notes/workspace check:svelte` - `vitest run` for plugin-markdown frontmatter tests ## Related Issues - Follow-up to #314 — [Align Command search with Fuse fuzzy matching](../closed/314-align-command-search-with-fuse-fuzzy-matching.md) ## Follow-up Tasks ## Implementation Summary Exported fuzzyMatchScore/createFuzzyMatchScore as the canonical per-item Fuse scorer (commandFuzzyFilter remains an alias). Replaced all computeCommandScore call sites in menu.svelte.ts, tags.svelte, PillListEditor, widgets.ts, and all-properties.svelte. Updated frontmatter test mocks. Validated with ui vitest, api/workspace svelte-check, and plugin-markdown frontmatter tests. <!-- backlog:task_id=TASK-FUZZY-MATCH-SCORE source_spec=packages/ui/spec.md related_issue=314 -->
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#318
No description provided.