feat(docs): switch mobile-toc default from opt-in to opt-out#16685
feat(docs): switch mobile-toc default from opt-in to opt-out#16685matlegault wants to merge 2 commits into
Conversation
Change the default value of mobileToc from false to true so the mobile table of contents is enabled for all documentation sites by default. Users can still disable it by setting mobile-toc: false in docs.yml. Also updates the docs.yml API definition description to reflect the new opt-out behavior. Co-Authored-By: mathieu <mathieu@buildwithfern.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
🚩 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)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
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.
Docs Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on
Docs generation runs |
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
Description
Switch the
mobileTocdefault fromfalse(opt-in) totrue(opt-out) so the mobile table of contents is enabled for all documentation sites by default. Users can still disable it by settingmobile-toc: falsein theirdocs.yml.Changes Made
parseDocsConfiguration.ts:mobileToc: layout.mobileToc ?? true(was?? false)docs.ymlAPI definition: updated description to reflect opt-out behaviorLayoutConfig.tsSDK type: updated JSDoc commentdocs-yml.schema.jsonfiles: updated description textfeat)Testing
Link to Devin session: https://app.devin.ai/sessions/dc05e99eb0c8464e85d2bf949350adf1
Requested by: @matlegault