Skip to content

feat: include hidden items in nav tree with hidden flag#1028

Merged
dslovinsky merged 2 commits intomainfrom
ds/show-hidden-nav
Feb 12, 2026
Merged

feat: include hidden items in nav tree with hidden flag#1028
dslovinsky merged 2 commits intomainfrom
ds/show-hidden-nav

Conversation

@dslovinsky
Copy link
Collaborator

Summary

  • Hidden pages, sections, and API refs now emit nav items with hidden: true instead of being omitted from the Redis nav tree
  • Algolia records are still skipped for hidden items (no change to search behavior)
  • Companion PR in docs-site: https://github.com/OMGWINNING/docs-site/pull/187

What changed

  • types/navigation.ts — Added hidden?: boolean to BaseNavItem
  • visit-page.ts — Always emits nav item; adds hidden: true when page is hidden
  • visit-section.ts — Emits section with hidden: true instead of returning undefined
  • process-openapi.ts — Removed early return for hidden; marks nav items with hidden: true
  • process-openrpc.ts — Same as OpenAPI
  • Updated all related tests to expect hidden: true nav items instead of undefined

Test plan

  • All 376 existing tests pass
  • Run indexer against current docs.yml and verify hidden sections (e.g. Admin API) appear in nav tree with hidden: true
  • Verify Algolia records are still excluded for hidden items
  • End-to-end with docs-site PR: hidden pages show in sidebar only when actively browsed

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

🌿 Documentation Preview

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Feb 12, 2026, 7:32 PM

@github-actions github-actions bot temporarily deployed to docs-preview February 12, 2026 18:52 Destroyed
@dslovinsky dslovinsky marked this pull request as ready for review February 12, 2026 19:12
@dslovinsky dslovinsky requested a review from a team as a code owner February 12, 2026 19:12
Copilot AI review requested due to automatic review settings February 12, 2026 19:12
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

Updates the content indexer to keep hidden pages/sections/API references in the generated nav tree by emitting nav items with hidden: true (while continuing to exclude hidden items from Algolia indexing).

Changes:

  • Added hidden?: boolean to the base navigation item type.
  • Updated visitors/processors to emit nav items for hidden content and mark them with hidden: true instead of returning undefined.
  • Updated unit tests to assert hidden nav items are present and flagged.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/content-indexer/types/navigation.ts Adds hidden?: boolean to nav item base type to support hidden flags.
src/content-indexer/visitors/visit-page.ts Always returns a page nav item; marks it hidden and skips Algolia when hidden.
src/content-indexer/visitors/visit-section.ts Keeps hidden sections in nav (with flag) unless there are no children.
src/content-indexer/visitors/processors/process-openapi.ts Keeps hidden API nav (with flag) while skipping Algolia breadcrumbs/records.
src/content-indexer/visitors/processors/process-openrpc.ts Keeps hidden RPC nav (with flag) while maintaining indexing behavior.
src/content-indexer/visitors/tests/visit-page.test.ts Updates expectations for hidden pages to return hidden: true nav items.
src/content-indexer/visitors/tests/visit-section.test.ts Updates expectations for hidden sections to return hidden: true nav items.
src/content-indexer/visitors/tests/visit-api-reference.test.ts Updates expectations for hidden API refs to return hidden: true nav items.
src/content-indexer/visitors/processors/tests/process-openrpc.test.ts Updates expectations for hidden OpenRPC to return hidden: true nav items.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

title: pageItem.page,
path: `/${finalPath}`,
type: "page",
description,
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is always emitted as a property even when it is undefined, which means navItem will contain description: undefined. This can break strict deep-equality expectations and produces noisier serialized output. Consider only including description when it’s defined (e.g., via conditional object spread), and update the related test expectations accordingly.

Suggested change
description,
...(description !== undefined ? { description } : {}),

Copilot uses AI. Check for mistakes.

// Only include section in nav if it has children and is not hidden
if (children.length === 0 || sectionItem.hidden) {
// Skip section from nav if it has no visible children
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says “no visible children”, but children is only filtered for undefined (not for hidden), so this condition is actually “no children”. Update the comment to match the actual behavior (e.g., “no children”) to avoid confusion.

Suggested change
// Skip section from nav if it has no visible children
// Skip section from nav if it has no children

Copilot uses AI. Check for mistakes.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2807f76a0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// Only include section in nav if it has children and is not hidden
if (children.length === 0 || sectionItem.hidden) {
// Skip section from nav if it has no visible children
if (children.length === 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude sections whose children are all hidden

Now that hidden pages/API items are emitted with hidden: true, children can be non-empty even when every child is hidden. This guard only checks children.length === 0, so a non-hidden section with only hidden descendants is still emitted as visible, which can surface empty section headers once consumers filter hidden items. The section-visibility check should consider whether any child is actually visible (or mark the section hidden when all descendants are hidden).

Useful? React with 👍 / 👎.

@github-actions github-actions bot temporarily deployed to docs-preview February 12, 2026 19:28 Destroyed
dslovinsky and others added 2 commits February 12, 2026 14:28
Previously, hidden pages/sections/APIs were excluded from the navigation
tree stored in Redis. Now they are included with `hidden: true` so the
docs-site can conditionally show them when the user is browsing a hidden
page. Algolia records are still skipped for hidden items.

Co-Authored-By: Claude <noreply@anthropic.com>
Prevents empty section headers from appearing when consumers filter
hidden items. Also fixes misleading comment ("no visible children"
→ "no children").

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot temporarily deployed to docs-preview February 12, 2026 19:30 Destroyed
@dslovinsky
Copy link
Collaborator Author

@claude @codex Ready for review.

This PR changes the content indexer to emit hidden pages/sections/APIs with hidden: true in the nav tree instead of omitting them. Companion docs-site PR: https://github.com/OMGWINNING/docs-site/pull/187

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@dslovinsky dslovinsky merged commit 317d943 into main Feb 12, 2026
8 of 9 checks passed
@dslovinsky dslovinsky deleted the ds/show-hidden-nav branch February 12, 2026 22:15
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.

2 participants