Skip to content

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

Conversation

zenoachtig
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Jul 1, 2025

🦋 Changeset detected

Latest commit: fd26ee2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Minor

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

Copy link

argos-ci bot commented Jul 1, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 168 changed Jul 10, 2025, 9:00 AM
v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 679 changed Jul 10, 2025, 9:05 AM
v2-vercel (Inspect) 👍 Changes approved 687 changed Jul 10, 2025, 9:03 AM
Copy link
Member

@SamyPesse SamyPesse left a 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

Comment on lines 32 to 33
// Separate local state for isOpen (not synchronized with URL)
// Default to true if there's already a query in the URL
Copy link
Member

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?

Copy link
Contributor Author

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.

Comment on lines -81 to -82
query.ask ? searchParams.set('ask', 'on') : searchParams.delete('ask');
query.global ? searchParams.set('global', 'on') : searchParams.delete('global');
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants