-
Notifications
You must be signed in to change notification settings - Fork 4k
Convert a lot more components to functional style, and other cleanups #9494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… FormClearHelper.
raethlein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great that more and more widgets are modernized, thank you 🚀
I love the slider update and am totally fine to do it in one PR; the only ask I have is to add some form of testing (see my comment). Since adding some tests can be a little bit more time involved, maybe we can have it as a separate PR and find someone from the team to add them if you are busy right now 🙂 What do you think?
Other than that I have just left a few nits and feel free to merge after you had a look!
Co-authored-by: Benjamin Räthlein <[email protected]>
Co-authored-by: Benjamin Räthlein <[email protected]>
Co-authored-by: Benjamin Räthlein <[email protected]>
|
I added screenshot tests for the slider overlap algorithm. I still need to update the screenshots, but I'm waiting for the automation to do it for me. |
eb0979f to
a5ea04c
Compare
a5ea04c to
5b4a4c8
Compare
## Describe your changes In #9494 a dynamic way was added to calculate the slider labels. It looks like the added snapshot tests are flaky (on Firefox). It looks like the pixel values can have a few decimal values which seems to shift the label slightly. ## GitHub Issue Link (if applicable) ## Testing Plan - Fix flaky tests, so change is covered by them. --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
…streamlit#9494) ## Describe your changes - Convert many components to functional - Components that were straight applications of `useBasicWidgetState`: - `st.time_input` - `st.date_input` - `st.color_picker` - `st.selectbox` - Components that require an extra "commit" step to save values to the state: - `st.text_input` - `st.text_area` - Components that have a "commit" step and other complexities: - `st.slider` / `st.select_slider` - Rename `setValueWSource` to `setValueWithSource` - Move some usage of `FormClearHelper` to `useFormClearHelper`: `st.number_input`, `st.dataframe`, `st.button_group` - Clean up `st.number_input` a little - Change `st.slider` algorithm ## GitHub Issue Link (if applicable) ## Testing Plan - ~~Explanation of why no additional tests are needed~~ - [x] Unit Tests (JS and/or Python) - [x] E2E Tests - Any manual testing needed? - Yes! Would love tests of: - All widgets above + session state - All widgets above + developer changes some parameters in the source code --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
## Describe your changes In streamlit#9494 a dynamic way was added to calculate the slider labels. It looks like the added snapshot tests are flaky (on Firefox). It looks like the pixel values can have a few decimal values which seems to shift the label slightly. ## GitHub Issue Link (if applicable) ## Testing Plan - Fix flaky tests, so change is covered by them. --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Describe your changes
useBasicWidgetState:st.time_inputst.date_inputst.color_pickerst.selectboxst.text_inputst.text_areast.slider/st.select_slidersetValueWSourcetosetValueWithSourceFormClearHelpertouseFormClearHelper:st.number_input,st.dataframe,st.button_groupst.number_inputa littlest.slideralgorithmGitHub Issue Link (if applicable)
Testing Plan
Explanation of why no additional tests are neededContribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.