Skip to content

Settings menu updates#12648

Merged
mayagbarnes merged 7 commits into
developfrom
custom-theme-handling
Sep 29, 2025
Merged

Settings menu updates#12648
mayagbarnes merged 7 commits into
developfrom
custom-theme-handling

Conversation

@mayagbarnes
Copy link
Copy Markdown
Collaborator

@mayagbarnes mayagbarnes commented Sep 27, 2025

Describe your changes

Some changes to set the stage for allowing custom light & dark themes:

  • Fix SettingsCreatorDialog bug where you could revert to streamlit default themes (auto/light/dark) when a custom theme was set
  • Remove the ThemeCreatorDialog
  • Small update to cursor styling for selectboxes (the main input had not-allowed cursor but the dropdown arrow didn't)

Testing Plan

  • JS Unit Tests: ✅ Updated
  • E2E Tests: ✅ Added & Updated
  • Manual Testing: ✅

@mayagbarnes mayagbarnes added security-assessment-completed change:refactor PR contains code refactoring without behavior change impact:users PR changes affect end users labels Sep 27, 2025
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io Bot commented Sep 27, 2025

🎉 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)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 27, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12648/streamlit-1.50.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-12648.streamlit.app (☁️ Deploy here if not accessible)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 27, 2025

📉 Frontend coverage change detected

The frontend unit test (vitest) coverage has decreased by 0.0300%

  • Current PR: 84.8300% (47513 lines, 7203 missed)
  • Latest develop: 84.8600% (47657 lines, 7215 missed)

💡 Consider adding more unit tests to maintain or improve coverage.

📊 View detailed coverage comparison

@mayagbarnes mayagbarnes changed the title [WIP] Settings menu updates Settings menu updates Sep 29, 2025
@mayagbarnes mayagbarnes requested a review from Copilot September 29, 2025 19:35
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 removes the theme creator dialog functionality and implements a settings menu fix to prevent reverting to default Streamlit themes when a custom theme is active.

  • Removes the ThemeCreatorDialog component and all related functionality
  • Fixes SettingsDialog bug where users could revert to default themes when a custom theme was set by disabling the selectbox when custom themes are present
  • Improves cursor styling consistency for disabled selectboxes by applying not-allowed cursor to dropdown arrows

Reviewed Changes

Copilot reviewed 15 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/lib/src/theme/themeConfigs.ts Adds new customTheme export for testing purposes
frontend/lib/src/test_util.tsx Removes addThemes from test context mocks
frontend/lib/src/index.ts Exports the new customTheme configuration
frontend/lib/src/components/shared/Dropdown/Selectbox.tsx Adds conditional not-allowed cursor styling for disabled dropdown arrows
frontend/lib/src/components/core/LibContext.tsx Removes addThemes function from LibContext interface
frontend/app/src/components/StreamlitDialog/styled-components.ts Removes unused StyledBackButton component
frontend/app/src/components/StreamlitDialog/ThemeCreatorDialog.tsx Completely removes the theme creator dialog component
frontend/app/src/components/StreamlitDialog/ThemeCreatorDialog.test.tsx Removes all tests for the deleted theme creator dialog
frontend/app/src/components/StreamlitDialog/StreamlitDialog.tsx Removes theme creator dialog from main dialog router
frontend/app/src/components/StreamlitDialog/SettingsDialog.tsx Implements logic to disable theme selection when custom themes are active
frontend/app/src/components/StreamlitDialog/SettingsDialog.test.tsx Updates tests to cover new custom theme behavior
frontend/app/src/components/StreamlitContextProvider.tsx Removes addThemes from context provider
frontend/app/src/App.tsx Removes theme creator dialog opening functionality
e2e_playwright/theming/custom_theme_fonts_test.py Adds E2E test for custom theme settings dialog behavior
e2e_playwright/main_menu_test.py Removes E2E test for theme creator dialog

Comment thread frontend/app/src/components/StreamlitDialog/SettingsDialog.tsx Outdated
@mayagbarnes mayagbarnes marked this pull request as ready for review September 29, 2025 20:31
Copy link
Copy Markdown
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always great when we get to delete code 👍

Comment thread frontend/app/src/components/StreamlitDialog/SettingsDialog.tsx Outdated
Comment thread frontend/app/src/components/StreamlitDialog/SettingsDialog.tsx Outdated
@mayagbarnes mayagbarnes merged commit 7896f79 into develop Sep 29, 2025
39 checks passed
@mayagbarnes mayagbarnes deleted the custom-theme-handling branch September 29, 2025 23:58
sfc-gh-tteixeira pushed a commit that referenced this pull request Sep 30, 2025
Some changes to set the stage for allowing custom light & dark themes:
* Fix `SettingsCreatorDialog` bug where you could revert to streamlit default themes (auto/light/dark) when a custom theme was set
* Remove the `ThemeCreatorDialog`
* Small update to cursor styling for selectboxes (the main input had not-allowed cursor but the dropdown arrow didn't)
lukasmasuch added a commit that referenced this pull request Feb 5, 2026
The theme creator dialog UI was removed in PR #12648 but themeUtils.ts and
its associated exports (themeBuilder, toMinimalToml) were left as dead code.
Remove these unused files and the orphaned THEME_CREATOR enum value.
lukasmasuch added a commit that referenced this pull request Feb 9, 2026
The theme creator dialog UI was removed in PR #12648 but themeUtils.ts and
its associated exports (themeBuilder, toMinimalToml) were left as dead code.
Remove these unused files and the orphaned THEME_CREATOR enum value.
lukasmasuch added a commit that referenced this pull request Feb 9, 2026
## Describe your changes

Clean up deprecated and unused code from the theme system:

1. **Remove deprecated proto fields** from `CustomThemeConfig`:
   - `font` (replaced by `body_font`)
   - `widget_background_color` (no longer applied)
- `widget_border_color` (replaced by `border_color` +
`show_widget_border`)
   - `radii` (replaced by `base_radius`)
   - `font_sizes` (replaced by `base_font_size`)
   - `skeleton_background_color` (no longer applied)
   - `FontFace.weight` (replaced by `weight_range`)

2. **Remove unused theme creator code**:
- Delete `themeUtils.ts` and `themeUtils.test.ts` (dead code since
#12648)
   - Remove orphaned `THEME_CREATOR` enum value from `DialogType`

Reserved field numbers are added to maintain proto compatibility.

- Closes: #13831

## Testing Plan

- No new tests needed; this removes dead/deprecated code
- Updated existing tests to remove references to deprecated fields
- Frontend and backend changes are compatible with existing
functionality

---

**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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Streamlit Bot <core+streamlitbot-github@streamlit.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:refactor PR contains code refactoring without behavior change impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants