Movatterモバイル変換


[0]ホーム

URL:


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

Fix reusable content cross-space page reference resolution#3321

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
emmerich wants to merge5 commits intomain
base:main
Choose a base branch
Loading
fromfix/reusable-content-cross-space-references

Conversation

emmerich
Copy link
Contributor

Summary

  • Fixed broken links to pages in the parent space of reusable content when used across different sites
  • Added parentSpaceContext to GitBookSpaceContext type for tracking parent space information
  • Enhanced resolveContentRef to check parent space when page resolution fails in current space
  • Added comprehensive unit tests for the new functionality

Background

When reusable content contains links to pages in its parent space, these links were broken when the reusable content was used in a different space/site. This happened because thepages array was set to[] for cross-space reusable content to prevent unwanted cross-site linking.

Solution

The fix introduces aparentSpaceContext field inGitBookSpaceContext that preserves information about the parent space (where the reusable content originates). When page resolution fails in the current space, the system now checks the parent space and uses the existingresolveContentRefInSpace function to generate proper absolute URLs.

Changes

  • GitBookSpaceContext type: Added optionalparentSpaceContext field
  • ReusableContent component: Now includes parent space context when rendering cross-space content
  • resolveContentRef function: Added fallback logic to check parent space for page resolution
  • Unit tests: Comprehensive test coverage for the new functionality

Test plan

  • Unit tests pass for all new functionality
  • Existing functionality remains intact (tests pass)
  • Cross-space links resolve to absolute URLs for security
  • Same-space reusable content behavior unchanged
  • Manual testing with actual reusable content across different sites

🤖 Generated withClaude Code

- Add parentSpaceContext to GitBookSpaceContext type for tracking parent space information- Update ReusableContent component to include parent space context when rendering content from different spaces- Enhance resolveContentRef to check parent space when page resolution fails in current space- Add comprehensive unit tests for the new parent space fallback functionalityThis resolves broken links to pages in the parent space of reusable content when used across different sites.🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
@changeset-botchangeset-bot
Copy link

changeset-botbot commentedJun 14, 2025
edited
Loading

⚠️ No Changeset found

Latest commit:fac5fcf

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

@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedJun 14, 2025
edited
Loading

Summary of the deployments:

Version 1

VersionURLStatus
Latest commithttps://d3d2e923.gitbook-open.pages.dev
PRhttps://pr3321.gitbook-open.pages.dev

Version 2

VersionURLStatus
Vercelhttps://gitbook-v2-3m2qzjv73-gitbook.vercel.app
Cloudflarehttps://6a2b355f-gitbook-open-v2-preview.gitbook.workers.dev

Test content

Sitev12v2c
GitBookhttps://d3d2e923.gitbook-open.pages.dev/gitbook.com/docshttps://gitbook-v2-3m2qzjv73-gitbook.vercel.app/url/gitbook.com/docshttps://6a2b355f-gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs
E2Ehttps://d3d2e923.gitbook-open.pages.dev/gitbook.gitbook.io/test-gitbook-openhttps://gitbook-v2-3m2qzjv73-gitbook.vercel.app/url/gitbook.gitbook.io/test-gitbook-openhttps://6a2b355f-gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.gitbook.io/test-gitbook-open

@argos-ciArgos CI
Copy link

argos-cibot commentedJun 14, 2025
edited
Loading

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

BuildStatusDetailsUpdated (UTC)
customers-v1 (Inspect)✅ No changes detected-Jun 14, 2025, 1:01 PM
customers-v2 (Inspect)⚠️ Changes detected (Review)77 changedJun 14, 2025, 1:03 PM
default (Inspect)⚠️ Changes detected (Review)5 changedJun 14, 2025, 1:03 PM
v2-cloudflare (Inspect)✅ No changes detected-Jun 14, 2025, 1:05 PM
v2-vercel (Inspect)✅ No changes detected-Jun 14, 2025, 1:05 PM

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@emmerich

[8]ページ先頭

©2009-2025 Movatter.jp