Skip to content

Commit

Permalink
Merge branch 'main' into chat/status-message
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Mar 5, 2025
2 parents c3f7f3b + 214dff4 commit ad23361
Show file tree
Hide file tree
Showing 135 changed files with 15,729 additions and 24,884 deletions.
108 changes: 108 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Bug Report
description: Report a bug in Shiny for Python
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
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.
- type: dropdown
id: component
attributes:
label: Component
description: Which part of Shiny is affected?
options:
- UI (ui.*)
- Server (server.*)
- Reactive Programming
- Input/Output Bindings
- Session Management
- Deployment
- Documentation
- Installation
- Other
validations:
required: true

- type: dropdown
id: severity
attributes:
label: Severity
options:
- P0 - Critical (crash/unusable)
- P1 - High (major feature broken)
- P2 - Medium (workaround exists)
- P3 - Low (minor inconvenience)
validations:
required: true

- type: input
id: version
attributes:
label: Shiny Version
description: '`shiny --version`'
placeholder: ex. 1.2.1
validations:
required: true

- type: input
id: python-version
attributes:
label: Python Version
description: '`python --version`'
placeholder: ex. 3.10.6
validations:
required: true

- type: textarea
id: minimal-example
attributes:
label: Minimal Reproducible Example
description: |
A *minimal*, self-contained app demonstrating the issue. Remove unrelated code. We should be able to copy, paste, and run it.
Template:
```python
from shiny import App, render, ui
app_ui = ui.page_fluid()
def server(input, output, session):
pass
app = App(app_ui, server)
```
render: python
validations:
required: true

- type: textarea
id: behavior
attributes:
label: Behavior
description: Describe what *is* happening and what you *expected* to happen.
placeholder: |
Current: When I click..., the app freezes.
Expected: The plot should update without freezing.
validations:
required: true

- type: textarea
id: errors
attributes:
label: Error Messages (if any)
description: Copy and paste any errors/tracebacks.
render: shell

- type: textarea
id: environment
attributes:
label: Environment
description: |
- OS: [e.g., Windows 10, macOS 15.2]
- Browser: [e.g., Chrome 132]
- Dependencies: `pip freeze` or `conda list` (especially `shiny`, `pandas`, `numpy`, etc.)
render: markdown
validations:
required: true
89 changes: 89 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Documentation Issue
description: Report an issue or suggest improvements to the documentation.
title: "[Docs]: "
labels: ["documentation"]
body:
- type: markdown
attributes:
value: |
Thanks for helping improve the documentation! Provide as much detail as possible.
- type: dropdown
id: doc-type
attributes:
label: Type
description: What type of documentation?
options:
- API Reference
- Tutorials/Guides
- Examples
- Getting Started
- Conceptual Guides
- Function Docstrings
- Code Comments
- Installation
- Deployment
- Testing
- Other
validations:
required: true

- type: input
id: doc-location
attributes:
label: Location
description: URL or file path of the documentation.
placeholder: "e.g., https://... or `shiny/ui/__init__.py`"
validations:
required: true

- type: dropdown
id: issue-type
attributes:
label: Issue
description: What kind of issue?
options:
- Missing
- Incorrect
- Unclear
- Outdated
- Broken Links
- Code Example Issue
- Typo/Grammar
- Translation
- Suggestion
- Other
validations:
required: true

- type: textarea
id: suggested-content
attributes:
label: Suggested Changes
description: |
What changes would you like to see? Be specific. Include suggested text or code (use markdown code blocks).
placeholder: |
Provide suggested improvements or new content here...
```python
# Example code
```
validations:
required: true

- type: textarea
id: motivation
attributes:
label: Motivation (Optional)
description: Why is this change needed? How will it help users?
placeholder: "e.g., This clarification will prevent misunderstanding..."
validations:
required: false

- type: input
id: shiny-version
attributes:
label: Shiny Version (if applicable)
description: Only if the issue is version-specific.
placeholder: ex. 1.2.1
validations:
required: false
99 changes: 99 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Feature Request
description: Suggest an idea for Shiny for Python.
title: "[Feature]: "
labels: ["enhancement", "needs-triage"]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a new feature! Please provide as much detail as possible.
- type: dropdown
id: feature-category
attributes:
label: Category
description: What area of Shiny would this enhance?
options:
- UI Components
- Reactive Programming
- Input/Output
- Deployment
- Dev Tools
- Performance
- Testing
- Accessibility
- Integrations
- Other
validations:
required: true

- type: dropdown
id: feature-scope
attributes:
label: Scope
options:
- Major Feature
- Minor Enhancement
- Quality of Life
- Experimental
validations:
required: true

- type: textarea
id: problem-description
attributes:
label: Problem
description: What problem does this feature solve? Why is it needed?
placeholder: |
As a user, I'm frustrated when... because...
I have to workaround this by..., which is not ideal because...
validations:
required: true

- type: textarea
id: proposed-solution
attributes:
label: Solution
description: Describe the feature. What should it do? How should it work?
placeholder: |
I would like a feature that...
```python
# Potential API (if applicable)
from shiny import ui
ui.new_component(...)
```
validations:
required: true
- type: textarea
id: alternative-solutions
attributes:
label: Alternatives (Optional)
description: Have you considered alternatives? Why are they less suitable?
placeholder: "I've considered... but my solution is better because..."

- type: textarea
id: example-usage
attributes:
label: Example (Optional)
description: Code example of how this feature would be used.
placeholder: |
```python
from shiny import App, ui
app_ui = ui.page_fluid(ui.your_new_feature(...))
```
render: python

- type: textarea
id: expected-impact
attributes:
label: Impact (Optional)
description: How would this benefit users? Who would use it?
placeholder: "Useful for users who want to... Enables new use cases..."
- type: dropdown
id: contribution-interest
attributes:
label: Contribution? (Optional)
options:
- Yes, I can implement (or help).
- Yes, I can review/test.
- No, just suggesting.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:

playwright-examples:
if: github.event_name != 'release'
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.11", "3.10", "3.9"]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-js-built.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
if [[ `git status --porcelain` ]]; then
git diff
echo "Uncommitted changes found. Please commit any changes that result from 'npm run build'."
echo "Uncommitted changes found. Please commit any changes that result from 'npm ci && npm run build'."
exit 1
else
echo "No uncommitted changes found."
Expand Down
37 changes: 27 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

### Changes

* 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.

## [1.3.0] - 2025-03-03

### New features

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

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

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

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

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

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

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

### Bug fixes
* 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)

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

### Changes
* `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)

### Breaking changes

* 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.

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).

* The Shiny Core component `shiny.ui.Chat()` no longer has a `.ui()` method. This method
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)
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)

### Bug fixes

* `ui.Chat()` now correctly handles new `ollama.chat()` return value introduced in `ollama` v0.4. (#1787)

* Updated `expect_height()` for Valuebox controllers to check the height property instead of max-height. (#1816)

## [1.2.1] - 2024-11-14

Expand Down
Loading

0 comments on commit ad23361

Please sign in to comment.