Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ PR preview is ready!
|
There was a problem hiding this comment.
Pull request overview
This PR updates docstrings and embedded examples for Streamlit version 1.52.0, improving clarity, consistency, and completeness across Python and TypeScript documentation.
Key changes:
- Enhanced parameter documentation for widgets including date/time inputs, buttons, and chat components with clearer descriptions and formatting
- Added new examples for keyboard shortcuts, query parameters, and component cleanup functions
- Standardized documentation style across elements with improved descriptions of width/height parameters and text alignment
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/streamlit/navigation/page.py | Clarifies that spinner icons only appear in navigation menu, not as favicon |
| lib/streamlit/elements/widgets/time_widgets.py | Improves parameter descriptions for time_input, datetime_input, and date_input with better formatting and additional examples |
| lib/streamlit/elements/widgets/data_editor.py | Reorders height parameter options for consistency and clarifies placeholder parameter |
| lib/streamlit/elements/widgets/chat.py | Enhances audio recording documentation and restructures return value descriptions |
| lib/streamlit/elements/widgets/button.py | Expands keyboard shortcut documentation with detailed lists of supported keys and modifiers, adds new example |
| lib/streamlit/elements/widgets/audio_input.py | Improves sample_rate parameter documentation with clearer descriptions |
| lib/streamlit/elements/vega_charts.py | Adds deprecation notice for **kwargs parameter |
| lib/streamlit/elements/text.py | Adds note about text alignment visibility requirements |
| lib/streamlit/elements/plotly_chart.py | Improves height parameter documentation with more detailed descriptions |
| lib/streamlit/elements/metric.py | Restructures delta_arrow parameter documentation for better clarity |
| lib/streamlit/elements/markdown.py | Standardizes text alignment descriptions across markdown, caption, and badge functions |
| lib/streamlit/elements/html.py | Adds missing unsafe_allow_javascript parameter documentation |
| lib/streamlit/elements/heading.py | Adds text alignment notes to header, subheader, and title functions |
| lib/streamlit/elements/form.py | Updates form_submit_button shortcut parameter documentation |
| lib/streamlit/elements/arrow.py | Reorders height parameter options and clarifies placeholder parameter |
| lib/streamlit/components/v2/init.py | Adds new example demonstrating component cleanup function usage |
| lib/streamlit/commands/execution_control.py | Adds second example showing query parameter usage with st.navigation |
| frontend/component-v2-lib/src/types.ts | Enhances TypeScript documentation with @import annotations and clearer descriptions |
| >>> "`A`" if st.button("A", width=100, shortcut="Shift+A") else "` `" | ||
| >>> "`S`" if st.button("S", width=100, shortcut="Ctrl+S") else "` `" | ||
| >>> "`D`" if st.button("D", width=100, shortcut="Cmd+D") else "` `" | ||
| >>> "`F`" if st.button("F", width=100, shortcut="Mod+F") else "` `" |
There was a problem hiding this comment.
Maybe we add one example here using three keys: Mod+Alt+F to show that this is also possible
Update docstrings and embedded examples. n/a docs only --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. --------- Co-authored-by: Copilot <[email protected]>
| Option, Shift. | ||
|
|
||
| - Ctrl, Cmd, Meta, and Mod are interchangeable and will display to | ||
| the user to match their platform. |
There was a problem hiding this comment.
Hello, I'm sorry to intervene here directly but this looks wrong 👀:
The Ctrl & Cmd keys are different keys on Mac computers, I don't understand why they would be considered the same way..
Or are you saying that Ctrl cannot be mapped at all on Macs and it'll always use Cmd instead?
There was a problem hiding this comment.
Or are you saying that Ctrl cannot be mapped at all on Macs and it'll always use Cmd instead?
Yes.
Hi! 👋🏻 In Streamlit, those four keys will all map to the same key on any given system. The embedded example tries to show this. Take a look at https://doc-button-shortcuts.streamlit.app/
Even though the code used Cmd, Ctrl, and Mod, you will only see one of them depending on your system. I'm looking at the app on a Mac, and the last three buttons all have the Cmd symbol. :)
There was a problem hiding this comment.
Here's the internal implementation that shows how we map them all to the same value:
There was a problem hiding this comment.
@bew while there is a ctrl key on Mac, it's not supposed to be used for custom keyboard shortcuts. Cmd on Mac is the primary modifier key, and it's common that ctrl gets mapped to ctrl on Windows/Linux and cmd on Mac.
Describe your changes
Update docstrings and embedded examples.
Testing Plan
n/a docs only
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.