Repository navigation
Conversation
Rework the shared results template to show a proper heading, a result
count ("N results"), and friendly empty states, driven by a new
searchPageData struct used by both /.search and /.all. The /.search
backend is unchanged: it still only supports the "owner:<email>" query.
Signed-off-by: Paul Scott <408401+icio@users.noreply.github.com>
Introduce searchFilters, searchInput, and parseSearchInput, which parse
a raw query string into structured filters ("owner:<email>"), an
include-long "?" prefix, and a short/path/query split. serveSearch now
routes its owner handling through the parser. No behavior change: the
only query that resolves is still "owner:<email>".
Signed-off-by: Paul Scott <408401+icio@users.noreply.github.com>
Introduce the SearchResult type and a runSearch helper that collect the matching links (still only the "owner:<email>" path) and build results carrying a click Target, a rendered long URL, and a detail-page link. Add the contains/highlight template funcs (highlight receives no match positions yet, so it renders plain text) and an annotateClicks helper. serveSearch and serveAll now render []SearchResult. No behavior change. Signed-off-by: Paul Scott <408401+icio@users.noreply.github.com>
icio
force-pushed
the
icio/search-fuzzy
branch
from
October 9, 2026 09:37
39a1b4a to
682fa4d
Compare
Add an idx map to SQLiteDB, populated at startup via rebuildIndexLocked and kept in sync by Save, SaveAll, and Delete under the existing mutex. Stored Link values are copied so caller-side mutation can't leak in. Nothing reads the index yet; it's the backing store for the upcoming fuzzy search. Signed-off-by: Paul Scott <408401+icio@users.noreply.github.com>
Add SearchShort, which fuzzy-matches the query against the in-memory index's short names (and, with includeLong, long URLs too), applies the owner filter, and returns ranked SearchMatch results with the matched rune positions for highlighting. Adds the github.com/sahilm/fuzzy dependency. Not yet wired to a handler. Signed-off-by: Paul Scott <408401+icio@users.noreply.github.com>
Rewire runSearch onto the fuzzy SearchShort index and drop the owner-only GetLinksByOwner path. /.search now fuzzy-matches short names (and long URLs with a leading "?"), highlights matched runes with <mark>, previews a path/query via expandLink, and truncates at 100 with a notice. The results page gains a refine form, usage tips, and a best-match-first count. Signed-off-by: Paul Scott <408401+icio@users.noreply.github.com>
icio
force-pushed
the
icio/search-fuzzy
branch
from
October 9, 2026 10:38
682fa4d to
73dc00a
Compare
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.
Screenshot of fuzzy search (navbar search is in the following PR #262)
Stack created with GitHub Stacks CLI • Give Feedback 💬