Skip to content

feat(configurator): add Grid gap control + document responsive gap pattern - #629

Merged
jackgranatowski merged 3 commits into
mainfrom
claude/grid-gap-support-dhnw5t
Jul 17, 2026
Merged

feat(configurator): add Grid gap control + document responsive gap pattern#629
jackgranatowski merged 3 commits into
mainfrom
claude/grid-gap-support-dhnw5t

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Add a "Grid gap" control to the Auto grid section of the Layout panel,
wired to --sf-grid-gap. It offers the space-scale steps as a dropdown,
a rem slider, and a raw-value input — matching the existing gap controls
in the Spacing panel. Previously the section only exposed --sf-grid-min,
so the grid gap had no dedicated UI.

Document the responsive-gap pattern in docs/layout.md: gaps are fluid by
default (via the shared space scale), and per-primitive mobile/desktop
divergence is done with a @container override of the scoped gap token —
no new tokens, consistent with the framework's container-driven model.

No core/API changes.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01LeR8DfbqZqKtiFS72AJozP

Summary by CodeRabbit

  • New Features

    • Added a “Grid gap” slider to the Auto Grid controls, with support for per-breakpoint overrides and raw-value editing.
    • Grid gaps now scale fluidly by default and can be overridden for specific responsive container breakpoints.
  • Documentation

    • Updated layout docs with a new “Responsive gaps” section explaining fluid gap behavior and how container queries enable breakpoint-specific overrides.
    • Extended the override guidance to apply the same pattern to other scoped gap tokens.

…ttern

Add a "Grid gap" control to the Auto grid section of the Layout panel,
wired to --sf-grid-gap. It offers the space-scale steps as a dropdown,
a rem slider, and a raw-value input — matching the existing gap controls
in the Spacing panel. Previously the section only exposed --sf-grid-min,
so the grid gap had no dedicated UI.

Document the responsive-gap pattern in docs/layout.md: gaps are fluid by
default (via the shared space scale), and per-primitive mobile/desktop
divergence is done with a @container override of the scoped gap token —
no new tokens, consistent with the framework's container-driven model.

No core/API changes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeR8DfbqZqKtiFS72AJozP
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jackgranatowski, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c9cf59a-03de-4c76-9059-8c00d41c2f84

📥 Commits

Reviewing files that changed from the base of the PR and between e799111 and 3b9911f.

📒 Files selected for processing (1)
  • configurator/src/components/panels/LayoutPanel.svelte
📝 Walkthrough

Walkthrough

The layout configurator now exposes --sf-grid-gap through the Auto grid panel, with override and reset handling. Layout documentation describes fluid defaults and container-query-based responsive gap overrides.

Changes

Grid gap configuration

Layer / File(s) Summary
Grid gap control
configurator/src/components/panels/LayoutPanel.svelte
Derives the grid gap and adds an Auto grid slider with raw-value, override, change, and reset handling.
Responsive gap documentation
docs/layout.md
Documents fluid gap behavior, space-scale tuning, container-query overrides, and stepwise breakpoint transitions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: codex

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: a Grid gap control in the configurator and documentation for the responsive gap pattern.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/grid-gap-support-dhnw5t

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the codex label Jul 17, 2026
@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown

Greptile Summary

This PR wires a new "Grid gap" SliderRow to --sf-grid-gap in the Auto Grid section of the Layout panel, and adds a "Responsive gaps" section to docs/layout.md documenting the @container override pattern. No framework tokens or CSS are changed.

  • LayoutPanel.svelte — adds gridGap derived state (fallback 1rem) and a SliderRow matching the existing gap controls in style; placed before "Grid min cell width" in the Auto Grid accordion.
  • docs/layout.md — new section explains that gaps are fluid by default via the shared space scale, and shows the @container pattern for per-primitive mobile/desktop divergence without introducing new tokens.

Confidence Score: 4/5

Safe to merge — adds a UI-only control with no framework CSS changes and documentation that follows existing patterns.

The configurator change is additive and correctly wired to --sf-grid-gap following the established SliderRow pattern. Two minor rough edges: the step granularity differs from all peer gap controls, and the existing Auto Grid preview ignores the new value (hardcoded gap-1 class), so users get no live feedback from the new slider in the preview area.

The preview block in the Auto Grid section of LayoutPanel.svelte (lines 255-265) could benefit from wiring gridGap into the inline style.

Important Files Changed

Filename Overview
configurator/src/components/panels/LayoutPanel.svelte Adds gridGap derived state and a SliderRow for --sf-grid-gap in the Auto Grid section; step granularity is twice as fine as peer gap controls and the existing preview does not reflect the new gap value.
docs/layout.md Adds a Responsive gaps section documenting the @container override pattern for per-primitive gap tuning; token references and class names look accurate.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User moves Grid gap slider"] --> B["onChange fires"]
    B --> C["onSet('--sf-grid-gap', value + 'rem')"]
    C --> D["overrides record updated"]
    D --> E["gridGap re-derived via parseRem"]
    E --> F["SliderRow re-renders with new value"]
    A2["User selects SPACE_SCALE option"] --> G["onRawSet fires"]
    G --> C
    A3["User clicks Reset"] --> H["onReset('--sf-grid-gap')"]
    H --> I["override removed"]
    I --> J["gridGap falls back to default 1rem display"]
    D --> L["CSS var --sf-grid-gap applied to page"]
    L --> M[".sf-grid / .sf-grid-flex gap updated live"]
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["User moves Grid gap slider"] --> B["onChange fires"]
    B --> C["onSet('--sf-grid-gap', value + 'rem')"]
    C --> D["overrides record updated"]
    D --> E["gridGap re-derived via parseRem"]
    E --> F["SliderRow re-renders with new value"]
    A2["User selects SPACE_SCALE option"] --> G["onRawSet fires"]
    G --> C
    A3["User clicks Reset"] --> H["onReset('--sf-grid-gap')"]
    H --> I["override removed"]
    I --> J["gridGap falls back to default 1rem display"]
    D --> L["CSS var --sf-grid-gap applied to page"]
    L --> M[".sf-grid / .sf-grid-flex gap updated live"]
Loading

Comments Outside Diff (1)

  1. configurator/src/components/panels/LayoutPanel.svelte, line 255-265 (link)

    P2 Grid gap not reflected in the Auto Grid preview

    The preview div uses the hardcoded Tailwind class gap-1 (4 px), so dragging the new Grid gap slider produces no visible change in the preview. The label says "Preview at 360px panel width", which currently only exercises gridMin via grid-template-columns. Wiring the preview's inline gap to gridGap would make the new control immediately self-demonstrating and consistent with how gridMin is already live-previewed.

Reviews (1): Last reviewed commit: "feat(configurator): add Grid gap control..." | Re-trigger Greptile

</button>
{#if showAutoGrid}
<SliderRow
label="Grid gap" value={gridGap} min={0} max={4} step={0.0625} unit="rem"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Step granularity inconsistent with peer gap controls

The Grid gap slider uses step={0.0625} (1/16 rem ≈ 1 px/step), while every other gap-style control in this file — center gutter (step={0.125}), imposter margin (step={0.125}), alternate inner gap (step={0.125}) — uses step={0.125} (2 px/step). If this finer resolution is intentional it should be called out in a comment; otherwise aligning it to 0.125 keeps the UX consistent.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The finer step is intentional, and I've added a code comment explaining it (e799111). --sf-grid-gap is a gap token that defaults to --sf-gap, so I mirrored the gap-token sliders in SpacingPanel (--sf-gap / --sf-content-gap / --sf-gutter), which all use step={0.0625}. The peer controls you cite (center gutter, imposter margin, alternate inner gap) aren't the closest analog here — tuning the grid gap more coarsely than the very token it inherits from would be the odd result. Keeping 0.0625 for consistency with the gap family rather than aligning to the panel's non-gap size controls.


Generated by Claude Code

claude added 2 commits July 17, 2026 20:13
Address review feedback: document why the Grid gap slider uses a finer
step (0.0625rem) than the other size controls in LayoutPanel. It matches
the gap-token sliders in SpacingPanel (--sf-gap / --sf-content-gap /
--sf-gutter), which --sf-grid-gap defaults to, so the grid gap isn't
tuned more coarsely than the token it inherits from.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeR8DfbqZqKtiFS72AJozP
Address review feedback: the Auto grid preview used a hardcoded gap-1
class, so the new Grid gap slider produced no visible change. Drive the
preview's gap from gridGap, scaled the same way as the column widths, so
the control is self-demonstrating and consistent with the live gridMin
preview.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeR8DfbqZqKtiFS72AJozP
@jackgranatowski
jackgranatowski merged commit aef719b into main Jul 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants