Skip to content

Commit 07a59eb

Browse files
committed
improvement(workflow): even out the gutter inside a container
Left, top and bottom were 16 and the bottom read tighter than either, because the 50px header sits above the top gap and gives that edge visual weight the other two do not have. Taking them to 24 leaves the three gutter-only edges matching and the bottom no longer pinched. Right stays 80. The container's output handle sits on that edge, so a child needs clearance there it does not need anywhere else — chrome rather than gutter, now said so in the type. Only reachable as a single constant each because the paddings mean what they say: each is the gap between a child's edge and the container's, counted once. While the sizing math added the header and leading padding a second time, the effective bottom gap was spread across three constants and tuning it meant reasoning about all of them.
1 parent a483d7a commit 07a59eb

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

packages/workflow-renderer/src/dimensions.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,30 @@ export const estimateNoteBlockHeight = (content: string) => {
8080
)
8181
}
8282

83+
/**
84+
* A container's box, and the gutter it keeps around the blocks inside it.
85+
*
86+
* Each padding is the gap between a child's edge and the container's, and
87+
* nothing else. The header is counted once, by the child's own position, which
88+
* `clampPositionToContainer` floors at `HEADER_HEIGHT + TOP_PADDING` — so these
89+
* are the numbers you see, and three of them match because those three edges
90+
* are only gutter.
91+
*
92+
* `RIGHT_PADDING` is the deliberate exception. The container's own output
93+
* handle sits on that edge, so a child needs clearance there it does not need
94+
* anywhere else. That makes it chrome rather than gutter, which is why it is
95+
* not tied to the other three.
96+
*/
8397
export const CONTAINER_DIMENSIONS = {
8498
DEFAULT_WIDTH: 500,
8599
DEFAULT_HEIGHT: 300,
86100
MIN_WIDTH: 400,
87101
MIN_HEIGHT: 200,
88102
HEADER_HEIGHT: 50,
89-
LEFT_PADDING: 16,
103+
LEFT_PADDING: 24,
90104
RIGHT_PADDING: 80,
91-
TOP_PADDING: 16,
92-
BOTTOM_PADDING: 16,
105+
TOP_PADDING: 24,
106+
BOTTOM_PADDING: 24,
93107
} as const
94108

95109
/**

0 commit comments

Comments
 (0)