Playground: give the code panel more room + graceful docs-sidebar toggles#660
Conversation
…e laptop API peek The API column's default (and drag-snap target) is now half the space right of the configure column instead of a fixed 475px, and it tracks the split on window resize until the user drags a custom width. On the stacked laptop layout the API panel peeks 64px of body under its header so it reads as content waiting below, not just a bar. Mobile is untouched. Co-authored-by: Cursor <cursoragent@cursor.com>
…n the wide layout The phone stage runs full-bleed on the dot grid, and side-by-side the calls column opens straight onto its content (the resize handle already draws the full-height divider). The API header stays on stacked layouts, where it's the peek target and carries the new-call count pill. Co-authored-by: Cursor <cursoragent@cursor.com>
…ult everywhere The configure column is 400px with 40px body padding at every breakpoint (was 475/48 on wide) — the laptop-only overrides are gone, and the resize hook's CONFIGURE_WIDTH follows, which also lowers the API column's minimum width to match. The freed space flows into the app/API 50/50 split. Co-authored-by: Cursor <cursoragent@cursor.com>
…y and align API panel side padding The stage is #F5F5F3 — two steps under the panel surface (#F8F8F7), clearly lighter than surface-secondary (#F0F0EE) so it stops matching the docs chrome. The API feed's side padding drops 48 → 40px to match the configure panel. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Greptile SummaryA layout polish pass that gives the API/code panel significantly more real estate across all breakpoints without changing any application logic.
Confidence Score: 4/5Safe to merge — changes are layout and visual only, with no data-path or application logic touched. The JS constant CONFIGURE_WIDTH in useColumnResize.ts must stay in sync with the SCSS variable $layout-laptop-config-width manually; if they drift in a future change the 50/50 split calculation and minimum-width clamp will break silently. Everything else — the CSS restructuring, the peek-height adjustment, the header removal, and the colour tweak — looks correct and well-scoped. useColumnResize.ts — the CONFIGURE_WIDTH constant needs to stay in sync with the SCSS breakpoints file by hand.
|
| Filename | Overview |
|---|---|
| components/grid-wallet-demo/src/hooks/useColumnResize.ts | Replaces the fixed 475px snap target with a computed 50/50 split; adds userResized ref so window resizes keep the split live until the user pins a custom width. Logic is sound; the JS constant CONFIGURE_WIDTH = 400 duplicates the SCSS token. |
| components/grid-wallet-demo/src/app/page.module.scss | Laptop-layout appCol min-height shrinks by 64px so the API panel peeks header + body strip (116px total); mobile breakpoint is unchanged at 52px. |
| components/grid-wallet-demo/src/components/ApiPanel/ApiPanel.module.scss | At wide breakpoint, hides the entire headerStacked (previously only hid newPill); removes the now-redundant border-left since the resize handle provides the column divider. |
| components/grid-wallet-demo/src/components/AppPanel/AppPanel.tsx | Removes the PanelHeader ("App") and its icon import, running the dot-grid stage full-bleed at all breakpoints. |
| components/grid-wallet-demo/src/components/ConfigurePanel/ConfigurePanel.module.scss | Makes 400px width and 40px padding the universal defaults by removing now-redundant laptop-breakpoint overrides; mobile 100% width is preserved. |
| components/grid-wallet-demo/src/app/globals.scss | Replaces var(--surface-secondary) with a hardcoded #f5f5f3 for the light-mode dot-grid background, intentionally stepping it away from the Mintlify chrome color. |
| components/grid-wallet-demo/src/components/ApiPanel/ApiCallList.module.scss | Drops the wide-layout side padding from 48px to 40px by switching the shorthand from a uniform value to 48px top/bottom and $layout-laptop-content-padding sides. |
| components/grid-wallet-demo/src/components/ApiPanel/ApiPanelSkeleton.module.scss | Same side-padding reduction as ApiCallList.module.scss; skeleton and live list stay visually in sync. |
| components/grid-wallet-demo/src/styles/breakpoints.scss | Comment-only update to reflect the new 400px config column and 50/50 split description; variable values unchanged. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Viewport width] --> B{≥ 1440px\nWide layout}
A --> C{768–1439px\nLaptop layout}
A --> D{≤ 767px\nMobile layout}
B --> E[Configure col: 400px\nflex-shrink: 0]
B --> F[stackCol: flex row]
F --> G[appCol: flex 1\nNo header]
F --> H[apiCol: apiWidth px\nNo header\nuseColumnResize hook]
H --> I{userResized?}
I -- No --> J[defaultApiWidth\n= totalMiddle ÷ 2]
I -- Yes --> K[clamp to\nMIN_API..totalMiddle–MIN_APP]
J --> L[window resize\nre-tracks 50/50]
K --> M[drag back within\nSNAP_THRESHOLD → reset flag]
C --> N[Configure col: 400px]
C --> O[stackCol: flex column]
O --> P[appCol: min-height\n100% − 116px\npeeks API below]
O --> Q[apiCol: full-width\nheaderStacked visible\n+ newPill count]
D --> R[Two-view toggle\nConfigure ↔ Playground]
R --> S[appCol: min-height\n100% − 52px\nMobile unchanged]
%%{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[Viewport width] --> B{≥ 1440px\nWide layout}
A --> C{768–1439px\nLaptop layout}
A --> D{≤ 767px\nMobile layout}
B --> E[Configure col: 400px\nflex-shrink: 0]
B --> F[stackCol: flex row]
F --> G[appCol: flex 1\nNo header]
F --> H[apiCol: apiWidth px\nNo header\nuseColumnResize hook]
H --> I{userResized?}
I -- No --> J[defaultApiWidth\n= totalMiddle ÷ 2]
I -- Yes --> K[clamp to\nMIN_API..totalMiddle–MIN_APP]
J --> L[window resize\nre-tracks 50/50]
K --> M[drag back within\nSNAP_THRESHOLD → reset flag]
C --> N[Configure col: 400px]
C --> O[stackCol: flex column]
O --> P[appCol: min-height\n100% − 116px\npeeks API below]
O --> Q[apiCol: full-width\nheaderStacked visible\n+ newPill count]
D --> R[Two-view toggle\nConfigure ↔ Playground]
R --> S[appCol: min-height\n100% − 52px\nMobile unchanged]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
components/grid-wallet-demo/src/hooks/useColumnResize.ts:5-7
The JS constant `CONFIGURE_WIDTH = 400` duplicates `$layout-laptop-config-width: 400px` from `breakpoints.scss`. The comment flags the intent, but SCSS variables and JS constants aren't linked — a future change to one won't automatically update the other, and the mismatch would silently break the 50/50 split calculation (`totalMiddle = layout.width - CONFIGURE_WIDTH`) and the minimum-width clamp. Consider co-locating them (e.g. a shared CSS custom property read via `getComputedStyle`, or a generated constant) so they can't drift.
```suggestion
// Matches $layout-laptop-config-width — the compact configure column is the
// default at every breakpoint. Keep in sync with that SCSS variable.
const CONFIGURE_WIDTH = 400;
```
Reviews (1): Last reviewed commit: "Playground: lift the light dot-grid stag..." | Re-trigger Greptile
| // Matches $layout-laptop-config-width — the compact configure column is the | ||
| // default at every breakpoint. | ||
| const CONFIGURE_WIDTH = 400; |
There was a problem hiding this comment.
The JS constant
CONFIGURE_WIDTH = 400 duplicates $layout-laptop-config-width: 400px from breakpoints.scss. The comment flags the intent, but SCSS variables and JS constants aren't linked — a future change to one won't automatically update the other, and the mismatch would silently break the 50/50 split calculation (totalMiddle = layout.width - CONFIGURE_WIDTH) and the minimum-width clamp. Consider co-locating them (e.g. a shared CSS custom property read via getComputedStyle, or a generated constant) so they can't drift.
| // Matches $layout-laptop-config-width — the compact configure column is the | |
| // default at every breakpoint. | |
| const CONFIGURE_WIDTH = 400; | |
| // Matches $layout-laptop-config-width — the compact configure column is the | |
| // default at every breakpoint. Keep in sync with that SCSS variable. | |
| const CONFIGURE_WIDTH = 400; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: components/grid-wallet-demo/src/hooks/useColumnResize.ts
Line: 5-7
Comment:
The JS constant `CONFIGURE_WIDTH = 400` duplicates `$layout-laptop-config-width: 400px` from `breakpoints.scss`. The comment flags the intent, but SCSS variables and JS constants aren't linked — a future change to one won't automatically update the other, and the mismatch would silently break the 50/50 split calculation (`totalMiddle = layout.width - CONFIGURE_WIDTH`) and the minimum-width clamp. Consider co-locating them (e.g. a shared CSS custom property read via `getComputedStyle`, or a generated constant) so they can't drift.
```suggestion
// Matches $layout-laptop-config-width — the compact configure column is the
// default at every breakpoint. Keep in sync with that SCSS variable.
const CONFIGURE_WIDTH = 400;
```
How can I resolve this? If you propose a fix, please make it concise.Side-by-side, both side panels wear the docs-chrome gray (surface-secondary, both modes) with cards/tiles stepped one notch softer, the skeleton melt and bone contrast tuned to match, and the light stage at #F4F4F3 (wide only; the GL canvas re-reads the palette on resize). The code panel's default + snap width is the docs sidebar + configure column (680), following the live sidebar width via a new nav-sync embed message (48px rail when collapsed); dragging still grows it freely like before. Configure content top-aligns. Co-authored-by: Cursor <cursoragent@cursor.com>
The embed reports nav state directionally — immediately when collapsing (invisible while stacked, lets the width glide run in parallel with the wipe), on settle when expanding (kills the wide-panel flash before the layout flip). The API column eases programmatic width changes (240ms, wide layout only, never during a drag), and snaps at stacked ⇄ 3-col breakpoint crossings via a matchMedia listener so entering 3-col doesn't read as a giant shrink sweep. Co-authored-by: Cursor <cursoragent@cursor.com>
…the breakpoint-crossing column crush The stacked/3-col attribute now lives on <html>, set pre-paint by the same inline script as data-theme, so narrow viewports no longer flash the SSR 3-col default while JS loads. The veil choreography is removed on both sides (demo + docs toggle). The code panel's width ease now arms only when the painted width matches the tracked inline width, so nav-sync messages racing the stacked->wide flip can't start the transition from the full-row stacked width and crush the app column. Co-authored-by: Cursor <cursoragent@cursor.com>
…ut constants The embed bakes the live docs-sidebar width into the iframe URL (?nav), the pre-paint script turns it into --api-col-default, and the column renders no inline width until React measures — so a 3-col refresh paints the correct width from the first frame instead of re-fitting once nav-sync arrives. Cleanup from the same thrash: the 1600 breakpoint and 400 configure width now live in lib/layout.ts (imported by the boot script and both listeners, with named SCSS twins), stale ahead-of-crossing comments are rewritten, stacked selectors are normalized to html[data-layout], and a redundant inline flex is dropped. Co-authored-by: Cursor <cursoragent@cursor.com>
…settle The suppression made expand a two-stage motion (sidebar wipes, then the code column glides late); it predates the demo's painted-vs-tracked ease guard, which now handles the breakpoint-crossing race it existed to avoid. Both toggle directions ride in sync now. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Summary
Layout pass to surface the API/code panel more prominently, plus a follow-up pass making docs-sidebar toggles and page loads land cleanly:
nav-syncmessages + a?navboot param), and the default follows it: collapsing/expanding the docs sidebar glides the code column in sync with the wipe, in both directions. Dragging still sets a free custom width.data-layoutattribute on<html>, set before first paint by the boot script (no SSR layout flash on refresh) and kept live by a matchMedia listener. Breakpoint-crossing toggles snap the arrangement; the panel chrome colors glide across the flip. A guard keeps the width transition from arming mid-flip (which briefly crushed the app column to zero).lib/layout.tswith SCSS twins.Test plan
Made with Cursor