- Notifications
You must be signed in to change notification settings - Fork 4k
Inline search modal #3416
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
base: main
Are you sure you want to change the base?
Inline search modal #3416
Conversation
🦋 Changeset detectedLatest commit: fd26ee2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
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.
Not approving yet, we need to QA even more as it's a critical change
// Separate local state for isOpen (not synchronized with URL) | ||
// Default to true if there's already a query in the URL |
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.
Why do you need a separate state?
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.
Because having this open
prop in the URL looks messy and feels unnecessary have in there all the time. It's a very transient state that shouldn't be explicit, I believe at least.
Since we're using nuqs all of the state in rawState
will be synced to query parameters. There is a way to have state be managed by nuqs but exclude the query param, but it's hacky: you have to set an infinite throttle timeout on the open
parameter so that it's being delayed forever.
open: parseAsBoolean.withOptions({ throttleMs: Number.POSITIVE_INFINITY })
This is why it feels cleaner to me to manage this state separately as normal React state.
query.ask ? searchParams.set('ask', 'on') : searchParams.delete('ask'); | ||
query.global ? searchParams.set('global', 'on') : searchParams.delete('global'); |
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.
Let's change this in case some used this URL; let's avoid useless breaking chnages
No description provided.