Conversation
The layout guide implied `Box` only exposes `gap`, but per the installed source `Box` has no `gap` — it has a `spacing` prop for the element's own margins/paddings. `Flex` extends `BoxProps`, so it inherits `spacing` and adds `gap`/`gapRow` for spacing between children. - Split the "Ways to apply spacing" item gravity-ui#1 into `gap` (Flex, between children) and `spacing` (Box, element itself), with an example and a link to the shortcut key table. - Add a Props block to the `## Box` section documenting `spacing` (plus `as`, `overflow`, size props) with a note that `Box` has no `gap`. - Update the "Rule of thumb" summary to match the actual gap/spacing split. - Add an anchor heading so the new "#the-spacing-utility" link resolves.
Contributor
Reviewer's GuideUpdates the layout documentation to clearly distinguish Box’s File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The link text
[SpacingProps](#the-spacing-utility)may be confusing since the anchor points to a "Thespacingutility" heading rather than an explicitly namedSpacingPropssection; consider either renaming the heading or adjusting the link text to better match the target. - The new "##### The
spacingutility" subheading sits directly under the numbered "Thespacing()utility" section and feels redundant; you could drop the extra heading and instead use an explicit HTML anchor to keep the link target without introducing another heading level.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The link text `[`SpacingProps`](#the-spacing-utility)` may be confusing since the anchor points to a "The `spacing` utility" heading rather than an explicitly named `SpacingProps` section; consider either renaming the heading or adjusting the link text to better match the target.
- The new "##### The `spacing` utility" subheading sits directly under the numbered "The `spacing()` utility" section and feels redundant; you could drop the extra heading and instead use an explicit HTML anchor to keep the link target without introducing another heading level.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
|
Preview is ready. |
Contributor
|
🎭 Component Tests Report is ready. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The layout guide (
docs/layout.md) impliedFlex/Boxonly exposegapfor spacing. Per the installed source that is incorrect:Box(src/components/layout/Box/Box.tsx) has nogap— it has aspacingprop for the element's own margins/paddings.Flex(src/components/layout/Flex/Flex.tsx)extends BoxProps, so it inheritsspacingand addsgap/gapRow/spacefor spacing between children.As a result, the
spacingprop ofBoxwas effectively undocumented.Changes
gap/gapRow(Flexonly) — spacing between children;spacing(Box, inherited byFlex) — the element's own margins/paddings.Added an example (
<Box spacing={{mr: 3, pb: 2}}>) and a link to the shortcut key table.## Boxsection — added a Props block documentingspacing(plusas,overflow, the size/position props), with a note thatBoxhas nogapand thatFlexalso acceptsspacing.gapvsspacingsplit.#the-spacing-utilitylink resolves.Docs-only change; no code touched.
Summary by Sourcery
Clarify layout spacing documentation for Box and Flex by distinguishing element-level spacing from inter-child gaps.
Documentation:
spacingprop as distinct from Flexgap/gapRow, including usage examples and supported shortcut keys.spacing, structural props likeas, and size/overflow-related props, with notes on Flex inheritance and Box lackinggap.