Skip to content

Default the playground sidebar to expanded#635

Merged
patcapulong merged 1 commit into
mainfrom
pat/playground-sidebar-default-open
Jul 1, 2026
Merged

Default the playground sidebar to expanded#635
patcapulong merged 1 commit into
mainfrom
pat/playground-sidebar-default-open

Conversation

@patcapulong

Copy link
Copy Markdown
Contributor

Summary

The Global Accounts playground opened with the docs sidebar collapsed by default, which made it easy to miss that the full documentation is one click away. This defaults the playground sidebar to expanded — the same as every other page (it just follows the saved preference) — so the nav is visible up front. The collapse rail is still there for anyone who wants more room for the 3‑column playground.

Removes the now-unused demo-path special case (isDemo / DEMO_PATHS) from sidebar-toggle.js and the demo branch of the pre-paint script in docs.json.

Context

Follow-up to the collapsible-sidebar work (#607). Feedback was that the collapsed rail made it unclear the docs were still available, so we're hedging toward visibility by defaulting to expanded.

Test plan

  • Fresh visit to /global-accounts/demo (with no ls-nav-collapsed in localStorage): sidebar is expanded.
  • Collapse it via the edge rail → persists across pages + refresh (saved preference honored).
  • Other docs pages unchanged (expanded default, respect saved preference).
  • Custom-layout pages (flow builder) still show no rail.

Made with Cursor

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 <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Jul 1, 2026 12:57am
grid-wallet-demo Ignored Ignored Jul 1, 2026 12:57am

Request Review

@mintlify

mintlify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Jul 1, 2026, 12:59 AM

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the hardcoded "always collapsed" behavior for the /global-accounts/demo playground page and aligns it with every other docs page: sidebar defaults to expanded on a fresh visit, and the saved ls-nav-collapsed localStorage preference is honored on all pages equally.

  • docs.json: The pre-paint inline script no longer checks the demo path; it now applies the collapsed class only when ls-nav-collapsed === '1', matching the default-expanded intent.
  • sidebar-toggle.js: DEMO_PATHS, isDemo(), and the comment instructing them to be kept in sync with docs.json are removed; shouldCollapse() is simplified to a single preference check.

Confidence Score: 5/5

Both changed files are in sync: the pre-paint script and the JS toggle now use identical logic, so there is no flash-of-wrong-state or state mismatch on the demo page.

The change removes a special case from two places that were required to stay in sync — the sync comment is now gone too. Fresh visits to /global-accounts/demo will show an expanded sidebar, and all user-saved preferences continue to be respected identically across every page.

No files require special attention.

Important Files Changed

Filename Overview
mintlify/docs.json Pre-paint inline script updated to remove the demo-path forced-collapse branch; now only applies ls-nav-collapsed when the stored preference is '1'.
mintlify/sidebar-toggle.js Removes DEMO_PATHS constant, isDemo() helper, and the associated sync comment; shouldCollapse() is now a one-liner that checks the localStorage preference only.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Page load / SPA navigation] --> B{localStorage\n'ls-nav-collapsed'}
    B -- "'1'" --> C[Apply ls-nav-collapsed class\n→ sidebar collapsed]
    B -- "null or '0'" --> D[No class added\n→ sidebar expanded]
    C --> E[Rail visible\nClick to expand]
    D --> F[Sidebar visible\nClick rail to collapse]
    E -- "User clicks rail" --> G[setPref '0'\napplyState expanded]
    F -- "User clicks rail" --> H[setPref '1'\napplyState collapsed]
    G --> D
    H --> C
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Page load / SPA navigation] --> B{localStorage\n'ls-nav-collapsed'}
    B -- "'1'" --> C[Apply ls-nav-collapsed class\n→ sidebar collapsed]
    B -- "null or '0'" --> D[No class added\n→ sidebar expanded]
    C --> E[Rail visible\nClick to expand]
    D --> F[Sidebar visible\nClick rail to collapse]
    E -- "User clicks rail" --> G[setPref '0'\napplyState expanded]
    F -- "User clicks rail" --> H[setPref '1'\napplyState collapsed]
    G --> D
    H --> C
Loading

Reviews (1): Last reviewed commit: "Default the playground sidebar to expand..." | Re-trigger Greptile

@patcapulong patcapulong merged commit 9dad725 into main Jul 1, 2026
10 checks passed
@patcapulong patcapulong deleted the pat/playground-sidebar-default-open branch July 1, 2026 01:19
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