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
[CommandBar] Enable input & tab pre-population on open #1800
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
Some suggested prefixes and emojis that may help to write clear, actionable code review comments:
Expand for comment prefix descriptions
|
π¦ Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action π€ This PR introduced no changes to the javascript bundle π |
@BRKalow no review required here, but if you've got time to take a peek at the |
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.
working perfectly, thanks Ashlee!
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.
β Followed testing steps, this looks great to me!
I think Algolia has some internal caching, so we could potentially fire off a search query ahead of time to "warm the cache" independent of any react-query usage. The debounce is tricky π€. I think the implementation you've got here is the right one (using the generic command bar utility). Perhaps we could check if the input value is non-empty on first render, and if so set the search query right away. The debounce would only come into play on subsequent updates then. |
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.
LGTM! Your options in the description to explore caching seem like good avenues
@zchsh @BRKalow @kendallstrautman just a heads up about the follow-up optimization work -- I created an Asana task co-located with my other tasks for this project! ποΈ Explore options for eliminating the flash of the Global Search buttons in the search card The TL;DR is -- timebox 4 hours to explore the current 4 ideas we have, report the findings, and propose 1 to the team (just via Slack probably) for discussion. |
π Relevant links
ποΈ What
<button>
s to the featured search cardsetCurrentInputValue
andtoggleIsOpen
helpers exposed byCommandBar
contentType
of theHomePageView
to'tutorials'
CommandBar
show the"Tutorials"
tab by default"global"
contentType
π§ͺ Testing
<button>
in the"Search with ease"
featured card:π Anything else?
CommandBar
is opened with these buttons. This is becauseSearchCommandBarDialogBody
waits to send off search queries for300ms
after the text input is finished changes, and because of the search results loading delay. This isn't ideal, and I'm thinking through a couple of options for optimizing this before release. This PR will not optimize this.setSearchQuery
helper fromSearchCommandBarDialogBody
. This doesn't feel super ideal because it's not intended to be used as a utility, it's still a feasible and low-effort option. However, it will only remove the 300ms before the search query is sent off. It will not help the results loading delay (an existing issue).