Fix page link titles showing site section name instead of target space title (#4542) - #4543
Open
kaicode wants to merge 2 commits into
Open
Fix page link titles showing site section name instead of target space title (#4542)#4543kaicode wants to merge 2 commits into
kaicode wants to merge 2 commits into
Conversation
kaicode
requested a deployment
to
preview-approval
August 25, 2026 12:18 — with
GitHub Actions
Waiting
🦋 Changeset detectedLatest commit: e06c536 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 |
Contributor
|
@tgargula Can you make the necessary updates to the branch and workflows and merge this please? Want to make sure we are getting this solved for them asap :) |
Contributor
|
Summary of the deployments:
Test content
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a regression introduced in #4525 (RND-12437) where Page Link blocks and other space refs displayed the site section title (e.g. "Practical Guides") instead of the target site-space title (e.g. "SNOMED CT EHR Requirements Guide") on preview and published sites.
Root cause: #4525 changed
getSpaceRefText()to prefer the containing section title forresolved.text. Page Link blocks (content-ref) renderresolved.textdirectly as the card title. On multi-space sites where each guide is its own space grouped under one section, every cross-space link in that section showed the same section name.Fix:
getSpaceRefText()to return the site-space (variant) title, falling back to the raw space title.resolved.ancestorsvia a newgetSpaceRefSectionLabel()helper, preserving the original RND-12437 intent for link preview breadcrumbs/tooltips without affecting card display text.Reported by: SNOMED CT Document Library (
docs.snomed.org) — all Page Link blocks under "Functional Guides" rendered as "Practical Guides".Suggested Test plan
bun test packages/gitbook/src/lib/references.test.ts --preload ./tests/preload-bun.ts— all 23 tests passThe following items are suggested to complete testing. I have not done these yet. Let me know if I should set up a development environment and complete these myself.