Skip to content

Commit 828a655

Browse files
sarg3ntclaude
andcommitted
fix(#103): capability-hidden tiles staying visible (CSS specificity bug)
Root cause: my new flex-fill rule #charts-grid .grid-stack-item-content { display: flex; ... } has higher specificity (0,1,2,0) than Tailwind's .hidden utility (0,0,1,0) and was winning the cascade. So when applyCapabilities() correctly added .hidden to capability-not-installed cards (caddy / traefik / nginx / apache on a HAProxy-only host like light-hugger), the display: flex from my rule overrode display: none from .hidden — the cards stayed visible with their titles + empty chart areas. The agent's probes and the JS hide logic were both doing the right thing the whole time; the override was silent because dev-tools' computed-style panel just shows "display: flex" without flagging which rule it lost to. Fix: scope the flex-fill rule with :not(.hidden) so .hidden wins the cascade for capability-hidden cards. Now display: none kicks in as intended, the tile vanishes visually, and the container- height recompute brings the bottom edge up to whatever the last *visible* tile ends — no more ghost slots reserving space below the layout. Same bug would have hit no-HAProxy hosts (the HAProxy cards would stay visible despite haproxyAvailable=false). Catching it before that footgun lands in front of a real user. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c44b5e1 commit 828a655

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,12 @@ templ Metrics(user *models.User, servers []models.BoxConfig) {
454454
padding-bottom trick (which was sized to viewport width
455455
and overflowed the tile). overflow:hidden clips any
456456
stragglers (legends, axis labels) that briefly extend past
457-
the bounds during GridStack resize transitions. */
458-
#charts-grid .grid-stack-item-content {
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. */
462+
#charts-grid .grid-stack-item-content:not(.hidden) {
459463
display: flex;
460464
flex-direction: column;
461465
height: 100%;

0 commit comments

Comments
 (0)