Skip to content

feat(layout_columns): Use sm as the default col_widths breakpoint #1222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
10 changes: 3 additions & 7 deletions shiny/ui/_layout_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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] = {}
Expand Down
2 changes: 1 addition & 1 deletion shiny/www/shared/_version.json
Original file line number Diff line number Diff line change
@@ -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)"
}
4 changes: 2 additions & 2 deletions shiny/www/shared/bootstrap/_version.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion shiny/www/shared/bslib/_version.json
Original file line number Diff line number Diff line change
@@ -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)"
}