Skip to content

Prefer visible folder children when deriving navigation indexes#3451

Merged
theletterf merged 3 commits into
mainfrom
copilot/fix-hidden-documents-in-navigation
Jun 2, 2026
Merged

Prefer visible folder children when deriving navigation indexes#3451
theletterf merged 3 commits into
mainfrom
copilot/fix-hidden-documents-in-navigation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 2, 2026

Hidden docs referenced inside folders without an index.md could become the folder’s effective index, which caused them to surface in root navigation as the folder link/title. This change makes folder/index resolution prefer visible children and keeps folders hidden when all of their children are hidden.

  • Navigation index selection

    • Update QueryIndex to choose the first visible child before falling back to a hidden one.
    • Preserve existing behavior for fully hidden groups by still allowing a hidden fallback when no visible child exists.
  • Folder / TOC hidden-state propagation

    • Make folder and nested TOC nodes inherit Hidden from their resolved index.
    • This prevents a folder with only hidden children from appearing as a visible navigation node.
  • Regression coverage

    • Add focused tests for:
      • a folder without index.md whose first child is hidden and second child is visible
      • a folder without index.md whose only child is hidden
- folder: user-guide
  children:
    - hidden: autopilot.md
    - file: getting-started.md

With this change, the folder resolves to getting-started.md for its title/URL instead of surfacing autopilot.md.

@theletterf theletterf marked this pull request as ready for review June 2, 2026 13:42
@theletterf theletterf requested a review from a team as a code owner June 2, 2026 13:42
@theletterf theletterf requested a review from Mpdreamz June 2, 2026 13:42
Copilot AI had a problem deploying to integration-tests June 2, 2026 13:42 Failure
Copilot AI changed the title [WIP] Fix root menu display of hidden documents Prefer visible folder children when deriving navigation indexes Jun 2, 2026
Copilot AI requested a review from theletterf June 2, 2026 13:49
Copilot AI temporarily deployed to integration-tests June 2, 2026 13:56 Inactive
@theletterf theletterf added the fix label Jun 2, 2026
@theletterf theletterf merged commit 092ae43 into main Jun 2, 2026
24 of 25 checks passed
@theletterf theletterf deleted the copilot/fix-hidden-documents-in-navigation branch June 2, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documents appear in root menu despite being hidden in folder (navigation behavior)

3 participants