-
Notifications
You must be signed in to change notification settings - Fork 4k
Remove hidden site spaces from navigation #3795
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
Conversation
🦋 Changeset detectedLatest commit: 56b3aa2 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 |
efadc96 to
3f3eedf
Compare
There was a problem hiding this 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 introduces filtering to remove hidden site spaces from navigation structures while preserving the current site space even if it's hidden. This ensures only visible site spaces are shown in the navigation while maintaining context accuracy for the active space.
Key changes:
- Added
filterHiddenSiteSpacesandfilterHiddenSiteSpacesFromSectionsutility functions to filter hidden spaces - Modified
parseSiteSectionsAndGroupsto apply filtering recursively across sections and groups - Updated
fetchSiteContextByIdsto filter hidden spaces for bothsiteSpacesandsectionsstructure types
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/gitbook/src/lib/context.ts | Adds filtering functions and applies them to site context parsing to exclude hidden site spaces from navigation |
| .changeset/three-melons-enjoy.md | Documents the patch-level change for removing hidden site spaces from navigation |
Comments suppressed due to low confidence (1)
packages/gitbook/src/lib/context.ts:422
- The
checkIsRootSiteContextfunction uses unfiltered sections fromgetSiteStructureSections, which may include hidden site spaces. This creates inconsistency with the filteredcontext.sectionsdata. The function should either use the already-filtered sections from the context or apply the same filtering logic to ensure consistency.
return getSiteStructureSections(structure, { ignoreGroups: true }).some(
(structure) =>
structure.default &&
structure.id === context.sections?.current.id &&
structure.siteSpaces.some(
(siteSpace) => siteSpace.default && siteSpace.id === context.siteSpace.id
)
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Introduces filtering of hidden site spaces when parsing site context, sections, and groups. Ensures only visible site spaces are included unless they match the current site space ID, improving context accuracy for site structure handling.
bc1ad9e to
4e4ac25
Compare
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
61e83f8 to
ab1dafe
Compare
ab1dafe to
91dd592
Compare
91dd592 to
01b5959
Compare
01b5959 to
56b3aa2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Introduces filtering of hidden site spaces when parsing site context, sections, and groups. Ensures only visible site spaces are included.