Skip to content

Commit 8b39a2a

Browse files
authored
feat(layout_columns): Use sm as the default col_widths breakpoint (#1222)
1 parent 455bf63 commit 8b39a2a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Breaking Changes
1111

12+
* The `col_widths` argument of `ui.layout_columns()` now sets the `sm` breakpoint by default, rather than the `md` breakpoint. For example, `col_widths=(12, 6, 6)` is now equivalent to `{"sm": (12, 6, 6)}` rather than `{"md": (12, 6, 6)}`. (#1222)
13+
1214
### New features
1315

1416
* `ui.card()` and `ui.value_box()` now take an `id` argument that, when provided, is used to report the full screen state of the card or value box to the server. For example, when using `ui.card(id = "my_card", full_screen = TRUE)` you can determine if the card is currently in full screen mode by reading the boolean value of `input.my_card()["full_screen"]`. (#1215)
@@ -25,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2527

2628
* Fixed an issue that could happen with a `ui.card()` or `ui.value_box()` that is rendered dynamically via `@render.ui` when an updated card replaces a card that the user has expanded into full screen mode. Now the full screen state is reset for the new card or value box. If you want to update a card without potentially exiting the full-screen mode, update specific parts of the card using `ui.output_ui()` or `ui.output_text()`. (#1221)
2729

30+
* `ui.layout_columns()` now correctly applies the `row_heights` at the `xs` breakpoint, if supplied. (#1222)
31+
2832
### Other changes
2933

3034
## [0.8.1] - 2024-03-06

shiny/ui/_layout_columns.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def as_col_spec(
159159
return None
160160

161161
if not isinstance(col_widths, Dict):
162-
return {"md": validate_col_width(col_widths, n_kids, "md")}
162+
return {"sm": validate_col_width(col_widths, n_kids, "sm")}
163163

164164
ret: BreakpointsOptional[int] = {}
165165
col_widths_items = cast(BreakpointsSoft[int], col_widths).items()
@@ -265,12 +265,8 @@ def row_heights_attrs(
265265
# Remove any None values from x
266266
x_complete = {k: v for k, v in x.items() if v is not None}
267267

268-
# We use classes to activate CSS variables at the right breakpoints. Note: Mobile
269-
# row height is derived from xs or defaults to auto in the CSS, so we don't need the
270-
# class to activate it
271-
classes = [
272-
f"bslib-grid--row-heights--{brk}" for brk in x_complete.keys() if brk != "xs"
273-
]
268+
# We use classes to activate CSS variables at the right breakpoints.
269+
classes = [f"bslib-grid--row-heights--{brk}" for brk in x_complete.keys()]
274270

275271
# Create CSS variables, treating numeric values as fractional units, passing strings
276272
css_vars: Dict[str, str] = {}

shiny/www/shared/_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"note!": "This file is auto-generated by scripts/htmlDependencies.R",
33
"package": "shiny",
4-
"version": "Github (rstudio/shiny@c1a1542cfecd31c13b1c6930e53db3a837a0adff)"
4+
"version": "Github (rstudio/shiny@ae308e03adcb040756ac5d13c76b50244216173d)"
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"note!": "This file is auto-generated by scripts/htmlDependencies.R",
3-
"shiny_version": "Github (rstudio/shiny@c1a1542cfecd31c13b1c6930e53db3a837a0adff)",
4-
"bslib_version": "Github (rstudio/bslib@43d46da7416067575dd32a660219625abae5571e)",
3+
"shiny_version": "Github (rstudio/shiny@ae308e03adcb040756ac5d13c76b50244216173d)",
4+
"bslib_version": "Github (rstudio/bslib@2ec3067eb20fcdcd25260a8ee7ec6a7607839429)",
55
"htmltools_version": "CRAN (R 4.3.1)",
66
"bootstrap_version": "5.3.1"
77
}

shiny/www/shared/bslib/_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"note!": "This file is auto-generated by scripts/htmlDependencies.R",
33
"package": "bslib",
4-
"version": "Github (rstudio/bslib@43d46da7416067575dd32a660219625abae5571e)"
4+
"version": "Github (rstudio/bslib@2ec3067eb20fcdcd25260a8ee7ec6a7607839429)"
55
}

0 commit comments

Comments
 (0)