-
Notifications
You must be signed in to change notification settings - Fork 4k
[theming] Fine tune element spacing for baseRadius config
#10915
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
[theming] Fine tune element spacing for baseRadius config
#10915
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
✅ PR preview is ready!
|
a9e0606 to
ff2620a
Compare
baseRadius config
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.
Pull Request Overview
This PR fine tunes element spacing for the baseRadius configuration across various widgets and components. The changes update destructuring in TextInput and adjust padding and font size values in TextInput, NumberInput, ArrowTable, BaseWidget, and ChatInput to better reflect the new theming guidelines.
Reviewed Changes
Copilot reviewed 273 out of 273 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/lib/src/components/widgets/TextInput/TextInput.tsx | Updated destructuring to include icon and maxChars; updated references to use these variables. |
| frontend/lib/src/components/widgets/NumberInput/NumberInput.tsx | Adjusted left padding from theme.spacing.sm to theme.spacing.md. |
| frontend/lib/src/components/elements/ArrowTable/styled-components.ts | Added left padding for header cells. |
| frontend/lib/src/components/widgets/BaseWidget/styled-components.ts | Changed right positioning from a calculation based on theme.fontSizes.sm to theme.fontSizes.mdLg. |
| frontend/lib/src/components/widgets/ChatInput/ChatInput.tsx | Modified left padding from theme.spacing.none to theme.spacing.twoXS. |
Comments suppressed due to low confidence (4)
frontend/lib/src/components/widgets/BaseWidget/styled-components.ts:57
- Ensure that 'theme.fontSizes.mdLg' is a valid and intended property in your theme. If this is a new addition, please confirm that it aligns with the design specifications.
right: `calc(${theme.fontSizes.mdLg} * 0.5)`
frontend/lib/src/components/widgets/NumberInput/NumberInput.tsx:423
- [nitpick] Confirm that 'theme.spacing.md' provides the appropriate padding for NumberInput as compared to the previous value (theme.spacing.sm). Verify against design guidelines if this change might affect overall layout consistency.
paddingLeft: theme.spacing.md,
frontend/lib/src/components/elements/ArrowTable/styled-components.ts:80
- [nitpick] Ensure that adding left padding to header cells does not cause unintended alignment issues in the table layout. It may be worthwhile to review adjacent cell padding for consistent spacing.
paddingLeft: theme.spacing.sm,
frontend/lib/src/components/widgets/ChatInput/ChatInput.tsx:488
- [nitpick] Verify that 'theme.spacing.twoXS' offers the intended spacing for ChatInput. Compare this adjustment with similar components to ensure uniformity in spacing across the UI.
paddingLeft: theme.spacing.twoXS,
|
I think we need to go through all input field widgets and make sure they all have the same left padding and all the text values are starting at the same position: import streamlit as st
st.date_input("Date Input", label_visibility="collapsed")
st.text_input("Text Input", value="Test", label_visibility="collapsed")
st.number_input("Number Input", label_visibility="collapsed")
st.selectbox("Selectbox", options=["Test"], label_visibility="collapsed")
st.time_input("Time Input", label_visibility="collapsed")
st.text_area("Text Area", value="Test", label_visibility="collapsed")
st.container().chat_input("Chat Input")Also, I think the |
ff2620a to
6cf4284
Compare
|
Added screenshots of all input widgets under Manual Tests |
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.
I think the chat input padding is too much, the full left padding of chat input is at 1.25rem while other widgets only have a padding of 0.75rem. I think it's better to keep this at none and instead overwrite the radius properties in Root with:
borderTopLeftRadius: "0",
borderTopRightRadius: "0",
borderBottomLeftRadius: "0",
borderBottomRightRadius: "0",
since the additional radius isn't required.
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.
okay I see, yeah I think it is better to not add more padding if it's just for the cursor. But this fixed the issue with hidden cursor.
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.
I think changing the border radius to 0 of the inner text area root will also fix the hidden cursor issue
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.
Ah sorry, I just meant to confirm that your fix setting the border radius to 0 made it so that we don't need the additional padding (which was not ideal in the first place) 👍
|
The padding for text area seems to be a bit to large (1rem vs 0.75rem), I think we can just update this to And for Input instruction it still feels slightly to close, I think this small tweak on bottom in StyledWidgetInstructions could help: |
ac73a6f to
ddb5270
Compare
lukasmasuch
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 👍
Describe your changes
Now with the ability to configure border radius via
baseRadiustheming config, there are a few places that would have issues with padding when the radius is set to fully rounded.st.table--frontend/lib/src/components/elements/ArrowTable/styled-components.ts: Added a bit morepaddingLeftto the left-most column.Before:
st.number_input--frontend/lib/src/components/widgets/NumberInput/NumberInput.tsx: Added morepaddingLeftfor the input box.Before:
st.text_input--frontend/lib/src/components/widgets/TextInput/TextInput.tsx: Added morepaddingLeftfor the input box. Refactored to destructure additional props (icon,maxChars) fromelement.Before:
st.chat_input--frontend/lib/src/components/widgets/ChatInput/ChatInput.tsx: Previously the input cursor was masked (this happened when we updatedst.chat_inputto use fully rounded radius though) So added a littlepaddingLeftto fix that.Before:
input instructions --

frontend/lib/src/components/widgets/BaseWidget/styled-components.ts: Added more space torightproperty inStyledWidgetInstructionsto move instructions further left.Before:
Testing Plan
Manual Tests
Note: Value element in
st.time_inputhas a 2px left marginContribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.