-
-
Notifications
You must be signed in to change notification settings - Fork 26
Add cmd+k search dialog for episode discovery #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add SearchDialog component with keyboard shortcuts (cmd+k, ctrl+k) - Add SearchButton component for visual trigger - Add /api/episodes/search.json endpoint for searchable data - Add search state signal in state.ts - Integrate search into Layout.astro - Include unit tests for new components Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
- Use JSX.TargetedMouseEvent<HTMLDivElement> for type safety - Pluralize results count correctly (1 result vs N results) Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
|
damn Key Features:
|
Replaced the redundant SearchableEpisode interface with a type alias that uses Pick<Episode, ...> to reuse the existing Episode type. Co-authored-by: RobbieTheWagner <2640861+RobbieTheWagner@users.noreply.github.com>
- Added public/images/search-icon.svg - Created src/styles/search-icon.css with mask-image styling - Updated SearchDialog.tsx and SearchButton.tsx to use CSS class - Updated tests to match new icon implementation Co-authored-by: RobbieTheWagner <2640861+RobbieTheWagner@users.noreply.github.com>
|
@copilot critically review this PR for quality, performance, simplify, re-use of existing code, and other common best practices and checks |
- Move SearchableEpisode type to rss.ts for reuse across components - Fix potential runtime error with optional episodeNumber field - Import shared type in SearchDialog.tsx and search.json.ts Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
Critical review completed. Found and fixed the following issues in 8ca03f8: Fixed:
Already good:
|
Remove the SearchableEpisode type alias and use the Episode type directly as requested in code review. Co-authored-by: RobbieTheWagner <2640861+RobbieTheWagner@users.noreply.github.com>
src/components/SearchButton.tsx
Outdated
| return ( | ||
| <button | ||
| type="button" | ||
| class="flex items-center gap-2 px-3 py-2 text-sm text-light-text-body dark:text-dark-text-body bg-light-input-bg dark:bg-dark-input-bg rounded-lg border border-light-input-border dark:border-dark-input-border hover:border-light-input-border-focused dark:hover:border-dark-input-border-focused transition-colors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot this looks fine, but we do have a btn class we use elsewhere. Is that something we could use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use the btn class in afea293. Now follows the same pattern as FullPlayButton with the gradient border animation on hover.
Apply the existing btn class pattern to SearchButton for consistency with other buttons in the codebase like FullPlayButton. Co-authored-by: RobbieTheWagner <2640861+RobbieTheWagner@users.noreply.github.com>
/api/episodes/search.jsonto provide all episode data for client-side searchSearchDialog.tsxwith Preact for interactivitystate.tswith search-related signalsLayout.astroImplementation Summary
This PR adds a cmd+k style search dialog for episode discovery with:
Components:
SearchDialog.tsx- Modal dialog with keyboard shortcuts, real-time filtering, arrow key navigationSearchButton.tsx- Visual trigger button with search icon and keyboard hint (usingbtnclass)API:
/api/episodes/search.json- Provides searchable episode dataFeatures:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.