Skip to content

Commit ad23361

Browse files
committed
Merge branch 'main' into chat/status-message
2 parents c3f7f3b + 214dff4 commit ad23361

File tree

135 files changed

+15729
-24884
lines changed

Some content is hidden

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

135 files changed

+15729
-24884
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Bug Report
2+
description: Report a bug in Shiny for Python
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for reporting a bug! Please provide a **Minimal Reproducible Example** (MRE). This is the *most important* part. The easier it is for us to reproduce the bug, the faster we can fix it. Search for similar issues before submitting.
10+
11+
- type: dropdown
12+
id: component
13+
attributes:
14+
label: Component
15+
description: Which part of Shiny is affected?
16+
options:
17+
- UI (ui.*)
18+
- Server (server.*)
19+
- Reactive Programming
20+
- Input/Output Bindings
21+
- Session Management
22+
- Deployment
23+
- Documentation
24+
- Installation
25+
- Other
26+
validations:
27+
required: true
28+
29+
- type: dropdown
30+
id: severity
31+
attributes:
32+
label: Severity
33+
options:
34+
- P0 - Critical (crash/unusable)
35+
- P1 - High (major feature broken)
36+
- P2 - Medium (workaround exists)
37+
- P3 - Low (minor inconvenience)
38+
validations:
39+
required: true
40+
41+
- type: input
42+
id: version
43+
attributes:
44+
label: Shiny Version
45+
description: '`shiny --version`'
46+
placeholder: ex. 1.2.1
47+
validations:
48+
required: true
49+
50+
- type: input
51+
id: python-version
52+
attributes:
53+
label: Python Version
54+
description: '`python --version`'
55+
placeholder: ex. 3.10.6
56+
validations:
57+
required: true
58+
59+
- type: textarea
60+
id: minimal-example
61+
attributes:
62+
label: Minimal Reproducible Example
63+
description: |
64+
A *minimal*, self-contained app demonstrating the issue. Remove unrelated code. We should be able to copy, paste, and run it.
65+
66+
Template:
67+
68+
```python
69+
from shiny import App, render, ui
70+
71+
app_ui = ui.page_fluid()
72+
def server(input, output, session):
73+
pass
74+
app = App(app_ui, server)
75+
```
76+
render: python
77+
validations:
78+
required: true
79+
80+
- type: textarea
81+
id: behavior
82+
attributes:
83+
label: Behavior
84+
description: Describe what *is* happening and what you *expected* to happen.
85+
placeholder: |
86+
Current: When I click..., the app freezes.
87+
Expected: The plot should update without freezing.
88+
validations:
89+
required: true
90+
91+
- type: textarea
92+
id: errors
93+
attributes:
94+
label: Error Messages (if any)
95+
description: Copy and paste any errors/tracebacks.
96+
render: shell
97+
98+
- type: textarea
99+
id: environment
100+
attributes:
101+
label: Environment
102+
description: |
103+
- OS: [e.g., Windows 10, macOS 15.2]
104+
- Browser: [e.g., Chrome 132]
105+
- Dependencies: `pip freeze` or `conda list` (especially `shiny`, `pandas`, `numpy`, etc.)
106+
render: markdown
107+
validations:
108+
required: true
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Documentation Issue
2+
description: Report an issue or suggest improvements to the documentation.
3+
title: "[Docs]: "
4+
labels: ["documentation"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for helping improve the documentation! Provide as much detail as possible.
10+
11+
- type: dropdown
12+
id: doc-type
13+
attributes:
14+
label: Type
15+
description: What type of documentation?
16+
options:
17+
- API Reference
18+
- Tutorials/Guides
19+
- Examples
20+
- Getting Started
21+
- Conceptual Guides
22+
- Function Docstrings
23+
- Code Comments
24+
- Installation
25+
- Deployment
26+
- Testing
27+
- Other
28+
validations:
29+
required: true
30+
31+
- type: input
32+
id: doc-location
33+
attributes:
34+
label: Location
35+
description: URL or file path of the documentation.
36+
placeholder: "e.g., https://... or `shiny/ui/__init__.py`"
37+
validations:
38+
required: true
39+
40+
- type: dropdown
41+
id: issue-type
42+
attributes:
43+
label: Issue
44+
description: What kind of issue?
45+
options:
46+
- Missing
47+
- Incorrect
48+
- Unclear
49+
- Outdated
50+
- Broken Links
51+
- Code Example Issue
52+
- Typo/Grammar
53+
- Translation
54+
- Suggestion
55+
- Other
56+
validations:
57+
required: true
58+
59+
- type: textarea
60+
id: suggested-content
61+
attributes:
62+
label: Suggested Changes
63+
description: |
64+
What changes would you like to see? Be specific. Include suggested text or code (use markdown code blocks).
65+
placeholder: |
66+
Provide suggested improvements or new content here...
67+
```python
68+
# Example code
69+
```
70+
validations:
71+
required: true
72+
73+
- type: textarea
74+
id: motivation
75+
attributes:
76+
label: Motivation (Optional)
77+
description: Why is this change needed? How will it help users?
78+
placeholder: "e.g., This clarification will prevent misunderstanding..."
79+
validations:
80+
required: false
81+
82+
- type: input
83+
id: shiny-version
84+
attributes:
85+
label: Shiny Version (if applicable)
86+
description: Only if the issue is version-specific.
87+
placeholder: ex. 1.2.1
88+
validations:
89+
required: false
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Feature Request
2+
description: Suggest an idea for Shiny for Python.
3+
title: "[Feature]: "
4+
labels: ["enhancement", "needs-triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for suggesting a new feature! Please provide as much detail as possible.
10+
11+
- type: dropdown
12+
id: feature-category
13+
attributes:
14+
label: Category
15+
description: What area of Shiny would this enhance?
16+
options:
17+
- UI Components
18+
- Reactive Programming
19+
- Input/Output
20+
- Deployment
21+
- Dev Tools
22+
- Performance
23+
- Testing
24+
- Accessibility
25+
- Integrations
26+
- Other
27+
validations:
28+
required: true
29+
30+
- type: dropdown
31+
id: feature-scope
32+
attributes:
33+
label: Scope
34+
options:
35+
- Major Feature
36+
- Minor Enhancement
37+
- Quality of Life
38+
- Experimental
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: problem-description
44+
attributes:
45+
label: Problem
46+
description: What problem does this feature solve? Why is it needed?
47+
placeholder: |
48+
As a user, I'm frustrated when... because...
49+
I have to workaround this by..., which is not ideal because...
50+
validations:
51+
required: true
52+
53+
- type: textarea
54+
id: proposed-solution
55+
attributes:
56+
label: Solution
57+
description: Describe the feature. What should it do? How should it work?
58+
placeholder: |
59+
I would like a feature that...
60+
```python
61+
# Potential API (if applicable)
62+
from shiny import ui
63+
ui.new_component(...)
64+
```
65+
validations:
66+
required: true
67+
- type: textarea
68+
id: alternative-solutions
69+
attributes:
70+
label: Alternatives (Optional)
71+
description: Have you considered alternatives? Why are they less suitable?
72+
placeholder: "I've considered... but my solution is better because..."
73+
74+
- type: textarea
75+
id: example-usage
76+
attributes:
77+
label: Example (Optional)
78+
description: Code example of how this feature would be used.
79+
placeholder: |
80+
```python
81+
from shiny import App, ui
82+
app_ui = ui.page_fluid(ui.your_new_feature(...))
83+
```
84+
render: python
85+
86+
- type: textarea
87+
id: expected-impact
88+
attributes:
89+
label: Impact (Optional)
90+
description: How would this benefit users? Who would use it?
91+
placeholder: "Useful for users who want to... Enables new use cases..."
92+
- type: dropdown
93+
id: contribution-interest
94+
attributes:
95+
label: Contribution? (Optional)
96+
options:
97+
- Yes, I can implement (or help).
98+
- Yes, I can review/test.
99+
- No, just suggesting.

.github/workflows/pytest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154

155155
playwright-examples:
156156
if: github.event_name != 'release'
157-
runs-on: ubuntu-20.04
157+
runs-on: ubuntu-latest
158158
strategy:
159159
matrix:
160160
python-version: ["3.12", "3.11", "3.10", "3.9"]

.github/workflows/verify-js-built.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: |
4040
if [[ `git status --porcelain` ]]; then
4141
git diff
42-
echo "Uncommitted changes found. Please commit any changes that result from 'npm run build'."
42+
echo "Uncommitted changes found. Please commit any changes that result from 'npm ci && npm run build'."
4343
exit 1
4444
else
4545
echo "No uncommitted changes found."

CHANGELOG.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [UNRELEASED]
99

10+
### Changes
11+
12+
* The `.get_latest_stream_result()` method on `ui.MarkdownStream()` was deprecated in favor of the new `.latest_stream` property. Call `.result()` on the property to get the latest result, `.status` to check the status, and `.cancel()` to cancel the stream.
13+
14+
## [1.3.0] - 2025-03-03
15+
1016
### New features
1117

1218
* Added a new `ui.MarkdownStream()` component for performantly streaming in chunks of markdown/html strings into the UI. This component is primarily useful for text-based generative AI where responses are received incrementally. (#1782)
@@ -16,30 +22,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1622
* Add a `data-suggestion` attribute to an HTML element, and set the value to the input suggestion text (e.g., `<span data-suggestion="Suggestion value">Suggestion link</span>`)
1723
* To auto-submit the suggestion when clicked by the user, include the `.submit` class or the `data-suggestion-submit="true"` attribute on the HTML element. Alternatively, use Cmd/Ctrl + click to auto-submit any suggestion or Alt/Opt + click to apply any suggestion to the chat input without submitting.
1824

19-
* Added a new `.add_sass_layer_file()` method to `ui.Theme` that supports reading a Sass file with layer boundary comments, e.g. `/*-- scss:defaults --*/`. This format [is supported by Quarto](https://quarto.org/docs/output-formats/html-themes-more.html#bootstrap-bootswatch-layering) and makes it easier to store Sass rules and declarations that need to be woven into Shiny's Sass Bootstrap files. (#1790)
20-
21-
* The `ui.Chat()` component gains the following:
25+
* The `ui.Chat()` component also gains the following:
2226
* The `.on_user_submit()` decorator method now passes the user input to the decorated function. This makes it a bit easier to access the user input. See the new templates (mentioned below) for examples. (#1801)
23-
* A new `get_latest_stream_result()` method was added for an easy way to access the final result of the stream when it completes. (#1846)
27+
* The assistant icon is now configurable via `ui.chat_ui()` (or the `ui.Chat.ui()` method in Shiny Express) or for individual messages in the `.append_message()` and `.append_message_stream()` methods of `ui.Chat()`. (#1853)
28+
* A new `latest_message_stream` property was added for an easy way to reactively read the stream's status, result, and also cancel an in progress stream. (#1846)
2429
* The `.append_message_stream()` method now returns the `reactive.extended_task` instance that it launches. (#1846)
30+
* The `ui.Chat()` component's `.update_user_input()` method gains `submit` and `focus` options that allow you to submit the input on behalf of the user and to choose whether the input receives focus after the update. (#1851)
2531

2632
* `shiny create` includes new and improved `ui.Chat()` template options. Most of these templates leverage the new [`{chatlas}` package](https://posit-dev.github.io/chatlas/), our opinionated approach to interfacing with various LLM. (#1806)
2733

2834
* Client data values (e.g., url info, output sizes/styles, etc.) can now be accessed in the server-side Python code via `session.clientdata`. For example, `session.clientdata.url_search()` reactively reads the URL search parameters. (#1832)
2935

3036
* Available `input` ids can now be listed via `dir(input)`. This also works on the new `session.clientdata` object. (#1832)
3137

32-
* The `ui.Chat()` component's `.update_user_input()` method gains `submit` and `focus` options that allow you to submit the input on behalf of the user and to choose whether the input receives focus after the update. (#1851)
38+
* `ui.input_text()`, `ui.input_text_area()`, `ui.input_numeric()` and `ui.input_password()` all gain an `update_on` option. `update_on="change"` is the default and previous behavior, where the input value updates immediately whenever the value changes. With `update_on="blur"`, the input value will update only when the text input loses focus or when the user presses Enter (or Cmd/Ctrl + Enter for `ui.input_text_area()`). (#1874)
3339

34-
### Bug fixes
40+
* Added a new `.add_sass_layer_file()` method to `ui.Theme` that supports reading a Sass file with layer boundary comments, e.g. `/*-- scss:defaults --*/`. This format [is supported by Quarto](https://quarto.org/docs/output-formats/html-themes-more.html#bootstrap-bootswatch-layering) and makes it easier to store Sass rules and declarations that need to be woven into Shiny's Sass Bootstrap files. (#1790)
3541

36-
* `ui.Chat()` now correctly handles new `ollama.chat()` return value introduced in `ollama` v0.4. (#1787)
42+
* Added a new `expect_max_height()` method to the Valuebox controllers to check the maximum height of a value box (#1816)
3743

38-
### Changes
44+
* `shiny.pytest.create_app_fixture(app)` gained support for multiple app file paths when creating your test fixture. If multiple file paths are given, it will behave as a parameterized fixture value and execute the test for each app path. (#1869)
45+
46+
### Breaking changes
47+
48+
* The navbar-related style options of `ui.page_navbar()` and `ui.navset_bar()` have been consolidated into a single `navbar_options` argument that pairs with a new `ui.navbar_options()` helper. Using the direct `position`, `bg`, `inverse`, `collapsible`, and `underline` arguments will continue to work with a deprecation message.
49+
50+
Related to this change, `ui.navset_bar()` now defaults to using `underline=True` so that it uses the same set of default `ui.navbar_options()` as the page variant. In `ui.navbar_options()`, `inverse` is replaced by `theme`, which takes values `"light"` (dark text on a **light** background), `"dark"` (light text on a **dark** background), or `"auto"` (follow page settings).
3951

4052
* The Shiny Core component `shiny.ui.Chat()` no longer has a `.ui()` method. This method
41-
was never intended to be used in Shiny Core (in that case, use `shiny.ui.chat_ui()`) to create the UI element. Note that the `shiny.express.ui.Chat()`
42-
class still has a `.ui()` method. (#1840)
53+
was never intended to be used in Shiny Core (in that case, use `shiny.ui.chat_ui()`) to create the UI element. Note that the `shiny.express.ui.Chat()` class still has a `.ui()` method. (#1840)
54+
55+
### Bug fixes
56+
57+
* `ui.Chat()` now correctly handles new `ollama.chat()` return value introduced in `ollama` v0.4. (#1787)
58+
59+
* Updated `expect_height()` for Valuebox controllers to check the height property instead of max-height. (#1816)
4360

4461
## [1.2.1] - 2024-11-14
4562

0 commit comments

Comments
 (0)