Skip to content

feat(packet viewer): implement fuzzy search with typo toleration - #3941

Open
calmonroe wants to merge 8 commits into
mainfrom
1992-tokenized-search-for-dropdowns
Open

calmonroe wants to merge 8 commits into
mainfrom
1992-tokenized-search-for-dropdowns

Conversation

@calmonroe

@calmonroe calmonroe commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Adds fuzzy search capability to Packet Viewer combobox and search bar
The fuzzy search is tolerant of typos, spaces, and partial matches
Dynamically sorts results in order of closest to furthest match
Screenshot 2026-09-25 at 3 30 00 PM
Screenshot 2026-09-25 at 3 38 38 PM
Screenshot 2026-09-25 at 3 46 45 PM
Screenshot 2026-09-25 at 3 30 45 PM

Why it changed

Closes #1992

Testing strategy

Tested with new playwright tests and by trying out the search function in the UI by hand

Review notes

We previously discussed using a pre-existing fuzzy search package, but after consideration I think tuning our own fuzzy search to our particular needs makes more sense. Evaluated fuse.js, uFuzzy, fast-fuzzy, fuzzysort and match-sorter against real INST names: all but uFuzzy failed on recall, and uFuzzy anchors the first and last character of every term, so one typo in a short mnemonic finds nothing (heal star → no match); the intraRules override that fixes it returns more junk than the matcher in this PR does. Additionally, building the uFuzzy version in full came out to more code, not less (169 lines vs 153, plus 5KB and a dependency), since the integration work is identical either way and only the search.js file changes.

However, I did decide to use approx-string-match which searches for the closest substring matches for a pattern within a body of text. This helped avoid confusing code that we would have to maintain, which built a table and kept track of matches itself

@calmonroe calmonroe linked an issue Sep 25, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.82353% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.15%. Comparing base (688f928) to head (28e963d).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...gins/packages/openc3-js-common/src/utils/search.js 98.24% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3941      +/-   ##
==========================================
+ Coverage   80.08%   80.15%   +0.07%     
==========================================
  Files         901      902       +1     
  Lines       68356    68448      +92     
  Branches     2645     2662      +17     
==========================================
+ Hits        54743    54865     +122     
+ Misses      12946    12920      -26     
+ Partials      667      663       -4     
Flag Coverage Δ
frontend 67.17% <98.82%> (+0.22%) ⬆️
python 80.13% <ø> (+<0.01%) ⬆️
ruby-api 82.59% <ø> (+0.58%) ⬆️
ruby-backend 85.66% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@socket-security

socket-security Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​approx-string-match@​2.0.0871009780100

View full report

@sonarqubecloud

Copy link
Copy Markdown

@calmonroe
calmonroe marked this pull request as ready for review September 28, 2026 23:17
@github-actions

Copy link
Copy Markdown

AI adversarial review

Warning

The review did not finish, so there is no result to publish. See the workflow run log.

This branch has not been deployed

No deployments
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.

Tokenized search for dropdowns

1 participant