Skip to content

Commit f3ceb9c

Browse files
gadenbuiecpsievert
andauthored
feat: Toasts (#2111)
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
1 parent 23162f9 commit f3ceb9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2796
-1514
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ test-results.xml
130130
results-inspect-ai/
131131
test-results-inspect-ai/
132132
tests/inspect-ai/scripts/test_metadata.json
133+
/.claude/

CHANGELOG.md

Lines changed: 2 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
### New features
1111

12+
* Added toast notification system with `ui.toast()`, `ui.toast_header()`, `ui.show_toast()`, and `ui.hide_toast()`. Toast notifications are temporary, non-intrusive messages that support multiple semantic types (success, warning, error, etc.), flexible positioning (9 positions: top/middle/bottom × left/center/right), auto-hide with configurable duration, optional headers with icons, and programmatic control. (#2111)
13+
1214
* Added a new `input_submit_textarea()` input element, which is similar to `input_text_area()`, but includes a submit button to only submit the text changes to the server on click. This is especially useful when the input text change triggers a long-running operation and/or the user wants to type longer-form input and review it before submitting it. (#2099)
1315

1416
### Bug fixes

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ format-isort: FORCE
112112
@echo "-------- Sorting imports with isort --------"
113113
isort .
114114

115+
test-update-snapshots: FORCE ## Update test snapshots
116+
@echo "-------- Updating test snapshots ----------"
117+
pytest --snapshot-update
118+
115119
docs: FORCE ## docs: build docs with quartodoc
116120
@echo "-------- Building docs with quartodoc ------"
117121
@cd docs && make quartodoc

docs/_quartodoc-core.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ quartodoc:
237237
- ui.help_text
238238
- ui.notification_show
239239
- ui.notification_remove
240+
- ui.toast
241+
- ui.toast_header
242+
- ui.show_toast
243+
- ui.hide_toast
240244
- ui.modal
241245
- ui.modal_show
242246
- ui.modal_remove

docs/_quartodoc-express.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ quartodoc:
148148
- express.ui.help_text
149149
- express.ui.notification_show
150150
- express.ui.notification_remove
151+
- express.ui.toast
152+
- express.ui.toast_header
153+
- express.ui.show_toast
154+
- express.ui.hide_toast
151155
- express.ui.modal
152156
- express.ui.modal_show
153157
- express.ui.modal_remove

docs/_quartodoc-testing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ quartodoc:
2020
- playwright.controller.Card
2121
- playwright.controller.Popover
2222
- playwright.controller.Sidebar
23+
- playwright.controller.Toast
2324
- playwright.controller.Tooltip
2425
- title: UI Inputs
2526
desc: Methods for interacting with Shiny app input value controller.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ add-test = [
128128
"chatlas[anthropic,openai]",
129129
"openai>=1.104.1",
130130
"anthropic>=0.62.0",
131-
"inspect-ai>=0.3.129",
131+
"inspect-ai>=0.3.129;python_version>='3.10'",
132132
"pytest-timeout",
133133
"pytest>=6.2.4",
134134
"pytest-playwright>=0.5.2",

shiny/_docstring.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def __init__(
228228
dir: str,
229229
type: Optional[Literal["core", "express"]] = None,
230230
) -> None:
231+
super().__init__(type, file_names, dir)
231232
self.type = type or os.environ.get("SHINY_MODE", "core")
232233
self.file_names = [file_names] if isinstance(file_names, str) else file_names
233234
self.dir = dir
@@ -250,8 +251,9 @@ def __init__(
250251
self,
251252
file_names: list[str] | str,
252253
dir: str,
254+
type: Literal["express"] = "express",
253255
) -> None:
254-
super().__init__(file_names, dir, "express")
256+
super().__init__(file_names, dir, type)
255257

256258

257259
def app_choose_core_or_express(

shiny/_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
shiny_html_deps = "1.11.1.9001"
2-
bslib = "0.9.0.9000"
2+
bslib = "0.9.0.9002"
33
htmltools = "0.5.8.9000"
44
bootstrap = "5.3.1"
55
requirejs = "2.3.6"

0 commit comments

Comments
 (0)