Skip to content

[Luna Search] Add menu-bar command for quick access, move to hooks for retrieving data, fix pagination issue, add min-search size - #14174

Merged
raycastbot merged 3 commits into
raycast:mainfrom
relevantsam:main
Aug 27, 2024
Merged

raycastbot merged 3 commits into
raycast:mainfrom
relevantsam:main

Conversation

@relevantsam

@relevantsam relevantsam commented Aug 25, 2024 •

Copy link
Copy Markdown
Contributor

Description

  • Added a new menu bar command that allows the user to quickly access the last 5 recent games they've visited through the extension. These are kept for up to 1 week (if the cache lives that long). Additionally, show the top 5 trending games in the list. Clicking a game opens the game in the most Luna-appropriate browser installed.
  • Fixed an issue that would cause trending games to show in an empty state. It's related to something under the hood in useFetch that doesn't quite work with what I've done here - but I side-stepped it by ignoring the results from fetch in the appropriate places.
  • Fixed an issue where irrelevant previous results would flash between an empty state and search results. Instead, only keep results when the search is forking off of the same search root.
  • Limit searches to only run when only 3+ characters are entered, since anything below this is low quality traffic to the server with low accuracy of results.

  • Noticed that I managed to introduce a nice bug with my pagination changes where a race could occur and an off-by-1 error would hit the user. Sorted!
  • Dug into useFetch and found a nice react-y way to do what I was previously doing with Singletons etc. Hooks are so back. Also meant I could cut axios, so that's neat.
  • Then "Services" didn't make sense anymore so moved to "models"
  • The new hooks let me break down the base component to be much simpler. Less gnarly logic differentiating viewing trending from viewing search results! woo.

Screencast

Screenshot 2024-08-26 at 4 15 45 PM

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: luna-search Issues related to the luna-search extension OP is author The OP of the PR is the author of the extension labels Aug 25, 2024
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for the update! 🎉

You can expect an initial review within five business days.

@relevantsam

Copy link
Copy Markdown
Contributor Author

[@pernielsentikaer] back on #14006 you pointed out I could use useFetch. Had a fun time reworking things and I feel much more satisfied with the layout of the code now! Thanks!

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Thanks really awesome, glad you liked the way it worked 🙂

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi 👋

Thanks for your contribution 💪

I have now tested your extension, and I have some feedback ready for you:

  • When you search for e.g. Lego and delete the search query it still shows the list of games

  • Is it by purpose that you'll need to search for 3 chars before it searches?

  • I couldn't get the pagination to work, do you know something I can search for?

I'm looking forward to testing this extension again 🔥

Request a new review when you are ready. Feel free to contact me here or at Slack if you have any questions.

@relevantsam relevantsam changed the title [Luna Search] Move to hooks for retrieving data, and fix pagination issue [Luna Search] Add menu-nav command for quick access, move to hooks for retrieving data, fix pagination issue, add min-search size Aug 26, 2024
@relevantsam relevantsam changed the title [Luna Search] Add menu-nav command for quick access, move to hooks for retrieving data, fix pagination issue, add min-search size [Luna Search] Add menu-bar command for quick access, move to hooks for retrieving data, fix pagination issue, add min-search size Aug 26, 2024
@relevantsam

Copy link
Copy Markdown
Contributor Author

Thanks Per! Replies in-line.

* When you search for e.g. `Lego` and delete the search query it still shows the list of games

Addressed, thanks for finding! Good 🐛.

* Is it by purpose that you'll need to search for 3 chars before it searches?

Yes - I should've implemented this at first. The 1-2 character searches are low precision and not very useful traffic. I added customer messaging for this case to help.

* I couldn't get the pagination to work, do you know something I can search for?

Any grid that has >15 games uses it! Trending games, for example. It is hard to notice, because it is using the in-memory set of games so the pagination is extremely fast. I only added it because I want to let Raycast's memory controls manage if I load too many images into view for example. The previous bug happened when you went from a paginated view to a non-paginated (if I remember correctly..). So, maybe trending to "Valhalla"?

I'm looking forward to testing this extension again 🔥

Thanks for the hard work!

@pernielsentikaer

Copy link
Copy Markdown
Contributor

MUCH better 🔥

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi 👋

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit ee1fcb9 into raycast:main Aug 27, 2024
@github-actions

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

astrit added a commit to astrit/extensions that referenced this pull request Aug 28, 2024
- Update Detail view
- Add detail and public holidays
- Update title and month to show no gap
- Docs: Update the utils docs
- Update CODEOWNERs
- Update CODEOWNERs
- Add Cursor.sh Doc extension (raycast#14187)
- [Format GraphQL] new action to only format instead of format AND copy (raycast#14217)
- Update CODEOWNERs
- Add metaphorpsum extension (raycast#14124)
- Docs: Update the utils docs
- Update CODEOWNERs
- Add sql-format extension (raycast#14144)
- Update CODEOWNERs
- Add say-no-to-notch extension (raycast#14143)
- Update manifest.md (raycast#14141)
- Add mood track (raycast#14134)
- [NBA-Game-Viewer] Added scores to the viewer (raycast#14188)
- Reduce calls to \`GET:/api/smart-habits\` (raycast#14222)
- Update cron extension (raycast#14199)
- Update CSS*GG (raycast#14202)
- Update CODEOWNERs
- [SnippetSurfer] Make tags optional (raycast#14197)
- Update CODEOWNERs
- [Wikipedia] Move \`igor9silva\` to past contributors (raycast#14214)
- Update CODEOWNERs
- Update CODEOWNERs
- [NBA Game Viewer] Fixes for drop-down default values (raycast#14205)
- [Envato] new logo + TS typing tweaks (minimize use of \`any\`) (raycast#14034)
- [Luna Search] Add menu-bar command for quick access, move to hooks for retrieving data, fix pagination issue, add min-search size (raycast#14174)
- Update CODEOWNERs
- Update Focus extension (raycast#14204)
- Add forgejo extension (raycast#14133)
- Update CODEOWNERs
- Add tidal-controller extension (raycast#14130)
- Update CODEOWNERs
- [Google Maps Search] Travel mode fixes and improvements (raycast#14128)
- Update CODEOWNERs
- Add readeck extension (raycast#14109)
- Update CODEOWNERs
- [diskutil] Upgrades Raycast dependencies for failureToast fix (raycast#14106)
- Update changelog
- raycast#14189 - Fix date starting monday and update default colors
raycastbot pushed a commit that referenced this pull request Aug 29, 2024
* Update cron extension

- #14189 - Fix date starting monday and update default colors
- fix cache calue when no services present (#14192)
- Update scrapbook extension (#14080)
- Update CODEOWNERs
- Update iconpark extension (#14064)
- Update CODEOWNERs
- Update CODEOWNERs
- Update chatgpt extension (#14178)
- Update svgl extension (#14149)
- Update cron extension (#14086)
- [Easydict v2.9.2] 💎 feat: support http API endpoint for OpenAI (#14179)
- Update arc extension (#14185)
- Fix error when reading name from undefined (#14135)
- Update custom-folder extension (#14184)
- Update CODEOWNERs
- [beeminder] Fix data synchronization after a datapoint submission (#14158)
- feat(spotify-player): preference to show only music (#14160)
- Update CODEOWNERs
- Reclaim - Make Smart Habit actions respect override setting / fail API errors silently / only strip planner emojis (#14094)
- Add my new Raycast extension: Dropstab Crypto Toolbox (#14047)
- Update work-time-countdown extension (#14142)
- Update CODEOWNERs
- Add oxford-collocation-dictionary extension (#13959)
- Update \`cPanel\` extension (view dbs + limited add dns record + move url check out of hook) (#14138)
- Update LaunchAgents extension (#14157)
- Update CODEOWNERs
- Add toggle-fn extension (#13942)
- Update remember-the-date extension (#14151)
- [Wikipedia] Add languages (#14167)
- Update CODEOWNERs
- Add thingiverse extension (#13967)
- don\'t show detail if list is empty (#14137)
- Update fantastical extension (#14054)
- Update CODEOWNERs
- Initial commit for @ Profile extension. (#14002)
- Update CODEOWNERs
- Fix LaunchAgents folder creation for inexistent folder (#14053)
- Add Luna Search extension (#14006)
- Update CODEOWNERs
- chore (grafana): use service token instead of api keys (#14087)
- Add \`Remove All Searches\` action for \`spotify-player\` Search command (#14084)
- Update CODEOWNERs
- Added support to select either the NBA or the WNBA - default remains NBA (#13970)
- Update CODEOWNERs
- Update google-search extension (#13887)
- [beeminder] Several updates to the Beeminder extension (#13976)
- Add Bonjour extension (#14046)
- Update claude extension (#14121)
- Update pdf-tools extension (#14118)
- Update cobalt extension (#14052)
- Update CODEOWNERs
- [TablePlus] close #4231 + add dropdown filter (#14116)
- Update app-icon-generator extension (#13847)
- Update CODEOWNERs
- [Everhour] fix #13548 + modernize + add metadata/images,README (#13999)
- Update CODEOWNERs
- [Migadu] cache most results + minor api refactor (#13990)
- Initial version of Threads extension. (#13989)
- Update viacep extension (#14108)
- Deleting my extension ig (#14029)
- [toggl-track] Remove seconds from menubar timer (#13964)
- Update CODEOWNERs
- Add octoprint extension (#13975)
- Update hud.md
- Update CODEOWNERs
- Update text-shortcuts extension (#14033)
- Update vade-mecum extension (#14104)
- Docs: Update the utils docs
- Update CODEOWNERs
- [Notion] Add LaunchContext support for Quick Capture (#13953)
- Update CODEOWNERs
- [Tailwind CSS] Add \`size\` utility classes (#14102)
- [GitHub] Brought back fast browsing to cloned repos. (#13992)
- Update CODEOWNERs
- Add git-buddy extension (#13116)
- Update CODEOWNERs
- [Raycast Notification] Added success and failure notification types (#13958)
- Update CODEOWNERs
- [Linkwarden] fix #13613 (API uses Bearer Auth) (#14070)
- Update olympic-games extension (#14090)
- Update CODEOWNERs
- Update folder search extension (#14077)
- Fix weekdays and change display method

* Update changelog

* Update cron extension

- Update Detail view
- Add detail and public holidays
- Update title and month to show no gap
- Docs: Update the utils docs
- Update CODEOWNERs
- Update CODEOWNERs
- Add Cursor.sh Doc extension (#14187)
- [Format GraphQL] new action to only format instead of format AND copy (#14217)
- Update CODEOWNERs
- Add metaphorpsum extension (#14124)
- Docs: Update the utils docs
- Update CODEOWNERs
- Add sql-format extension (#14144)
- Update CODEOWNERs
- Add say-no-to-notch extension (#14143)
- Update manifest.md (#14141)
- Add mood track (#14134)
- [NBA-Game-Viewer] Added scores to the viewer (#14188)
- Reduce calls to \`GET:/api/smart-habits\` (#14222)
- Update cron extension (#14199)
- Update CSS*GG (#14202)
- Update CODEOWNERs
- [SnippetSurfer] Make tags optional (#14197)
- Update CODEOWNERs
- [Wikipedia] Move \`igor9silva\` to past contributors (#14214)
- Update CODEOWNERs
- Update CODEOWNERs
- [NBA Game Viewer] Fixes for drop-down default values (#14205)
- [Envato] new logo + TS typing tweaks (minimize use of \`any\`) (#14034)
- [Luna Search] Add menu-bar command for quick access, move to hooks for retrieving data, fix pagination issue, add min-search size (#14174)
- Update CODEOWNERs
- Update Focus extension (#14204)
- Add forgejo extension (#14133)
- Update CODEOWNERs
- Add tidal-controller extension (#14130)
- Update CODEOWNERs
- [Google Maps Search] Travel mode fixes and improvements (#14128)
- Update CODEOWNERs
- Add readeck extension (#14109)
- Update CODEOWNERs
- [diskutil] Upgrades Raycast dependencies for failureToast fix (#14106)
- Update changelog
- #14189 - Fix date starting monday and update default colors

* Add changelog
o4liangdu pushed a commit to o4liangdu/extensions that referenced this pull request Sep 14, 2024
liangdu