Fix heading anchor alignment with heading text and translate its accessibility label#4281
Conversation
gregberge
commented
May 28, 2026
- Fix bun.lock
- Align heading anchor and add missing translation
🦋 Changeset detectedLatest commit: bacf615 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 |
There was a problem hiding this comment.
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
HeadingandExpandableserver components resolve the space language and use a newdirect_link_to_headingtranslation key for aria-labels. - Adjust heading hash-link layout (
self-center) and requireHashLinkButton.labelto be explicitly provided. - Bump
turboinbun.lockand 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.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|