-
Notifications
You must be signed in to change notification settings - Fork 4k
Refactor site section tabs #3655
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
Conversation
🦋 Changeset detectedLatest commit: 16ea929 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.
Pull Request Overview
This PR refactors the site section tabs to simplify the component composition and fix animation/rendering issues with the site section group popover. The refactor consolidates the SiteSectionTabs component to manage the entire secondary navigation bar and improves styling consistency.
- Simplifies SiteSectionTabs to handle the full secondary nav bar layout and composition
- Replaces custom tab styling with Button component for better consistency and focus states
- Fixes viewport positioning and animation issues for section group dropdowns
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/gitbook/src/components/primitives/Button.tsx | Adds focus and open state styling for blank variant buttons |
packages/gitbook/src/components/SiteSections/SiteSectionTabs.tsx | Major refactor to consolidate navigation layout and use Button components |
packages/gitbook/src/components/RootLayout/globals.css | Adds max-height for horizontal scrollbars |
packages/gitbook/src/components/Header/SpacesDropdown.tsx | Adjusts padding for translations dropdown styling |
packages/gitbook/src/components/Header/Header.tsx | Simplifies header layout by delegating to refactored SiteSectionTabs |
.changeset/spicy-boats-change.md | Adds changeset for the refactor |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Simplifying the section tabs menu in anticipation of the new site section group headers.
SiteSectionTabs
to be solely responsible for the whole secondary nav bar, simplifying composition and layout<Button>
to show section tabs, giving us better and more consistent active and focus statesExamples
CleanShot.2025-09-15.at.18.26.22.mp4
Notice the bad sizing transition at the beginning, which isn't there in the new version
CleanShot.2025-09-15.at.18.26.58.mp4
CleanShot.2025-09-15.at.18.28.31.mp4
CleanShot.2025-09-15.at.18.27.51.mp4