Skip to content

fix: plot module header height with cards = TRUE - #45

Open
ivokwee wants to merge 2 commits into
masterfrom
fix/plotmodule-header
Open

fix: plot module header height with cards = TRUE#45
ivokwee wants to merge 2 commits into
masterfrom
fix/plotmodule-header

Conversation

@ivokwee

@ivokwee ivokwee commented Aug 24, 2026

Copy link
Copy Markdown
Member

What

PlotModuleUI(cards = TRUE) rendered a ~51px header where a plain plot module renders ~33px, so any row mixing tabbed and untabbed plot modules had misaligned card headers (and lost ~18px of plot area).

Why

PlotModuleUI() splices navset_card_pill's nav bar into .plotmodule-header and gsubs card-header bslib-navs-card-title down to bslib-navs-card-title. When the class order differs the gsub misses and a real .card-header survives inside the header. _plotmodule.scss already neutralised its height, but bslib's .bslib-card .card-header also sets min-height: 2.5rem, which height: auto does not defeat — so the spliced nav floored at 40px around a 24px pill bar.

Fix: min-height: 0 alongside the existing height: auto, class-order independent like the rest of that block.

Also in this PR: the navbar nav links lose their stray 1px bottom padding (padding: 0px 6px 1px 6px0px 6px 0px 6px), so the pills sit centred.

Before / after

Measured in-page (getBoundingClientRect().height), plain module vs cards = TRUE module side by side:

plain header tabbed header inner .card-header
before 33px 51px 40px
after 33px 33px 22px

before and after

Full-page screenshots

Before

before

After

after

Testing

dev/screenshots/header-demo.R is the app the screenshots came from — a plain PlotModuleUI next to a cards = TRUE one. Run it from the package root (Rscript dev/screenshots/header-demo.R, port 8080) and the two headers line up. dev/ is .Rbuildignored, so nothing here enters the package tarball.

inst/assets/style.min.css is recompiled from the SCSS with Rscript dev/sass.R; the only change vs master is the min-height:0 declaration and the navbar padding.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K2VQKPr911QGpfXtJxWdhU

ivokwee and others added 2 commits August 24, 2026 22:41
The plotmodule header fix lives in scss/, but inst/assets/style.min.css is
what the package ships -- recompiled with `Rscript dev/sass.R` so the two
stay in sync.

dev/ is .Rbuildignore'd, so the demo app and its screenshots do not enter
the package tarball.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K2VQKPr911QGpfXtJxWdhU
@ivokwee
ivokwee requested a review from ESCRI11 August 24, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant