Skip to content

Fix heading anchor alignment with heading text and translate its accessibility label#4281

Merged
gregberge merged 2 commits into
mainfrom
greg/rnd-11160-heading-anchors-not-aligned-in-expandable
May 29, 2026
Merged

Fix heading anchor alignment with heading text and translate its accessibility label#4281
gregberge merged 2 commits into
mainfrom
greg/rnd-11160-heading-anchors-not-aligned-in-expandable

Conversation

@gregberge
Copy link
Copy Markdown
Contributor

  • Fix bun.lock
  • Align heading anchor and add missing translation

Copilot AI review requested due to automatic review settings May 28, 2026 14:11
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 28, 2026

RND-11160

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

🦋 Changeset detected

Latest commit: bacf615

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

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

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
Copy Markdown
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 improves document anchor usability by (1) adjusting the heading hash-link icon alignment to better match the heading text baseline and (2) localizing the hash-link accessibility label via the existing translation system. It also updates the lockfile and includes a changeset for a patch release.

Changes:

  • Make Heading and Expandable server components resolve the space language and use a new direct_link_to_heading translation key for aria-labels.
  • Adjust heading hash-link layout (self-center) and require HashLinkButton.label to be explicitly provided.
  • Bump turbo in bun.lock and add a patch changeset.

Reviewed changes

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

Show a summary per file
File Description
packages/gitbook/src/intl/translations/ar.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/bg.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/cs.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/da.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/de.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/el.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/en.ts Adds the new source translation key direct_link_to_heading.
packages/gitbook/src/intl/translations/es.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/et.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/fi.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/fr.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/he.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/hi.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/hr.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/hu.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/id.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/it.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/ja.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/ko.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/lt.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/lv.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/ms.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/nl.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/no.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/pl.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/pt.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/pt-br.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/ro.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/ru.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/sk.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/sl.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/sv.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/th.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/tr.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/uk.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/vi.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/yue.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/zh.ts Adds direct_link_to_heading translation.
packages/gitbook/src/intl/translations/zh-tw.ts Adds direct_link_to_heading translation.
packages/gitbook/src/components/DocumentView/Heading.tsx Aligns hash icon with heading text and localizes the hash-link aria-label (now async).
packages/gitbook/src/components/DocumentView/HashLinkButton.tsx Makes label required (no default) so callers must supply localized aria-labels.
packages/gitbook/src/components/DocumentView/Expandable/Expandable.tsx Localizes the hash-link aria-label for expandable blocks (now async).
bun.lock Updates turbo version.
.changeset/heading-anchor-alignment.md Adds patch changeset entry for the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/gitbook/src/components/DocumentView/Heading.tsx
@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 28, 2026

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

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) 👍 Changes approved 12 changed May 28, 2026, 2:40 PM
customers-v2-vercel (Inspect) 👍 Changes approved 12 changed May 28, 2026, 2:17 PM
v2-cloudflare (Inspect) 👍 Changes approved 24 changed May 28, 2026, 2:25 PM
v2-vercel (Inspect) 👍 Changes approved 9 changed May 28, 2026, 2:23 PM

@gregberge gregberge merged commit 2885a13 into main May 29, 2026
26 of 27 checks passed
@gregberge gregberge deleted the greg/rnd-11160-heading-anchors-not-aligned-in-expandable branch May 29, 2026 07:38
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.

3 participants