Skip to content

fix: Update toolbar snapshots (broken after latest shiny changes)#1289

Closed
elnelson575 wants to merge 14 commits intomainfrom
fix/correct-snapshots
Closed

fix: Update toolbar snapshots (broken after latest shiny changes)#1289
elnelson575 wants to merge 14 commits intomainfrom
fix/correct-snapshots

Conversation

@elnelson575
Copy link
Contributor

@elnelson575 elnelson575 commented Feb 24, 2026

Summary

Updates toolbar test snapshots to match the minified HTML output format introduced in shiny 1.12.1.9000.

Background

Shiny PR #4350 ("Update to remove whitespace and add padding when necessary") added .noWS parameters to actionButton() and actionLink() to fix an underline rendering bug. This change removes whitespace from the HTML output, producing single-line (minified) HTML instead of pretty-printed multi-line format.

Since toolbar_input_button() calls shiny::actionButton() internally, it inherits this minified HTML behavior. While this doesn't make much of a difference in shiny::actionButton()'s appearance, toolbar buttons include the tooltip wrapper, which has a larger surrounding html wrapper, so the block of html that is compacted is larger.

Changes

  • Updates tests/testthat/_snaps/toolbar.md with de-WS'd HTML format
  • All 11 toolbar button snapshot tests now match the new output format
  • The HTML structure and functionality remain identical - only whitespace formatting changed

Testing

  • ✅ All 145 toolbar tests pass locally with shiny 1.12.1.9000
  • ✅ Full test suite passes (1,092 tests)
  • The updated snapshots match what shiny's latest version generates in CI

Fixes the test failures from https://github.com/rstudio/bslib/actions/runs/22360039053

The toolbar_input_button() HTML output has changed from multi-line
formatted HTML to single-line (minified) format. This is a cosmetic
change - the actual HTML structure and functionality remain identical.

All 11 snapshot tests in test-toolbar.R are updated to reflect the
new single-line format where whitespace and newlines have been removed
from the HTML output.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@elnelson575 elnelson575 changed the title Update toolbar snapshots for minified HTML format fix: Update toolbar snapshots (broken after latest shiny changes) Feb 24, 2026
@elnelson575 elnelson575 marked this pull request as draft February 24, 2026 18:27
Overrides shiny's new .action-button .action-icon+.action-label margin-left
rule for toolbar icon-only buttons. This prevents the hidden label element
from affecting the button's vertical alignment.

The shiny PR #4350 added margin-left to .action-label elements to fix
underline rendering issues. However, for bslib's icon-only toolbar buttons,
the label is hidden but still present in the DOM, causing the margin to
create unexpected vertical alignment issues when combined with the minified
HTML output.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@elnelson575 elnelson575 force-pushed the fix/correct-snapshots branch from 31ba0b2 to d93145d Compare February 24, 2026 18:32
- Add display: flex to all toolbar buttons to prevent inline baseline issues
- Override shiny's margin-left on .action-icon + .action-label for toolbar buttons
Moved display: flex from separate rule block into the main
.bslib-toolbar-input-button selector for better organization and
to ensure proper flex layout for toolbar buttons with the minified
HTML from shiny 1.12.1.9000.
- Updated toolbar.scss to use margin: 0 on both .action-icon and .action-label
- Applied snapshot updates for bs-theme-preset files
@elnelson575 elnelson575 force-pushed the fix/correct-snapshots branch from 224527f to 4d203bc Compare February 24, 2026 22:44
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