feat: Add swipe/scroll search engine switching#145
Merged
Conversation
Add touch swipe and mouse-wheel handlers to cycle search engines from the dropdown button, with a guarded switchEngine() that updates radio selection, persists active mode to localStorage, and defers swapping for a 400ms animation (fade-out at ~180ms). CSS adds engine-switching state and slideUp/slideDown keyframes for smooth vertical carousel transitions. The feature only triggers when the shortcut switch is enabled and the dropdown is closed, and it prevents rapid repeated switches via a 400ms throttle.
This comment was marked as resolved.
This comment was marked as resolved.
Collaborator
|
I will check tomorrow morning 🫡 |
prem-k-r
commented
Feb 14, 2026
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@scripts/search.js`:
- Around line 414-420: Rename the function getcurrentSearchEngineIndex to
getCurrentSearchEngineIndex to match camelCase; inside it, call getAllEngines()
as before but guard against
document.querySelector('input[name="search-engine"]:checked') returning null by
checking selectedOption and returning -1 (or another sentinel) when it's null,
and only access selectedOption.value when non-null; update any call sites that
referenced getcurrentSearchEngineIndex to the new getCurrentSearchEngineIndex
name.
- Around line 479-485: The touchstart handler on dropdownBtn currently calls
e.preventDefault(), which suppresses the synthesized click and prevents tapping
from opening the dropdown when hideSearchWith.checked is true; update the touch
handling in the touchstart listener (for dropdownBtn) to NOT call
e.preventDefault() unconditionally — instead record engineSwipeStartY in the
touchstart handler only, and move any call to preventDefault() to touchmove or
touchend after detecting a swipe beyond your threshold (or remove it entirely)
so taps still fire their click; adjust the listener options if you no longer
need passive: false.
🧹 Nitpick comments (1)
scripts/search.js (1)
400-406:currentSearchEngineIndexdoesn't need to be module-scoped.
currentSearchEngineIndexis assigned on line 429 viagetcurrentSearchEngineIndex()and only used withinswitchEngine. It can be a localletinsideswitchEngineinstead, eliminating unnecessary shared mutable state.
itz-rj-here
approved these changes
Feb 15, 2026
itz-rj-here
left a comment
Collaborator
There was a problem hiding this comment.
Working fine in both browsers with no issues
6 tasks
14 tasks
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.
📌 Description
Added the ability to change search engines by swiping (touch) or scrolling (mouse wheel) on the dropdown icon when search engines are hidden, with smooth vertical carousel animations.
✅ Checklist
Feature Overview
Adds touch-swipe and mouse-wheel gestures on the search dropdown button to switch search engines when the dropdown is hidden, using a smooth vertical carousel animation and persisting the selected engine.
Technical Implementation
JavaScript (scripts/search.js)
CSS (style.css)
Manifests & Changelog
Behavior & Edge Cases
Files & Size Impact
Testing & Checklist
Notes for Reviewers