-
Notifications
You must be signed in to change notification settings - Fork 64
feat: allow searching for bookmarks #89
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
- Add search mode with real-time filtering - Implement keyboard navigation (arrows, enter, shift+enter) - Integrate with Shiori API /api/bookmarks endpoint - Support opening bookmarks in current/new tabs - Maintain existing add bookmark functionality - Auto-focus search input on popup open
- Add configuration validation before showing main popup interface - Implement server health check using /api/v1/system/info endpoint - Show appropriate UI states: loading, unconfigured, unreachable, ready - Add status screen with options to open settings or retry connection - Prevent popup functionality until extension is properly configured - Improve user experience with clear error messages and guidance Co-authored-by: Ona <[email protected]>
- Ensure search and add mode elements are hidden during initialization - Add CSS rules to hide main interface by default - Explicitly hide main UI elements when showing error states - Fix initial HTML state for add-mode element - Prevent malformed UI from showing when not logged in Co-authored-by: Ona <[email protected]>
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.
Pull Request Overview
This PR adds bookmark search functionality to the Shiori extension, allowing users to search through their existing bookmarks in addition to the original "add bookmark" functionality. The extension now opens in search mode by default with a toggle to switch between search and add modes using Ctrl+A.
Key changes:
- Added search mode with keyboard navigation and bookmark listing
- Implemented configuration checking with error handling for unconfigured extensions
- Modified shortcut key and description to reflect dual functionality
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| view/popup.html | Added HTML structure for search mode, status checking, and mode indicators |
| js/popup.js | Complete rewrite to support dual modes, search functionality, and initialization flow |
| js/background-script.js | Added search and health check API endpoints with new message handlers |
| css/popup.css | Expanded from minified to readable format with styles for search mode and status screens |
| manifest.json | Updated keyboard shortcut and description, reformatted JSON structure |
| Makefile | Added clean target and fixed sed command for macOS compatibility |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
js/popup.js
Outdated
| if (event.keyCode === 13) { | ||
| event.preventDefault() |
Copilot
AI
Sep 26, 2025
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.
Using keyCode is deprecated. Use e.key === 'Enter' instead for better browser compatibility and maintainability.
| if (event.keyCode === 13) { | |
| event.preventDefault() | |
| if (e.key === 'Enter') { | |
| e.preventDefault() |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary
Pressing the shortcut will show the Shiori popup and allow to search for bookmarks
You can type to search, Enter to open in a new tab, Shift+Enter to open in the current tab.
Pressing Ctrl+A while on the popup switches between "Add mode" and "search mode" to preserver previous funcionality.
Screenshots