fix: plot module header height with cards = TRUE - #45
Open
ivokwee wants to merge 2 commits into
Open
Conversation
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
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.
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()splicesnavset_card_pill's nav bar into.plotmodule-headerand gsubscard-header bslib-navs-card-titledown tobslib-navs-card-title. When the class order differs the gsub misses and a real.card-headersurvives inside the header._plotmodule.scssalready neutralised itsheight, but bslib's.bslib-card .card-headeralso setsmin-height: 2.5rem, whichheight: autodoes not defeat — so the spliced nav floored at 40px around a 24px pill bar.Fix:
min-height: 0alongside the existingheight: 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 6px→0px 6px 0px 6px), so the pills sit centred.Before / after
Measured in-page (
getBoundingClientRect().height), plain module vscards = TRUEmodule side by side:.card-headerFull-page screenshots
Before
After
Testing
dev/screenshots/header-demo.Ris the app the screenshots came from — a plainPlotModuleUInext to acards = TRUEone. 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.cssis recompiled from the SCSS withRscript dev/sass.R; the only change vs master is themin-height:0declaration and the navbar padding.🤖 Generated with Claude Code
https://claude.ai/code/session_01K2VQKPr911QGpfXtJxWdhU