Skip to content

feat(sidebar): typo-tolerant fuzzy matching for the table & trigger filters#417

Open
Davydhh wants to merge 2 commits into
TabularisDB:mainfrom
Davydhh:feat/fuzzy-table-filter
Open

feat(sidebar): typo-tolerant fuzzy matching for the table & trigger filters#417
Davydhh wants to merge 2 commits into
TabularisDB:mainfrom
Davydhh:feat/fuzzy-table-filter

Conversation

@Davydhh

@Davydhh Davydhh commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The sidebar "Filter tables…" boxes currently do a strict, case-insensitive substring match. This switches them to typo-tolerant fuzzy matching via Fuse.js — so a misspelling like ordrs still finds orders, and results are ranked best-match-first.

Changes

  • New src/utils/fuzzy.ts — a small fuzzyFilter(items, query, getText) helper wrapping Fuse.js (threshold: 0.4, ignoreLocation: true), with tests.
  • Replaced the substring filter with fuzzyFilter in the table and trigger filters across all three sidebar layouts: schema (SidebarSchemaItem), multi-database (SidebarDatabaseItem), and flat (ExplorerSidebar).
  • Left the favorites filter (matches name and SQL) and the database-selector filter on substring for now — different contexts, easy to switch later.

New dependency

Adds fuse.js (^7.4.2) — a small, zero-dependency package (~few KB gzipped) and the most widely used JS fuzzy-search library; it provides the typo tolerance. Flagging explicitly since it's a new runtime dependency — happy to swap in a dependency-free implementation instead if you'd prefer to avoid it.

…ters

Replace the substring filter with Fuse.js so misspellings still match
(e.g. "ordrs" finds "orders") and the closest names rank first. Applied
to the table and trigger filters across the schema, database, and flat
layouts via a shared fuzzyFilter helper. Adds the fuse.js dependency.
@debba

debba commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Hi @Davydhh ,
looks good to me, I will merge #412 before.
We have also a Quick Navigator, which can be called using ⌘ + P / CTRL + P .
Do you thin can you apply fuzzy filter also in Quick Navigator?

@Davydhh

Davydhh commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Hi @debba,
Yes, I'll do it in a separate pull request (after the merge in order to have the new dep) since it's specific to tables and triggers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants