Skip to content

Commit a63f389

Browse files
authored
Merge branch 'main' into bookmarking
2 parents 2d6af57 + e1d4a50 commit a63f389

File tree

120 files changed

+9086
-24816
lines changed

Some content is hidden

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

120 files changed

+9086
-24816
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.

CHANGELOG.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to Shiny for Python will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [UNRELEASED]
8+
## [1.3.0] - 2025-03-03
99

1010
### New features
1111

@@ -16,32 +16,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
* 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>`)
1717
* 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.
1818

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:
19+
* The `ui.Chat()` component also gains the following:
2220
* 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)
21+
* 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)
22+
* 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)
2423
* The `.append_message_stream()` method now returns the `reactive.extended_task` instance that it launches. (#1846)
24+
* 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)
2525

2626
* `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)
2727

2828
* 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)
2929

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

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)
32+
* `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)
3333

34-
* The assistant icons 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)
34+
* 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)
3535

36-
### Bug fixes
36+
* Added a new `expect_max_height()` method to the Valuebox controllers to check the maximum height of a value box (#1816)
3737

38-
* `ui.Chat()` now correctly handles new `ollama.chat()` return value introduced in `ollama` v0.4. (#1787)
38+
* `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)
39+
40+
### Breaking changes
3941

40-
### Changes
42+
* 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.
43+
44+
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).
4145

4246
* The Shiny Core component `shiny.ui.Chat()` no longer has a `.ui()` method. This method
43-
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()`
44-
class still has a `.ui()` method. (#1840)
47+
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)
48+
49+
### Bug fixes
50+
51+
* `ui.Chat()` now correctly handles new `ollama.chat()` return value introduced in `ollama` v0.4. (#1787)
52+
53+
* Updated `expect_height()` for Valuebox controllers to check the height property instead of max-height. (#1816)
4554

4655
## [1.2.1] - 2024-11-14
4756

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ git fetch --tags upstream
5858
Then install:
5959

6060
```sh
61-
pip install -e ".[dev,test]"
61+
pip install -e ".[dev,test,doc]"
6262
```
6363

6464
Additionally, you can install pre-commit hooks which will automatically reformat and lint the code when you make a commit:
@@ -69,3 +69,29 @@ pre-commit install
6969
# To disable:
7070
# pre-commit uninstall
7171
```
72+
73+
Tests should now pass:
74+
75+
```sh
76+
make check
77+
# To apply formatting fixes instead of erroring:
78+
# make check-fix
79+
```
80+
81+
Or get a full list of helpers with just:
82+
83+
```sh
84+
make
85+
```
86+
87+
Typically, when developing new features for Shiny, you'll want to try them out in an application.
88+
In a **separate** application directory, use can use `-e` to reference your local checkout of `py-shiny`:
89+
90+
```sh
91+
# Rather than
92+
# pip install shiny
93+
# run:
94+
pip install -e ../py-shiny --config-settings editable_mode=compat
95+
```
96+
97+
See the [docs README](docs/README.md) for instructions on building the documentation locally.

0 commit comments

Comments
 (0)