Skip to content

Conversation

zenoachtig
Copy link
Contributor

Components

  • Add data-active to Button to make styling easier
  • Improve active style for blank buttons in contrast-more mode
  • Add leading icon to DropdownMenuItem, to be further standardised in other places in follow-up PR
  • Create SegmentedControl component that styles buttons to look like one big selector.

Search

  • Rework global search parameter into two separate ones to determine search scope:
    • scope: all | current: how "wide" to search on the site. Determines section scope.
    • depth: single | full: how "deep" to search within the scope. This determines the variant scope within sections.
  • Change SearchScopeToggle to use new scope & depth params and segmented control to show a UI to switch between scopes.

Demo

CleanShot.2025-09-10.at.17.26.59.mp4
CleanShot 2025-09-11 at 12 07 14@2x CleanShot 2025-09-11 at 12 10 19@2x

**Components:**
- Add `data-active` to `Button` to make styling easier
- Improve active style for blank buttons in `contrast-more` mode
- Add leading icon to `DropdownMenuItem`, to be further standardised in other places in follow-up PR
- Create `SegmentedControl` component that styles buttons to look like one big selector.

**Search**:
- Rework `global` search parameter into two separate ones to determine search scope:
  - `scope: all | current`: how "wide" to search on the site. Determines section scope.
  - `depth: single | full`: how "deep" to search within the scope. This determines the variant scope within sections.
- Change `SearchScopeToggle` to use new scope & depth params and segmented control to show a UI to switch between scopes.
Copy link

linear bot commented Sep 11, 2025

Copy link

changeset-bot bot commented Sep 11, 2025

🦋 Changeset detected

Latest commit: 1bf0682

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 Sep 11, 2025

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

Build Status Details Updated (UTC)
customers-v2 (Inspect) ⚠️ Changes detected (Review) 3 changed Sep 12, 2025, 9:49 AM
v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 8 changed Sep 12, 2025, 9:54 AM
v2-vercel (Inspect) ⚠️ Changes detected (Review) 9 changed Sep 12, 2025, 9:53 AM

Copy link
Contributor Author

@zenoachtig zenoachtig left a comment

Choose a reason for hiding this comment

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

Just need to add new string translations

@zenoachtig zenoachtig requested a review from Copilot September 11, 2025 13:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the search functionality to provide more granular control over search scope across site sections and variants. It replaces the simple boolean global parameter with two new parameters (scope and depth) and introduces a new segmented control UI component.

  • Replaces boolean global search parameter with scope (all/current) and depth (single/full) parameters
  • Creates new SegmentedControl component for improved search scope selection UI
  • Adds leadingIcon support to DropdownMenuItem and data-active attribute to Button components

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/gitbook/src/components/primitives/SegmentedControl.tsx New component providing segmented control UI for search scope selection
packages/gitbook/src/components/primitives/DropdownMenu.tsx Adds leading icon support and increases z-index
packages/gitbook/src/components/primitives/Button.tsx Adds data-active attribute and improves styling
packages/gitbook/src/components/Search/useSearch.tsx Replaces global boolean with scope/depth parameters
packages/gitbook/src/components/Search/server-actions.tsx Refactors search functions to handle new scope parameters
packages/gitbook/src/components/Search/SearchScopeToggle.tsx Complete rewrite using SegmentedControl component
packages/gitbook/src/components/Search/SearchResults.tsx Updates to use new scope/depth parameters
packages/gitbook/src/components/Search/SearchContainer.tsx Updates prop interface and search logic
packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx Updates SearchContainer props
packages/gitbook/src/components/Header/Header.tsx Updates SearchContainer props
packages/gitbook/src/components/AI/useAIChat.tsx Updates to use new search parameters
packages/gitbook/src/components/AI/useAI.tsx Updates to use new search parameters

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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