Skip to content

feat: update to latest shiny JS/CSS assets #2020

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion shiny/_versions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
shiny_html_deps = "1.10.0.9001"
shiny_html_deps = "1.11.0.9000"
bslib = "0.9.0.9000"
htmltools = "0.5.8.9000"
bootstrap = "5.3.1"
Expand Down
13 changes: 12 additions & 1 deletion shiny/ui/_input_action_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ def input_action_button(
return tags.button(
{"class": "btn btn-default action-button", "style": css(width=width)},
icon,
None if icon is None else " ",
# The separator element helps us distinguish between the icon and label
# when dynamically updating the button/link (see rstudio/shiny#4242)
tags.span(class_="shiny-icon-separator") if icon else None,
# Adds a space between the icon and label
# TODO: this space gets removed when icon/label are updated dynamically,
# which is not ideal. The 'right' way to do this would be to either
# add a CSS class to the separator element, or wrap both the icon and
# label in a container element.
" " if icon and label else None,
Comment on lines +70 to +75
Copy link
Collaborator Author

@cpsievert cpsievert Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This obviously isn't ideal, and long-term this isn't the approach to spacing that we'd want, but I'm thinking I'll just keep it to retain the current behavior.

Copy link
Collaborator Author

@cpsievert cpsievert Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, the old JS logic would (unconditionally, for both button and links!!) add a space when updating to either the icon or label

https://github.com/rstudio/shiny/blob/33dc41c/srcts/src/bindings/input/actionbutton.ts#L73

This is a big bummer because, unless we add the space in the server-side update, the space gets removed on update 😭

cc @gadenbuie

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we make a decision here, I'm gonna look into rstudio/shiny#4249 as a possible direction

label,
id=resolve_id(id),
type="button",
Expand Down Expand Up @@ -117,6 +125,9 @@ def input_action_link(
return tags.a(
{"class": "action-button"},
icon,
# The separator element helps us distinguish between the icon and label
# when dynamically updating the button/link (see rstudio/shiny#4242)
tags.span(class_="shiny-icon-separator") if icon else None,
label,
id=resolve_id(id),
href="#",
Expand Down
76 changes: 42 additions & 34 deletions shiny/ui/_input_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
def update_action_button(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
icon: TagChild = None,
disabled: Optional[bool] = None,
session: Optional[Session] = None,
Expand Down Expand Up @@ -104,11 +104,9 @@ def update_action_button(
"""

session = require_active_session(session)
# TODO: supporting a TagChild for label would require changes to shiny.js
# https://github.com/rstudio/shiny/issues/1140
msg = {
"label": label,
"icon": session._process_ui(icon)["html"] if icon else None,
"label": session._process_ui(label) if label else None,
"icon": session._process_ui(icon) if icon else None,
"disabled": disabled,
}
session.send_input_message(id, drop_none(msg))
Expand All @@ -119,7 +117,7 @@ def update_action_button(
def update_action_link(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
icon: TagChild = None,
session: Optional[Session] = None,
) -> None:
Expand Down Expand Up @@ -148,11 +146,9 @@ def update_action_link(
"""

session = require_active_session(session)
# TODO: supporting a TagChild for label would require changes to shiny.js
# https://github.com/rstudio/shiny/issues/1140
msg = {
"label": label,
"icon": session._process_ui(icon)["html"] if icon else None,
"label": session._process_ui(label) if label else None,
"icon": session._process_ui(icon) if icon else None,
}
session.send_input_message(id, drop_none(msg))

Expand Down Expand Up @@ -229,7 +225,7 @@ def callback() -> None:
def update_checkbox(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
value: Optional[bool] = None,
session: Optional[Session] = None,
) -> None:
Expand Down Expand Up @@ -258,7 +254,10 @@ def update_checkbox(
"""

session = require_active_session(session)
msg = {"label": label, "value": value}
msg = {
"label": session._process_ui(label) if label else None,
"value": value,
}
session.send_input_message(id, drop_none(msg))


Expand All @@ -267,7 +266,7 @@ def update_checkbox(
def update_switch(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
value: Optional[bool] = None,
session: Optional[Session] = None,
) -> None:
Expand Down Expand Up @@ -296,7 +295,10 @@ def update_switch(
"""

session = require_active_session(session)
msg = {"label": label, "value": value}
msg = {
"label": session._process_ui(label) if label else None,
"value": value,
}
session.send_input_message(id, drop_none(msg))


Expand All @@ -305,7 +307,7 @@ def update_switch(
def update_checkbox_group(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
choices: Optional[ChoicesArg] = None,
selected: Optional[str | list[str] | tuple[str, ...]] = None,
inline: bool = False,
Expand Down Expand Up @@ -357,7 +359,7 @@ def update_checkbox_group(
def update_radio_buttons(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
choices: Optional[ChoicesArg] = None,
selected: Optional[str] = None,
inline: bool = False,
Expand Down Expand Up @@ -408,7 +410,7 @@ def _update_choice_input(
id: str,
*,
type: Literal["checkbox", "radio"],
label: Optional[str] = None,
label: Optional[TagChild] = None,
choices: Optional[ChoicesArg] = None,
selected: Optional[str | list[str] | tuple[str, ...]] = None,
inline: bool = False,
Expand All @@ -429,7 +431,11 @@ def _update_choice_input(
inline=inline,
)
options = session._process_ui(opts)["html"]
msg = {"label": label, "options": options, "value": selected}
msg = {
"label": session._process_ui(label) if label else None,
"options": options,
"value": selected,
}
session.send_input_message(id, drop_none(msg))


Expand All @@ -441,7 +447,7 @@ def _update_choice_input(
def update_date(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
value: Optional[date | str] = None,
min: Optional[date | str] = None,
max: Optional[date | str] = None,
Expand Down Expand Up @@ -478,7 +484,7 @@ def update_date(

session = require_active_session(session)
msg = {
"label": label,
"label": session._process_ui(label) if label else None,
"value": _as_date_attr(value),
"min": _as_date_attr(min),
"max": _as_date_attr(max),
Expand All @@ -491,7 +497,7 @@ def update_date(
def update_date_range(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
start: Optional[date | str] = None,
end: Optional[date | str] = None,
min: Optional[date | str] = None,
Expand Down Expand Up @@ -535,7 +541,7 @@ def update_date_range(
session = require_active_session(session)
value = {"start": _as_date_attr(start), "end": _as_date_attr(end)}
msg = {
"label": label,
"label": session._process_ui(label) if label else None,
"value": drop_none(value),
"min": _as_date_attr(min),
"max": _as_date_attr(max),
Expand All @@ -551,7 +557,7 @@ def update_date_range(
def update_numeric(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
value: Optional[float] = None,
min: Optional[float] = None,
max: Optional[float] = None,
Expand Down Expand Up @@ -589,7 +595,7 @@ def update_numeric(

session = require_active_session(session)
msg = {
"label": label,
"label": session._process_ui(label) if label else None,
"value": value,
"min": min,
"max": max,
Expand All @@ -606,7 +612,7 @@ def update_numeric(
def update_select(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
choices: Optional[SelectChoicesArg] = None,
selected: Optional[str | list[str]] = None,
session: Optional[Session] = None,
Expand Down Expand Up @@ -652,12 +658,10 @@ def update_select(
options = None
else:
option_tags = _render_choices(_normalize_choices(choices), selected)
# Typing problem due to a bug in pylance:
# https://github.com/microsoft/pylance-release/issues/2377
options = session._process_ui(option_tags)["html"] # type: ignore
options = session._process_ui(option_tags)["html"]

msg = {
"label": label,
"label": session._process_ui(label) if label else None,
"options": options,
"value": selected_values,
}
Expand All @@ -675,7 +679,7 @@ class FlatSelectChoice(TypedDict):
def update_selectize(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
choices: Optional[SelectChoicesArg] = None,
selected: Optional[str | list[str]] = None,
options: Optional[dict[str, str | float | JSEval]] = None,
Expand Down Expand Up @@ -854,7 +858,7 @@ def selectize_choices_json(request: Request) -> Response:
def update_slider(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
value: Optional[SliderValueArg | tuple[SliderValueArg, SliderValueArg]] = None,
min: Optional[SliderValueArg] = None,
max: Optional[SliderValueArg] = None,
Expand Down Expand Up @@ -928,7 +932,7 @@ def update_slider(
value_num = None

msg = {
"label": label,
"label": session._process_ui(label) if label else None,
"value": value_num,
"min": min_num,
"max": max_num,
Expand All @@ -948,7 +952,7 @@ def update_slider(
def update_text(
id: str,
*,
label: Optional[str] = None,
label: Optional[TagChild] = None,
value: Optional[str] = None,
placeholder: Optional[str] = None,
session: Optional[Session] = None,
Expand Down Expand Up @@ -980,7 +984,11 @@ def update_text(
"""

session = require_active_session(session)
msg = {"label": label, "value": value, "placeholder": placeholder}
msg = {
"label": session._process_ui(label) if label else None,
"value": value,
"placeholder": placeholder,
}
session.send_input_message(id, drop_none(msg))


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!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
"package": "shiny",
"version": "1.10.0.9001 (rstudio/shiny@ca41c0831befcf8feea17980a91983ce21d1b8a2)"
"version": "1.11.0.9000 (rstudio/shiny@460a93a5fdc1f152d2ec3d5741a01c2712676526)"
}
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!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
"shiny_version": "1.10.0.9001 (rstudio/shiny@ca41c0831befcf8feea17980a91983ce21d1b8a2)",
"bslib_version": "0.9.0.9000 (rstudio/bslib@7cf80506c6beb9d7e5f2f146d2c9c935bbaf1635)",
"shiny_version": "1.11.0.9000 (rstudio/shiny@460a93a5fdc1f152d2ec3d5741a01c2712676526)",
"bslib_version": "0.9.0.9000 (rstudio/bslib@c707161125dc5646ce2b9990ab474b7cedaef920)",
"htmltools_version": "0.5.8.9000 (rstudio/htmltools@487aa0bed7313d7597b6edd5810e53cab0061198)",
"bootstrap_version": "5.3.1"
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
"package": "bslib",
"version": "0.9.0.9000 (rstudio/bslib@7cf80506c6beb9d7e5f2f146d2c9c935bbaf1635)"
"version": "0.9.0.9000 (rstudio/bslib@c707161125dc5646ce2b9990ab474b7cedaef920)"
}
2 changes: 1 addition & 1 deletion shiny/www/shared/busy-indicators/busy-indicators.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions shiny/www/shared/jqueryui/AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Authors ordered by first contribution
A list of current team members is available at http://jqueryui.com/about
A list of current team members is available at https://jqueryui.com/about

Paul Bakaus <paul.bakaus@gmail.com>
Richard Worth <rdworth@gmail.com>
Expand Down Expand Up @@ -42,7 +42,7 @@ Adam Sontag <ajpiano@ajpiano.com>
Carl Fürstenberg <carl@excito.com>
Kevin Dalman <development@allpro.net>
Alberto Fernández Capel <afcapel@gmail.com>
Jacek Jędrzejewski (http://jacek.jedrzejewski.name)
Jacek Jędrzejewski (https://jacek.jedrzejewski.name)
Ting Kuei <ting@kuei.com>
Samuel Cormier-Iijima <sam@chide.it>
Jon Palmer <jonspalmer@gmail.com>
Expand Down Expand Up @@ -370,3 +370,15 @@ dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Adam Lidén Hällgren <adamlh92@gmail.com>
James Hinderks <hinderks@gmail.com>
Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com>
Matías Cánepa <matias.canepa@gmail.com>
Ashish Kurmi <100655670+boahc077@users.noreply.github.com>
DeerBear <andrea.raimondi@gmail.com>
Дилян Палаузов <dpa-github@aegee.org>
Kenneth DeBacker <kcdebacker@gmail.com>
Timo Tijhof <krinkle@fastmail.com>
Timmy Willison <timmywil@users.noreply.github.com>
divdeploy <166095818+divdeploy@users.noreply.github.com>
mark van tilburg <markvantilburg@gmail.com>
Ralf Koller <1665422+rpkoller@users.noreply.github.com>
Porter Clevidence <116387727+porterclev@users.noreply.github.com>
Daniel García <93217193+Daniel-Garmig@users.noreply.github.com>
2 changes: 1 addition & 1 deletion shiny/www/shared/jqueryui/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/
Copyright OpenJS Foundation and other contributors, https://openjsf.org/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
Expand Down
Binary file modified shiny/www/shared/jqueryui/images/ui-icons_444444_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified shiny/www/shared/jqueryui/images/ui-icons_555555_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified shiny/www/shared/jqueryui/images/ui-icons_777620_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified shiny/www/shared/jqueryui/images/ui-icons_777777_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified shiny/www/shared/jqueryui/images/ui-icons_cc0000_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified shiny/www/shared/jqueryui/images/ui-icons_ffffff_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion shiny/www/shared/jqueryui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ <h2 class="demoHeaders">Highlight / Error</h2>
showLabel: false
});

$( "#radioset" ).buttonset();
$( "#radioset" ).controlgroup();

$( "#controlgroup" ).controlgroup();

Expand Down
Loading
Loading