-
Notifications
You must be signed in to change notification settings - Fork 4k
[Fix]: Button commands breakage with help
#10658
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helphelp
sfc-gh-bnisco
approved these changes
Mar 6, 2025
Collaborator
sfc-gh-bnisco
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.
Great PR description! Thank you for the fixes and the added tests, LGTM after CI passes 👍
sfc-gh-nbellante
approved these changes
Mar 6, 2025
sfc-gh-lwilby
pushed a commit
that referenced
this pull request
Mar 6, 2025
As part of refactor to remove passing explicit width prop down to each element (see PR #[10342](#10342)), some breakage occurred in button commands (`st.button`, `st.link_button`, `st.download_button`, `st.form_submit_button`, etc.) when using the `help` param. * `Tooltip.tsx`: we pass a prop, `containerWidth`, down to the tooltip wrapper div so that if `containerWidth` is true, its width is `"100%"`, otherwise set width to `"auto"`. Previously we always set the width to 100%. This prop is passed from button command > `BaseButtonTooltip` > `TooltipIcon` > `Tooltip`. We used to use a `fluidWidth` concept when `useContainerWidth` was true & using `help`, which required passing the container width down to the button to render properly. Since we are no longer passing width down, simplifying by renaming to `containerWidth` to control rendering width at `100%` or `auto`.
4 tasks
sfc-gh-lwilby
pushed a commit
that referenced
this pull request
Mar 7, 2025
As part of refactor to remove passing explicit width prop down to each element (see PR #[10342](#10342)), some breakage occurred in button commands (`st.button`, `st.link_button`, `st.download_button`, `st.form_submit_button`, etc.) when using the `help` param. * `Tooltip.tsx`: we pass a prop, `containerWidth`, down to the tooltip wrapper div so that if `containerWidth` is true, its width is `"100%"`, otherwise set width to `"auto"`. Previously we always set the width to 100%. This prop is passed from button command > `BaseButtonTooltip` > `TooltipIcon` > `Tooltip`. We used to use a `fluidWidth` concept when `useContainerWidth` was true & using `help`, which required passing the container width down to the button to render properly. Since we are no longer passing width down, simplifying by renaming to `containerWidth` to control rendering width at `100%` or `auto`.
This was referenced Mar 8, 2025
mayagbarnes
added a commit
that referenced
this pull request
Mar 11, 2025
…10690) Ensure `currentPageScriptHash` set in `App` & populated in `LibContext` for SPA - `currentPageScriptHash` blank for SPAs - so `st.page_link` renders every page as if its the current page: Fix styling for `st.page_link` when `help` & `use_container_width = "true"` - [#10640](#10658) addresses part of the issue with width for `st.page_link` but also need to handle width in `StyledNavLinkContainer` Add dedicated e2e/snapshot testing for `st.page_link` feature (currently only in MPA context) - currently have page link buttons in MPA tests, but to prevent issues in the future, adding SPA tests for `st.page_link` Add more JS unit tests for `st.page_link` params like `icon`, `help`, `use_container_width`, etc.
sfc-gh-mbarnes
pushed a commit
that referenced
this pull request
Mar 11, 2025
…10690) Ensure `currentPageScriptHash` set in `App` & populated in `LibContext` for SPA - `currentPageScriptHash` blank for SPAs - so `st.page_link` renders every page as if its the current page: Fix styling for `st.page_link` when `help` & `use_container_width = "true"` - [#10640](#10658) addresses part of the issue with width for `st.page_link` but also need to handle width in `StyledNavLinkContainer` Add dedicated e2e/snapshot testing for `st.page_link` feature (currently only in MPA context) - currently have page link buttons in MPA tests, but to prevent issues in the future, adding SPA tests for `st.page_link` Add more JS unit tests for `st.page_link` params like `icon`, `help`, `use_container_width`, etc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
change:bugfix
PR contains bug fix implementation
impact:users
PR changes affect end users
security-assessment-completed
Security assessment has been completed for PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes
As part of refactor to remove passing explicit width prop down to each element (see PR #10342), some breakage occurred in button commands (
st.button,st.link_button,st.download_button,st.form_submit_button, etc.) when using thehelpparam.Main changes:
Tooltip.tsx: we pass a prop,containerWidth, down to the tooltip wrapper div so that ifcontainerWidthis true, its width is"100%", otherwise set width to"auto". Previously we always set the width to 100%. This prop is passed from button command >BaseButtonTooltip>TooltipIcon>Tooltip.Note: We used to use a
fluidWidthconcept whenuseContainerWidthwas true & usinghelp, which required passing the container width down to the button to render properly. Since we are no longer passing width down, simplifying by renaming tocontainerWidthto control rendering width at100%orauto.Also....visual breakage in
st.page_linkoutside of thehelpparam result of MPAv1/v2 refactor (currentPageScriptHashnot being set in SPA) - will file separate issue for that.GitHub Issue Link (if applicable)
Closes #10648
Closes #10656
Testing Plan