Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs-yml.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6053,7 +6053,7 @@
"type": "null"
}
],
"description": "If `mobile-toc` is set to true, a sticky collapsible table of contents bar will be shown on mobile viewports for guide and overview layout pages."
"description": "A sticky collapsible table of contents bar is shown on mobile viewports for guide and overview layout pages by default. Set `mobile-toc` to false to disable it."
}
},
"additionalProperties": false
Expand Down
2 changes: 1 addition & 1 deletion fern/apis/docs-yml/definition/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ types:
type: optional<boolean>
availability: in-development
docs: |
If `mobile-toc` is set to true, a sticky collapsible table of contents bar will be shown on mobile viewports for guide and overview layout pages.
A sticky collapsible table of contents bar is shown on mobile viewports for guide and overview layout pages by default. Set `mobile-toc` to false to disable it.

DocsSettingsConfig:
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- summary: |
Switch mobile-toc default from opt-in (false) to opt-out (true) so the
mobile table of contents is enabled for all documentation sites by default.
type: feat

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Minimal layout path omits mobileToc, creating inconsistency with the new default

When layout == null but theme tabs properties are set, convertLayoutConfig returns a minimal layout object at packages/cli/configuration-loader/src/docs-yml/parseDocsConfiguration.ts:634-637 that does NOT include mobileToc. This means mobileToc will be undefined in the returned object. Previously, undefined and the old default false were semantically equivalent (both falsy). With the new default of true, there's a potential inconsistency: configs that specify a layout: section get mobileToc: true, while configs that only set theme tabs (no layout) get mobileToc: undefined. Whether this matters depends on how the downstream consumer (the Fern docs platform) treats undefined for this field — if it defaults to false, users without a layout: section won't get the mobile TOC. The same pattern exists for disableHeader, hideNavLinks, and hideFeedback, so this is a pre-existing architectural pattern rather than a new bug, but it's worth verifying the consumer-side default was also updated.

(Refers to lines 632-637)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The consumer-side default was updated in the companion PR (fern-platform#12578). Both readonly-docs-loader.ts and ledger-docs-loader.ts now use config.layout?.mobileToc ?? true, so when mobileToc is undefined (from either no layout section or an explicit layout without the field), it correctly defaults to true. This is the same pre-existing pattern used by disableHeader, hideNavLinks, and hideFeedback.

Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ function convertLayoutConfig(
disableHeader: layout.disableHeader ?? false,
hideNavLinks: layout.hideNavLinks ?? false,
hideFeedback: layout.hideFeedback ?? false,
mobileToc: layout.mobileToc ?? false,
mobileToc: layout.mobileToc ?? true,
tabsAlignment: resolvedTabsAlignment
} as unknown as docsYml.ParsedDocsConfiguration["layout"];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ export interface LayoutConfig {
hideNavLinks?: boolean;
/** If `hide-feedback` is set to true, the feedback button will not be rendered. This can be overridden for a specific page using the frontmatter. */
hideFeedback?: boolean;
/** If `mobile-toc` is set to true, a sticky collapsible table of contents bar will be shown on mobile viewports for guide and overview layout pages. */
/** A sticky collapsible table of contents bar is shown on mobile viewports for guide and overview layout pages by default. Set `mobile-toc` to false to disable it. */
mobileToc?: boolean;
}
2 changes: 1 addition & 1 deletion packages/cli/workspace/loader/src/docs-yml.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6053,7 +6053,7 @@
"type": "null"
}
],
"description": "If `mobile-toc` is set to true, a sticky collapsible table of contents bar will be shown on mobile viewports for guide and overview layout pages."
"description": "A sticky collapsible table of contents bar is shown on mobile viewports for guide and overview layout pages by default. Set `mobile-toc` to false to disable it."
}
},
"additionalProperties": false
Expand Down
Loading