Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
gregberge merged 6 commits into main from greg/rnd-5530-tabs-should-scale-to-more-tab-items
Oct 17, 2025
Merged

Conversation

@gregberge
Copy link
Contributor

@gregberge gregberge commented Oct 16, 2025
edited
Loading

Improve the tabs:

  • Fix the tab selection from the anchor in the URL
  • Remove the anchor from it, now if we click on a tab it changes the URL
  • Fix the layout issue, now we can click on every part of the tab
  • We now display the full label of the tab and we automatically display tabs that does not fit in a menu

Actual

CleanShot 2025年10月16日 at 23 04 33@2x

New UX

CleanShot.2025年10月16日.at.22.50.27.mp4

Copy link

linear bot commented Oct 16, 2025

Copy link

changeset-bot bot commented Oct 16, 2025
edited
Loading

⚠️ No Changeset found

Latest commit: bcdf87a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

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 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.

Copy link

argos-ci bot commented Oct 16, 2025
edited
Loading

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

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 9 changed Oct 17, 2025, 9:56 AM
v2-cloudflare (Inspect) 👍 Changes approved 11 changed Oct 17, 2025, 10:00 AM
v2-vercel (Inspect) 👍 Changes approved 10 changed Oct 17, 2025, 9:59 AM

Copy link
Contributor

@BrettJephson BrettJephson left a comment

Choose a reason for hiding this comment

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

Looks good to me

@gregberge gregberge merged commit c0d73d2 into main Oct 17, 2025
16 checks passed
@gregberge gregberge deleted the greg/rnd-5530-tabs-should-scale-to-more-tab-items branch October 17, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

@BrettJephson BrettJephson BrettJephson approved these changes

@zenoachtig zenoachtig Awaiting requested review from zenoachtig

@SamyPesse SamyPesse Awaiting requested review from SamyPesse

@clairechabas clairechabas Awaiting requested review from clairechabas

@nolannbiron nolannbiron Awaiting requested review from nolannbiron

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /