New styling for remaining dropdowns (select all 5)#13798
New styling for remaining dropdowns (select all 5)#13798sfc-gh-dmatthews merged 18 commits intodevelopfrom
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!
|
184d114 to
7e95b28
Compare
4ea2766 to
7b3dcb4
Compare
7e95b28 to
df804a1
Compare
7b3dcb4 to
a7296ae
Compare
a7296ae to
a7d6c2e
Compare
df804a1 to
4a10e1c
Compare
4a10e1c to
5852cb8
Compare
7f125f5 to
e1f9edf
Compare
5852cb8 to
c228524
Compare
e1f9edf to
76d39f9
Compare
c228524 to
29551f0
Compare
fc22122 to
3520051
Compare
6276ac9 to
fa2e109
Compare
3520051 to
f266b5b
Compare
SummaryThis PR unifies dropdown/popover styling across multiple components to achieve a consistent visual design language. The key changes are:
The PR touches 9 source files and updates 54 screenshot snapshots across chromium, firefox, and webkit. Code QualityThe code is well-structured and follows existing patterns. Comments explain the rationale for each styling choice (e.g., "No border in light mode, visible border in dark mode"). A few observations:
borderWidth: lightBackground
? theme.spacing.none
: theme.sizes.borderWidth,
paddingRight: `calc(${theme.spacing.twoXL} - ${theme.sizes.borderWidth})`, // 1px to account for border.
paddingLeft: `calc(${theme.spacing.twoXL} - ${theme.sizes.borderWidth})`,
paddingBottom: `calc(${theme.spacing.twoXL} - ${theme.sizes.borderWidth})`,
paddingTop: `calc(${theme.spacing.twoXL} - ${theme.sizes.borderWidth})`,In dark mode: total = 1px border + (1.5rem - 1px) padding = 1.5rem. Correct.
Test Coverage
Backwards CompatibilityNo breaking changes. All changes are internal styling adjustments:
Security & Risk
Accessibility
Recommendations
VerdictAPPROVED: This is a well-executed visual styling unification PR. The changes consistently apply a light/dark mode border/shadow pattern across 5+ dropdown components, are backed by comprehensive snapshot tests across 3 browsers, and carry no behavioral or backwards-compatibility risk. The 1px Popover padding discrepancy (recommendation #1) is a minor nit that could be addressed in a follow-up. This is an automated AI review using |
frontend/lib/src/components/widgets/DataFrame/menus/ColumnVisibilityMenu.tsx
Outdated
Show resolved
Hide resolved
Merge activity
|
There was a problem hiding this comment.
Pull request overview
This PR unifies dropdown and popover styling across multiple Streamlit components to achieve a consistent, modern visual design. The changes implement the design patterns established for top navigation dropdowns (issue #12956) and apply them to all dropdown menus, data frame menus, color pickers, and popovers throughout the application.
Changes:
- Introduced
getPopoverContainerStyleutility function for consistent light/dark mode border and shadow behavior across all popovers - Updated border radius from
theme.radii.defaulttotheme.radii.md2(0.375rem) for dropdown item highlights - Adjusted spacing (padding/margins) across menu components for tighter, more consistent spacing
- Added
popoverMarginprop toPopover,BaseColorPicker, andTopNavSectionfor consistent gap between trigger and content - Implemented CSS custom property pattern for dynamic scrollbar gutter handling in
ColumnVisibilityMenu - Simplified background colors from
secondaryBgtobgColorin dark mode for consistency
Reviewed changes
Copilot reviewed 12 out of 69 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/lib/src/index.ts | Exports new getPopoverContainerStyle utility |
| frontend/lib/src/components/shared/Base/styled-components.ts | Not changed in diff, but contains the getPopoverContainerStyle implementation |
| frontend/lib/src/components/widgets/DataFrame/styled-components.ts | Applies getPopoverContainerStyle to search bar, removes hardcoded border radius |
| frontend/lib/src/components/widgets/DataFrame/menus/styled-components.ts | Updates padding/margins, adds md2 radius, implements scrollbar gutter handling via CSS custom property |
| frontend/lib/src/components/widgets/DataFrame/menus/FormattingMenu.tsx | Applies getPopoverContainerStyle, simplifies background color logic |
| frontend/lib/src/components/widgets/DataFrame/menus/ColumnVisibilityMenu.tsx | Adds scrollbar gutter hook, applies styling updates, implements CSS custom property for dynamic scrollbar handling |
| frontend/lib/src/components/widgets/DataFrame/menus/ColumnMenu.tsx | Applies getPopoverContainerStyle, removes redundant styling code |
| frontend/lib/src/components/shared/BaseColorPicker/BaseColorPicker.tsx | Adds popoverMargin prop, applies getPopoverContainerStyle to Body override |
| frontend/lib/src/components/elements/Popover/Popover.tsx | Adds popoverMargin prop, applies getPopoverContainerStyle with radius override for xl corners |
| frontend/app/src/components/Navigation/styled-components.ts | Updates border radius to md2, adjusts margins to match dropdown pattern |
| frontend/app/src/components/Navigation/TopNavSection.tsx | Adds popoverMargin, applies getPopoverContainerStyle, removes redundant styling |
| e2e_playwright/st_dialog.py | Adds width="content" to dataframe for consistent test behavior |
| e2e_playwright/st_dialog_test.py | Changes column menu index from 1 to 2 to account for styling changes affecting positioning |
| e2e_playwright/snapshots/linux/* | Updates screenshots to reflect new visual styling |
|
@sfc-gh-bnisco I force pushed to get rid of the incorrect merge. This is supposed to be 17 commits from (st.popover a0c6d22 to Update snapshots b20b7ed). Somehow when Graphite failed in the middle, a couple of the commits from the previous branch are showing up here and not properly rebased out. I tried to restack/rebase it, but it kept saying, "we believe [this] is 93 commits long" and it wasn't working like expected trying to point it to a different starting point. There are a handleful of merge conflicts that popped up from something new in develop while the stack was merging. I've cherry-picked the 17 commits into a clean branch with the correct resolution from the current state of develop: safekeeping branch So, I can abandon this and make a clean PR if I've made this too much of a mess. Either way, I have the data on safely on that other branch. |

Describe your changes
This PR unifies dropdown/popover styling across multiple components to achieve a consistent visual design language. The key changes are:
boxShadowpopover effect is shown instead. In dark mode, a visible border is used with no shadow.theme.radii.defaultortheme.radii.mdtotheme.radii.md2for inner elements, creating more consistent rounding.popoverMargin: Added toPopover,BaseColorPicker, andTopNavSectionfor consistent gap between trigger and popover.ColumnVisibilityMenunow uses a CSS custom property (--scrollbar-gutter-size) to adjust divider padding when a scrollbar is present.secondaryBgtobgColorfor consistency.Screenshot or video (only for visual changes)
GitHub Issue Link (if applicable)
Closes #12956
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.