Repository navigation
Add fuzzy slide search to the cracktro deck - #78149
Merged
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Search silently ignores terms beyond the first eight, allowing invalid matches, and keyboard handling intercepts IME composition, causing premature navigation and disrupting candidate selection.
2 open issues
What changed in this PR
Adds fuzzy slide search to the standalone cracktro talk deck, letting users find slides by title, summary, body text, or speaker notes.
Changes:
- Adds a responsive dock button and full-screen search dialog with keyboard navigation.
- Implements lazy indexing, weighted fuzzy matching, highlighted results, and slide-number lookup.
- Adds Playwright coverage and documents search controls and implementation locations.
| File | Description |
|---|---|
docs/tests/talk.spec.ts |
Tests search results, highlights, dialog controls, and navigation. |
docs/README.md |
Documents search shortcuts and slide-number lookup. |
docs/public/cracktro/deck.js |
Implements search indexing, matching, dialog UI, and input handling. |
.github/skills/cracktro/SKILL.md |
Documents the search section and CSS prefix. |
Review effort: Balanced (dynamic)
| }; | ||
| const fzScore = (text, [b, e], n) => n / (e - b) + (b === 0 || /\W/.test(text[b - 1]) ? 0.5 : 0) + 0.25 * (1 - Math.min(b, 400) / 400); | ||
| const fzSearch = q => { | ||
| const terms = q.toLowerCase().split(/\s+/).filter(Boolean).slice(0, 8); |
| fzRender(); | ||
| } | ||
| fzIn.addEventListener("input", fzRender); | ||
| fz.addEventListener("keydown", e => { |
Contributor
|
🎉 This pull request is included in a new release. Release: |
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.

Adds a search icon to the talk deck's dock, next to the sound icon. It opens a full-screen dialog that fuzzy-matches each slide's title,
slides.mdsummary and text.Dock and dialog
.fzbbutton left of.snd. At ≤360px with compact nav it stacks above sound, so the existing narrow-dock layout test still passes.<dialog>with an input (role=combobox) and a result list (role=listbox). It opens with the button,/(except while typing in a form field) or Ctrl/Cmd+K.Index (built once, on first open)
headingText()(shared with the band map)PresentationDigitalDocument.hasPart[i].descriptionaria-hidden,style,scriptand.linecontent, and text nodes are joined with spaces.Bounds-based matching
fzBounds(text, term)returns the tightest[start, end)span that holds the term's letters in order. Spans wider thann + ceil(n/2)are rejected.n / width, plus a bonus when the span starts a word and a small bonus for appearing early. A field's score is multiplied by its weight.<mark>highlights, built as DOM nodes (noinnerHTML).#Nreturns only slide N, a bare number ranks slide N first, and an empty query lists every slide.Tests and docs
docs/tests/talk.spec.tscovering:#Ndocs/README.md: the new search keys..github/skills/cracktro/SKILL.md: asearchsection marker and thefz-CSS prefix.