-
Notifications
You must be signed in to change notification settings - Fork 4k
Improve tabs #3735
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?
Improve tabs #3735
Conversation
|
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 enhances the tabs component by improving URL hash handling, fixing layout issues, and adding overflow menu functionality. The changes enable better tab navigation with URL synchronization while maintaining proper accessibility and visual presentation.
Key changes:
- Tabs now update the URL hash when selected, and tab selection is synchronized with URL hash changes
- Layout fixes allow clicking anywhere on the tab (not just the text) and properly display full tab labels
- Overflowing tabs are automatically moved to a dropdown menu with ellipsis icon
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
packages/gitbook/src/components/utils/link.ts | Added check to treat anchor links as internal links |
packages/gitbook/src/components/hooks/useHash.tsx | Enabled navigation tracking for hash changes by removing hash exclusion and removing extraneous blank line |
packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx | Major refactoring: implemented URL hash synchronization, overflow detection with dropdown menu, and improved tab button layout |
packages/gitbook/src/components/DocumentView/HashLinkButton.tsx | Replaced anchor tag with Link component and consolidated styling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Improve the tabs:
Actual
New UX
CleanShot.2025-10-16.at.22.50.27.mp4