Skip to content

Conversation

@nolannbiron
Copy link
Member

@nolannbiron nolannbiron commented Nov 12, 2025

Introduces filtering of hidden site spaces when parsing site context, sections, and groups. Ensures only visible site spaces are included.

@changeset-bot
Copy link

changeset-bot bot commented Nov 12, 2025

🦋 Changeset detected

Latest commit: 56b3aa2

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
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 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 filterHiddenSiteSpaces and filterHiddenSiteSpacesFromSections utility functions to filter hidden spaces
  • Modified parseSiteSectionsAndGroups to apply filtering recursively across sections and groups
  • Updated fetchSiteContextByIds to filter hidden spaces for both siteSpaces and sections structure 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 checkIsRootSiteContext function uses unfiltered sections from getSiteStructureSections, which may include hidden site spaces. This creates inconsistency with the filtered context.sections data. 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.
@argos-ci
Copy link

argos-ci bot commented Nov 17, 2025

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

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 28 changed Nov 18, 2025, 2:57 PM
v2-cloudflare (Inspect) 👍 Changes approved 7 changed Nov 17, 2025, 10:13 PM
v2-vercel (Inspect) 👍 Changes approved 2 changed Nov 18, 2025, 3:01 PM

@nolannbiron nolannbiron force-pushed the nolann/support-hidden-spaces branch from 01b5959 to 56b3aa2 Compare November 17, 2025 22:03
Copy link
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

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.

@nolannbiron nolannbiron merged commit 04a4175 into main Nov 18, 2025
28 of 30 checks passed
@nolannbiron nolannbiron deleted the nolann/support-hidden-spaces branch November 18, 2025 21:49
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