Skip to content

Commit bc7f99a

Browse files
sarg3ntclaude
andcommitted
fix(#103): remove height:100% from inner card — was eating the row gap
Diagnosed via Chrome MCP direct DOM inspection. Three rules were fighting over the inner card's size: GridStack vendor CSS → position: absolute; top: 24px; bottom: 24px My rule on #charts-grid → height: 100% CSS spec when over-constrained → height wins Resolved: inner ended up 320px tall (matching outer's full height) anchored at top:24, so it extended 24px BELOW the outer's bottom — exactly where the next row's outer begins. Visual result: zero gap between adjacent rows' inner cards, no matter what margin value I set on the GridStack init. That's why margins 18, 24, 36 all looked identical — the cells were always butting up against each other. Fix: drop the `height: 100%`. GridStack's inline top + bottom is sufficient to size the absolute-positioned inner content (inner height becomes outer_height − marginTop − marginBottom = 272px for gs-h=4, leaving a 48px gap between rows that matches the configured margins). Verified via Chrome MCP after fix: inner height: 272 (was 320, was overrunning by 24) visible gap between row 0 inner bottom and row 4 inner top: 48px Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4040cab commit bc7f99a

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

gearbox/internal/framework/templates/pages/metrics.templ

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -449,20 +449,23 @@ templ Metrics(user *models.User, servers []models.BoxConfig) {
449449
cursor: move;
450450
}
451451
/* Make each tile a flex column so the chart container can
452-
flex to fill the GridStack-controlled height instead of
453-
computing its own from the chart-aspect-container's
454-
padding-bottom trick (which was sized to viewport width
455-
and overflowed the tile). overflow:hidden clips any
456-
stragglers (legends, axis labels) that briefly extend past
457-
the bounds during GridStack resize transitions.
458-
:not(.hidden) is critical — without it this rule has
459-
higher specificity than Tailwind's .hidden (display:none)
460-
utility and wins the cascade, so capability-hidden cards
461-
stay visible. */
452+
flex to fill the GridStack-controlled vertical space
453+
(between top:marginTop and bottom:marginBottom set
454+
inline by GridStack). overflow:hidden clips any
455+
stragglers (legends, axis labels) that briefly extend
456+
past the bounds during GridStack resize transitions.
457+
:not(.hidden) keeps Tailwind's .hidden (display:none)
458+
winning the cascade for capability-hidden cards.
459+
IMPORTANT: do NOT set `height: 100%` here — GridStack's
460+
own inline `top` + `bottom` positioning already sizes
461+
the absolute-positioned inner content. height: 100%
462+
would over-constrain (height + top + bottom all set →
463+
height wins per CSS spec), making the inner extend
464+
marginBottom px past the outer's bottom and visually
465+
eat the vertical gap between rows. */
462466
#charts-grid .grid-stack-item-content:not(.hidden) {
463467
display: flex;
464468
flex-direction: column;
465-
height: 100%;
466469
overflow: hidden;
467470
}
468471
/* Inside a GridStack tile, drop the percent-of-width

0 commit comments

Comments
 (0)