Skip to content
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

Search without Autocompletion #49

Merged

Conversation

NitroSniper
Copy link
Contributor

Description of the Change

src/utils/command.js:

Refactored the 'normal' search into a function called DefaultSearch and exposed it.

src/components/Search.js:
  • imported DefaultSearch to the file.
  • Const isCtrlPressed to tell if CTRL or META is pressed (refactored from code found).
  • Ternary expression to choose search function and executes that function with parameters.
README.md
  • Added to keybinds the changes implemented.
  • fixed a typo I saw while editing.

Possible Drawbacks

  • Use of the ternary operator could be unreadable however I can read it perfectly and prevents duplicating 2 functions with the same parameters.
  • The keybind also ignores commands along with autocompletion however I think people will intend of ignoring it if used. e.g. searching "w hotels"

Further note:

I am loving the project and am using it as my home page for my workflow. amazing stuff here and keep up the good work!

Copy link

vercel bot commented Dec 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
start-page ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 25, 2023 4:01am

@excalith
Copy link
Owner

Hey @NitroSniper, thanks for the PR! Everything seems to be in order and working as intended.

The only drawback I could imagine was binding ignoring commands, but as you mentioned it won't be much of a hassle since it works as force search command.

Merging and will deploy soon with another request for window transparency feature.

Cheers!

PS: Thanks so much for your kind words, I am really glad that people enjoy using this project as their daily homepage!

@excalith excalith merged commit 790086b into excalith:main Dec 25, 2023
2 checks passed
@NitroSniper NitroSniper deleted the feat-search-without-autocompletion branch December 25, 2023 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants