Skip to content

Fix API reference content squish when AI assistant panel opens#330

Merged
patcapulong merged 4 commits intomainfrom
pat/fix-assistant-squish
Apr 10, 2026
Merged

Fix API reference content squish when AI assistant panel opens#330
patcapulong merged 4 commits intomainfrom
pat/fix-assistant-squish

Conversation

@patcapulong
Copy link
Copy Markdown
Contributor

@patcapulong patcapulong commented Apr 10, 2026

Summary

  • On API reference pages, the code examples panel (#content-side-layout) had flex-shrink: 0 and min-width: 28rem, making it rigid
  • When the AI assistant chat panel opens, Mintlify moves code content inline into the main content area, but the now-empty panel kept reserving 448px + 48px gap as a ghost element, squishing the visible content
  • Replace with flex: 0 1 28rem so the panel renders at 28rem normally but can collapse when the assistant panel reduces available space

Test plan

  • Open an API reference page on staging (e.g., Get customer by ID)
  • Verify the two-column layout (content left, code examples right) looks the same as prod
  • Open the AI assistant panel and verify the content is no longer squished / ghost element collapses
  • Close the assistant and verify layout returns to normal
  • Spot-check a non-API page (e.g., Core Concepts) to confirm the TOC sidebar is unaffected

Made with Cursor

The code examples panel (#content-side-layout) had flex-shrink: 0 and
min-width: 28rem, making it rigid. When the assistant panel opens,
Mintlify moves code content inline but the now-empty panel kept
reserving 448px as a ghost element, squishing the main content.

Replace with flex: 0 1 28rem so the panel stays at 28rem normally but
can collapse when space is constrained.

Made-with: Cursor
@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented Apr 10, 2026

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

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Apr 10, 2026, 5:55 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 10, 2026

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

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Apr 10, 2026 6:13pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 10, 2026

Greptile Summary

This PR fixes a ghost-element layout bug on API reference pages: the code-examples panel (#content-side-layout) kept reserving its 28rem width + 48px gap even after the AI assistant panel caused Mintlify to move its content inline, squishing the visible content area. The fix scopes the two overriding CSS rules to html:not([data-assistant-state=open]), allowing Mintlify's own collapse rule to take effect when the assistant opens.

Confidence Score: 5/5

Safe to merge — minimal, targeted CSS change with no logic or data concerns.

Single CSS file changed; the fix is correct and precisely scoped. No P0 or P1 findings. The prior P2 comment about max-width redundancy has been noted by the team and is not repeated here.

No files require special attention.

Important Files Changed

Filename Overview
mintlify/style.css Scopes the flex-shrink: 0 / min-width: 28rem panel rule and the 48px gap rule to html:not([data-assistant-state=open]) so Mintlify's built-in collapse behaviour fires freely when the AI assistant opens.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Page Load / State Change] --> B{data-assistant-state?}
    B -- "not 'open'" --> C["html:not([data-assistant-state=open]) rules apply\n• flex-shrink: 0\n• min-width: 28rem\n• gap: 48px"]
    C --> D[Two-column layout\ncode panel visible at 28rem]
    B -- "open" --> E[Scoped rules do NOT apply\nMintlify built-in collapse fires]
    E --> F["Mintlify: html[data-assistant-state=open] ... width:0\nPanel collapses cleanly — no ghost element"]
    F --> G[Content area uses full available width]
Loading

Reviews (3): Last reviewed commit: "Also scope API reference gap to assistan..." | Re-trigger Greptile

Comment thread mintlify/style.css Outdated
Our min-width: 28rem had higher specificity than Mintlify's built-in
html[data-assistant-state=open] collapse rule, creating a ghost element.
Wrap with html:not([data-assistant-state=open]) so the rigid sizing only
applies when the assistant panel is closed.

Made-with: Cursor
The 48px gap between content and code columns persists even when the
code panel is collapsed to width:0, since it's still in flex flow.
Scope the gap rule with the same html:not([data-assistant-state=open])
so it falls back to the general gap:0 when the assistant is open.

Made-with: Cursor
@patcapulong patcapulong merged commit 4e44433 into main Apr 10, 2026
8 checks passed
@patcapulong patcapulong deleted the pat/fix-assistant-squish branch April 10, 2026 18:28
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