From 9decc9c6592306bf1cd97e94ba19abca4bc4a38e Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Sat, 16 Mar 2024 15:49:05 -0400 Subject: [PATCH 1/4] feat(layout_columns): Make `sm` the default breakpoint --- shiny/ui/_layout_columns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shiny/ui/_layout_columns.py b/shiny/ui/_layout_columns.py index d2de2d38e..cdae63633 100644 --- a/shiny/ui/_layout_columns.py +++ b/shiny/ui/_layout_columns.py @@ -153,7 +153,7 @@ def as_col_spec( return None if not isinstance(col_widths, Dict): - return {"md": validate_col_width(col_widths, n_kids, "md")} + return {"sm": validate_col_width(col_widths, n_kids, "sm")} ret: BreakpointsOptional[int] = {} col_widths_items = cast(BreakpointsSoft[int], col_widths).items() From 7addd87c8258105322421083cd17dd9a46f2440b Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Sat, 16 Mar 2024 21:50:08 -0400 Subject: [PATCH 2/4] fix(layout_columns): `xs` for `row_heights` does require the class --- shiny/ui/_layout_columns.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/shiny/ui/_layout_columns.py b/shiny/ui/_layout_columns.py index cdae63633..b84b77bb7 100644 --- a/shiny/ui/_layout_columns.py +++ b/shiny/ui/_layout_columns.py @@ -259,12 +259,8 @@ def row_heights_attrs( # Remove any None values from x x_complete = {k: v for k, v in x.items() if v is not None} - # We use classes to activate CSS variables at the right breakpoints. Note: Mobile - # row height is derived from xs or defaults to auto in the CSS, so we don't need the - # class to activate it - classes = [ - f"bslib-grid--row-heights--{brk}" for brk in x_complete.keys() if brk != "xs" - ] + # We use classes to activate CSS variables at the right breakpoints. + classes = [f"bslib-grid--row-heights--{brk}" for brk in x_complete.keys()] # Create CSS variables, treating numeric values as fractional units, passing strings css_vars: Dict[str, str] = {} From d61ad5701320f4897b2f2c814f2ed2a6d63fc4e4 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 19 Mar 2024 11:07:50 -0400 Subject: [PATCH 3/4] chore: Update bslib and shiny https://github.com/rstudio/shiny/compare/c1a1542c...ae308e03 https://github.com/rstudio/bslib/compare/43d46da7...2ec3067e --- shiny/www/shared/_version.json | 2 +- shiny/www/shared/bootstrap/_version.json | 4 ++-- shiny/www/shared/bslib/_version.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shiny/www/shared/_version.json b/shiny/www/shared/_version.json index deaf52f9a..aea3f3b22 100644 --- a/shiny/www/shared/_version.json +++ b/shiny/www/shared/_version.json @@ -1,5 +1,5 @@ { "note!": "This file is auto-generated by scripts/htmlDependencies.R", "package": "shiny", - "version": "Github (rstudio/shiny@c1a1542cfecd31c13b1c6930e53db3a837a0adff)" + "version": "Github (rstudio/shiny@ae308e03adcb040756ac5d13c76b50244216173d)" } diff --git a/shiny/www/shared/bootstrap/_version.json b/shiny/www/shared/bootstrap/_version.json index 7f25a1df9..02dcd98fc 100644 --- a/shiny/www/shared/bootstrap/_version.json +++ b/shiny/www/shared/bootstrap/_version.json @@ -1,7 +1,7 @@ { "note!": "This file is auto-generated by scripts/htmlDependencies.R", - "shiny_version": "Github (rstudio/shiny@c1a1542cfecd31c13b1c6930e53db3a837a0adff)", - "bslib_version": "Github (rstudio/bslib@43d46da7416067575dd32a660219625abae5571e)", + "shiny_version": "Github (rstudio/shiny@ae308e03adcb040756ac5d13c76b50244216173d)", + "bslib_version": "Github (rstudio/bslib@2ec3067eb20fcdcd25260a8ee7ec6a7607839429)", "htmltools_version": "CRAN (R 4.3.1)", "bootstrap_version": "5.3.1" } diff --git a/shiny/www/shared/bslib/_version.json b/shiny/www/shared/bslib/_version.json index 863e85012..f13604ab7 100644 --- a/shiny/www/shared/bslib/_version.json +++ b/shiny/www/shared/bslib/_version.json @@ -1,5 +1,5 @@ { "note!": "This file is auto-generated by scripts/htmlDependencies.R", "package": "bslib", - "version": "Github (rstudio/bslib@43d46da7416067575dd32a660219625abae5571e)" + "version": "Github (rstudio/bslib@2ec3067eb20fcdcd25260a8ee7ec6a7607839429)" } From 56a72f255d9a1d5a63694436f6f3616f12d86b0a Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 19 Mar 2024 11:10:59 -0400 Subject: [PATCH 4/4] docs: update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92fadfd52..b8e7ad55f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking Changes +* 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) + ### New features * `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) @@ -23,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * 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) +* `ui.layout_columns()` now correctly applies the `row_heights` at the `xs` breakpoint, if supplied. (#1222) + ### Other changes ## [0.8.1] - 2024-03-06