Skip to content

Remove SettingsDialog#14048

Merged
mayagbarnes merged 9 commits intofeature/new-app-menufrom
remove-settings
Feb 24, 2026
Merged

Remove SettingsDialog#14048
mayagbarnes merged 9 commits intofeature/new-app-menufrom
remove-settings

Conversation

@mayagbarnes
Copy link
Copy Markdown
Collaborator

@mayagbarnes mayagbarnes commented Feb 20, 2026

Describe your changes

  • Removes the Settings menu item from the main menu and deletes the SettingsDialog component entirely. All Settings dialog functionality has been absorbed by the new main menu:
    • Theme switching → theme radio buttons (System / Light / Dark) in the menu
    • Auto-rerun (Run on save) → toggle in the menu
    • Version footer → footer in the menu
    • Wide mode → removed from UI (set via st.set_page_config(layout="wide"))
  • Migrates 5 theming E2E test files from the Settings dialog selectbox flow to the main menu's menuitemradio buttons, using accessible selectors (get_by_role("menuitemradio", name="Dark")).
  • Deletes test_renders_settings_dialog_properly and test_settings_dialog_copies_version from main_menu_test.py (coverage is now provided by the menu footer tests).
  • Removes SETTINGS from the DialogType enum and all associated plumbing (settingsCallback in App.tsx, Props, buildDevItems, StreamlitDialog switch case).
  • Cleans up orphaned styled components (StyledDialogBody, StyledFullRow, StyledCheckbox, StyledLabel, StyledVersionRow, StyledVersionText, StyledHr, StyledButtonContainer) and updates stale @see SettingsDialog JSDoc references in ThemeContext.tsx and types.ts.

Testing Plan

  • JS Unit Tests: ✅ Updated
  • E2E Tests: ✅ Updated

@mayagbarnes mayagbarnes added security-assessment-completed change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Feb 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 20, 2026

✅ PR preview is ready!

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

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Feb 20, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 20, 2026

📉 Significant bundle size change detected

Metric This Branch develop Change (%)
Total (gzip) 8.06 MiB 8.07 MiB -0.07%
Entry (gzip) 664.62 KiB 723.9 KiB -8.19%

Please verify that this change is expected.

📊 View detailed bundle comparison

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 20, 2026

📈 Frontend coverage change detected

The frontend unit test (vitest) coverage has increased by 0.1700%

  • Current PR: 87.5700% (14244 lines, 1770 missed)
  • Latest develop: 87.4000% (14191 lines, 1787 missed)

🎉 Great job on improving test coverage!

📊 View detailed coverage comparison

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 standalone Settings dialog and integrates its functionality directly into the main menu. The Settings menu item has been deleted, and all settings controls (theme selection via radio buttons, auto-rerun toggle, and version footer with copy button) are now accessed directly from the main menu without opening a separate modal dialog.

Changes:

  • Frontend: Completely removed SettingsDialog component, related test file, styled components, dialog type enum entry, and all callbacks/plumbing (settingsCallback in App.tsx, MainMenu.tsx)
  • E2E Tests: Migrated 5 theming test files from Settings dialog selectbox flow to main menu menuitemradio buttons using accessible selectors, deleted 2 obsolete Settings dialog tests from main_menu_test.py
  • Documentation: Updated JSDoc references from @see SettingsDialog to @see MainMenu in ThemeContext.tsx and updated comment in types.ts

Reviewed changes

Copilot reviewed 18 out of 49 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/lib/src/theme/types.ts Updated JSDoc comment to reference main menu theme selector instead of SettingsDialog
frontend/lib/src/components/core/ThemeContext.tsx Updated JSDoc @see references from SettingsDialog to MainMenu
frontend/app/src/components/StreamlitDialog/styled-components.ts Removed 9 styled components that were only used by SettingsDialog
frontend/app/src/components/StreamlitDialog/constants.ts Removed SETTINGS from DialogType enum
frontend/app/src/components/StreamlitDialog/StreamlitDialog.tsx Removed SettingsDialog import, SettingsProps interface, and SETTINGS case from switch
frontend/app/src/components/StreamlitDialog/SettingsDialog.tsx Deleted entire SettingsDialog component (223 lines)
frontend/app/src/components/StreamlitDialog/SettingsDialog.test.tsx Deleted entire test file (341 lines)
frontend/app/src/components/MainMenu/MainMenu.tsx Removed settingsCallback prop and Settings menu item from buildDevItems
frontend/app/src/components/MainMenu/MainMenu.test.tsx Updated all tests to reflect removal of Settings item (test expectations, focus navigation, etc.)
frontend/app/src/App.tsx Removed settingsCallback method and prop
frontend/app/src/App.test.tsx Updated menu label expectations to exclude Settings
e2e_playwright/theming/*.py (5 files) Migrated theme switching tests from Settings dialog selectbox to main menu menuitemradio
e2e_playwright/main_menu_test.py Deleted 2 Settings dialog tests, added version footer test with data-copy-state assertion
e2e_playwright/hostframe_app_test.py Updated test to open Clear cache modal instead of Settings
e2e_playwright/__snapshots__/**/*.png Deleted 12 Settings dialog snapshots, updated 6 main menu snapshots

@mayagbarnes mayagbarnes added the ai-review If applied to PR or issue will run AI review workflow label Feb 23, 2026
@github-actions github-actions bot removed the ai-review If applied to PR or issue will run AI review workflow label Feb 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Summary

This PR removes the SettingsDialog component entirely from the Streamlit frontend, completing the migration of its functionality into the new main menu (introduced in prior PRs on the feature/new-app-menu branch):

  • Theme switching moved to menuitemradio buttons in the main menu.
  • Auto-rerun (Run on save) moved to a toggle in the main menu.
  • Version footer moved to the menu footer.
  • Wide mode removed from UI (only configurable via st.set_page_config(layout="wide")).

The PR deletes SettingsDialog.tsx, SettingsDialog.test.tsx, the SETTINGS enum value from DialogType, the settingsCallback from App.tsx, and all associated styled components. It also updates 5 E2E theming test files to use the main menu's menuitemradio flow instead of the Settings dialog, and updates JSDoc references from SettingsDialog to MainMenu.

Code Quality

The code changes are clean and well-organized:

  • Complete removal: All references to SettingsDialog, DialogType.SETTINGS, and settingsCallback have been thoroughly removed. A codebase-wide search confirms zero remaining references in TypeScript/TSX files.
  • Styled components cleanup: All 8 orphaned styled components (StyledDialogBody, StyledFullRow, StyledCheckbox, StyledLabel, StyledVersionRow, StyledVersionText, StyledHr, StyledButtonContainer) are properly removed from styled-components.ts, leaving only StyledDeployErrorContent and StyledErrorText which are still in use.
  • JSDoc updates: ThemeContext.tsx and types.ts correctly update @see references from SettingsDialog to MainMenu.
  • Minor stale reference: lib/streamlit/config.py line 591 still mentions "settings dialog" in the client.toolbarMode description. This is a pre-existing documentation string, not introduced by this PR, but worth noting for a follow-up.

Test Coverage

Test coverage is thorough and properly updated:

Frontend Unit Tests (MainMenu.test.tsx):

  • All tests referencing stMainMenuItem-settings have been updated to use stMainMenuItem-rerun or other appropriate items.
  • Menu item count assertions are updated (e.g., from 5 to 4 action items in dev mode).
  • Focus navigation tests correctly account for the removed Settings item (e.g., keyboard navigation counts adjusted).
  • The deleted SettingsDialog.test.tsx covered rendering, checkbox state, theme selector, and version display — all of which are now tested via the MainMenu tests and the main menu's version footer E2E tests added in prior PRs.

App.test.tsx:

  • Host menu item tests properly remove "Settings" from expected menu label arrays.

E2E Tests:

  • 5 theming test files migrated from Settings dialog flow (open menu → click Settings → open combobox → select theme → close dialog) to the simpler main menu flow (open menu → click menuitemradio → press Escape).
  • The new E2E pattern uses accessible selectors (get_by_role("menuitemradio", name="Dark")) which is an improvement over the previous get_by_text("Settings") → combobox approach. This aligns well with the E2E AGENTS.md guidance to prefer label/role-based locators.
  • hostframe_app_test.py correctly switches from opening Settings to opening Clear cache for testing the host close-modal message flow.
  • main_menu_test.py removes test_renders_settings_dialog_properly and test_settings_dialog_copies_version (covered by existing menu footer tests).
  • The keyboard navigation test test_keyboard_activates_menu_item correctly updates from 3 ArrowDowns (past theme radios to Settings) to 5 ArrowDowns (past theme radios + Rerun + Auto-rerun to Clear cache).

Backwards Compatibility

  • No user-facing API changes: The SettingsDialog was purely internal UI. Users never interacted with it programmatically.
  • Wide mode: Removing the Wide mode checkbox from the UI is an intentional UX decision. Users can still set wide mode via st.set_page_config(layout="wide"). This is a behavioral change for users who relied on the checkbox, but it's consistent with the direction of the new menu design. Since this is on a feature branch (feature/new-app-menu), it will be released as part of the larger feature.
  • Theme switching UX: Moving from a combobox in a dialog to radio buttons in the menu is a UX improvement — fewer clicks needed to switch themes.
  • DialogType enum change: Removing SETTINGS from the enum is safe since it's internal frontend code not exposed to any external API or protobuf.

Security & Risk

No security concerns identified. The changes are purely UI refactoring:

  • No new network calls or data handling.
  • No changes to authentication, authorization, or data flow.
  • The UserSettings type and saveSettings mechanism in App.tsx remain intact for wide mode and run-on-save functionality.

Low regression risk: the functionality isn't lost, it's migrated to the main menu (implemented in prior PRs on this feature branch).

Accessibility

The migration is a net positive for accessibility:

  • Before: Theme switching required navigating through a dialog with a combobox (role="combobox").
  • After: Theme switching uses role="menuitemradio" with aria-checked, which is the correct WAI-ARIA pattern for mutually exclusive choices within a menu.
  • E2E tests now use get_by_role("menuitemradio", name="...") selectors, validating that the accessible roles are properly implemented.
  • The hostframe_app_test.py change to use "Clear cache" instead of "Settings" still properly tests the modal close flow.

Recommendations

  1. Minor doc follow-up: Consider updating lib/streamlit/config.py line 591 to remove the "settings dialog" reference in the client.toolbarMode description, since the settings dialog no longer exists. This could be done in a separate cleanup PR.
  2. Snapshot updates: Several snapshot files are updated/deleted as part of this PR. The CI pipeline should verify the new snapshots match expectations. The snapshot deletions for settings_dialog* and custom_*_settings_dialog* are expected and correct.

Verdict

APPROVED: Clean, thorough removal of the SettingsDialog with all references properly updated. Tests are comprehensive, the migration to the new main menu is complete, and accessibility is improved.


This is an automated AI review by opus-4.6-thinking.

@mayagbarnes mayagbarnes marked this pull request as ready for review February 23, 2026 07:02
Copy link
Copy Markdown
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@mayagbarnes mayagbarnes merged commit 5f264de into feature/new-app-menu Feb 24, 2026
39 checks passed
@mayagbarnes mayagbarnes deleted the remove-settings branch February 24, 2026 06:04
sfc-gh-mbarnes pushed a commit that referenced this pull request Feb 24, 2026
- Removes the **Settings** menu item from the main menu and deletes the `SettingsDialog` component entirely. All Settings dialog functionality has been absorbed by the new main menu:
  - **Theme switching** → theme radio buttons (System / Light / Dark) in the menu
  - **Auto-rerun (Run on save)** → toggle in the menu
  - **Version footer** → footer in the menu
  - **Wide mode** → removed from UI (set via `st.set_page_config(layout="wide")`)
- Migrates **5 theming E2E test files** from the Settings dialog selectbox flow to the main menu's `menuitemradio` buttons, using accessible selectors (`get_by_role("menuitemradio", name="Dark")`).
- Deletes `test_renders_settings_dialog_properly` and `test_settings_dialog_copies_version` from `main_menu_test.py` (coverage is now provided by the menu footer tests).
- Removes `SETTINGS` from the `DialogType` enum and all associated plumbing (`settingsCallback` in `App.tsx`, `Props`, `buildDevItems`, `StreamlitDialog` switch case).
- Cleans up orphaned styled components and updates stale `@see SettingsDialog` JSDoc references in `ThemeContext.tsx` and `types.ts`.
mayagbarnes added a commit that referenced this pull request Feb 24, 2026
This PR is the culmination of the following PRs approved into this feature branch:
- [Core `MainMenu` Refactor](#13833)
- [`MainMenu` accessibility improvements](#13878)
- [Add theme switcher to `MainMenu`](#13937)
- [Add auto-rerun toggle to `MainMenu`](#13988)
- [Add version footer to `MainMenu`](#14028)
- [Remove `SettingsDialog`](#14048)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants