From 0f5db333b93e937ce613cd4f8df8cd99a9f24d24 Mon Sep 17 00:00:00 2001 From: Pat Capulong Date: Tue, 30 Jun 2026 17:57:03 -0700 Subject: [PATCH] Default the playground sidebar to expanded, not collapsed The playground (global-accounts/demo) collapsed the docs sidebar by default, which made it easy to miss that the full documentation is a click away. Default it to expanded like every other page (it follows the saved preference), so the nav is visible up front; the rail is still there to collapse for more room. Drops the now-unused demo-path special case from the JS and the pre-paint script. Co-authored-by: Cursor --- mintlify/docs.json | 2 +- mintlify/sidebar-toggle.js | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/mintlify/docs.json b/mintlify/docs.json index 47852899..f74c8476 100644 --- a/mintlify/docs.json +++ b/mintlify/docs.json @@ -446,7 +446,7 @@ }, "footer": {}, "head": { - "raw": "", + "raw": "", "links": [ { "rel": "preload", diff --git a/mintlify/sidebar-toggle.js b/mintlify/sidebar-toggle.js index a48c758c..866634c3 100644 --- a/mintlify/sidebar-toggle.js +++ b/mintlify/sidebar-toggle.js @@ -12,10 +12,6 @@ (function () { var DESKTOP_MIN = 1024; var KEY = 'ls-nav-collapsed'; - // NOTE: keep in sync with the demo-path check in docs.json head.raw — the - // pre-paint script collapses the playground before this runs (no flash). The - // path lives in both because the pre-paint must run inline, before this file. - var DEMO_PATHS = ['/global-accounts/demo', '/global-accounts/demo/']; var MIN_WIDTH = 280; // the original sidebar width — only resizes wider var MAX_WIDTH = 420; var SNAP_COLLAPSE = 240; // drag left past this x -> collapse @@ -27,10 +23,6 @@ return window.innerWidth >= DESKTOP_MIN; } - function isDemo() { - return DEMO_PATHS.indexOf(location.pathname) !== -1; - } - // #sidebar-content is in the DOM on every docs page, but custom-layout pages // (frontmatter mode: "custom", e.g. the flow builder) keep it and hide it // (display:none). getClientRects() is empty for a non-rendered element, so this @@ -66,11 +58,10 @@ document.documentElement.style.setProperty('--ls-sidebar-width', w + 'px'); } - // The playground (demo) always starts collapsed — it needs the horizontal - // space — regardless of the saved preference. Every other page follows the - // remembered preference (default expanded). + // Follow the saved preference; default expanded everywhere (including the + // playground) so the docs nav is visible by default. The rail is still there + // to collapse the sidebar for more room. function shouldCollapse() { - if (isDemo()) return true; return getPref() === '1'; }