Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
Adds an opt-in fuzzy mode to
@floatboat/nexus-plugin-search. Queries match as an ordered subsequence within a single line and carry an fzf-inspired relevance score; navigation, select-all, viewport highlighting and rendered table-cell highlights all follow fuzzy matches through the existing CodeMirror search pipeline.Motivation / 背景与动机
Roadmap #17. Today a query like
fbbcannot findfoo bar baz— only literal, whole-word and regex modes exist. Implemented in-package (~130 lines) rather than adding a fuzzy library dependency, per GOVERNANCE §6.3.doneopenspec/changes/add-search-fuzzyChanges / 变更内容
packages/plugin-search:SearchOptions.fuzzy,SearchMatch.score?,SearchPluginLabels.fuzzy?(additive only); new exportedFuzzySearchQueryFuzzyQueryHandlerimplements the CodeMirror search query-type protocol (nextMatch,prevMatch,matchAll,highlight,getReplacement), so fuzzy rides the standard search state field instead of a parallel UIregexp/wholeWord, replace toggle + row hidden while activegetReplacementreturns the matched text so a programmatically invoked replace is an identity transform rather than destructive@codemirror/stateis not declared here, editor state types are derived from@codemirror/viewpackages/plugin-search/test: 24 new tests (matcher scoring, line scope, CRLF, panel wiring, CM navigation, select-all, replace hiding, history recall, table highlights)docs/ROADMAP.md,docs/ROADMAP.zh.md: feat(core,react,vue,search,slash,toolbar): editor API, search, slash commands and toolbar enhancements #17 →doneopenspec/: proposal, plugin spec delta, tasksKnown trade-off: the fuzzy query-type protocol is not exported by
@codemirror/search— only the runtime method names are stable. The handler is implemented against that shape and covered by integration tests that exercise the real commands. See the proposal's Design Notes for why subclassingSearchQuerywas chosen over a parallel UI.Testing / 测试
plugin-search58/58 passingplugin-search,reference-plugins,electron-demomain(apps/electron-demo/test/plugin-host-broker.test.ts:667,O_NONBLOCKis0on Windows); CI runsubuntu-latestdist/stays gitignoredopenspec validate --strictnot run — CLI is not installed locallyfbbmatchesfoo bar baz, camelCase boundaries score above mid-word matches, table cell highlights follow fuzzy spans, replace controls hide while fuzzy is activeCompliance / 合规自检
packages/plugin-search/package.jsonunchanged).env/ personal vault data committedChecklist / 自检清单
packages/plugin-search; types updated in-place,check:apidoes not cover this packagelive-preview-table.ts— no, not touchedadd-search-fuzzy)Screenshots / Recordings