Skip to content

Add Fuse.js match highlighting to launcher search results#7

Merged
skid-dev merged 1 commit intomainfrom
codex/add-matching-character-highlighting-to-search-results
Feb 27, 2026
Merged

Add Fuse.js match highlighting to launcher search results#7
skid-dev merged 1 commit intomainfrom
codex/add-matching-character-highlighting-to-search-results

Conversation

@skid-dev
Copy link
Owner

Motivation

  • Improve launcher search UX by using Fuse.js match metadata to highlight matching characters in result titles and content previews with a yellow background.
  • Use Fuse’s built-in match ranges so highlighting is accurate down to character positions and safe for the truncated preview.

Description

  • Enable includeMatches in the launcher Fuse configuration and pass matches through the ranking pipeline so render code can access Fuse ranges (src/content/modules/launcher/main.ts).
  • Add LauncherSearchResult type and update display_results to render per-character highlights using Fuse index ranges, inserting <mark> elements with class ultrabox-launcher-highlight for matched spans (src/content/modules/launcher/display_results.ts).
  • Clip content match ranges to the 200-character preview to avoid out-of-bounds indices and adjust property access to the nested item structure where needed.
  • Add CSS for .ultrabox-launcher-highlight to use a yellow background (#ffeb3b) and dark text (src/content/inject.css).

Testing

  • Ran npm run build which completed successfully with webpack compiling the extension assets.
  • Served the built dist output with python -m http.server successfully to validate runtime assets.
  • Executed a Playwright check that opened http://127.0.0.1:4173/popup.html and produced a screenshot artifact, confirming the UI loads with the changes.

Codex Task

@skid-dev skid-dev merged commit 5600d65 into main Feb 27, 2026
1 check passed
@skid-dev skid-dev deleted the codex/add-matching-character-highlighting-to-search-results branch February 27, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant