Skip to content

Update settings toggles to use consistent design across app. - #30169

Merged
t3chguy merged 103 commits into
developfrom
hs/update-toggles-to-use-consistent-style
Dec 4, 2025
Merged

t3chguy merged 103 commits into
developfrom
hs/update-toggles-to-use-consistent-style

Conversation

@Half-Shot

@Half-Shot Half-Shot commented Jun 19, 2025 •

Copy link
Copy Markdown
Member

Needs element-hq/compound-web#358

This PR effectively changes all the various places we expose a ToggleSwitch (or a handful of places we used a checkbox) to use a standard SettingsToggle switch that always keeps the settings toggle to the left of the label, which provides the best accessibility. This also ensures that all toggles have their descriptions and disabled messages where possible.

This PR is absolutely enormous (sorry!!!!) due to the number of places require to change, so to break the changes down further the following things have been changed:

  • All areas of Element with a toggle switch, which do not have playwright tests, now have playwright tests.
  • Some playwright/jest tests have been adjusted to use the "switch" role, rather than "checkbox" or other less-ideal ways to identify a setting switch.
  • Some areas of Element, such as the legacy settings panel did not use our SettingsFlag component where they could trivially include it. This has been fixed.
  • LabelledToggleSwitch has been removed in favour of Compound's SettingsToggle
  • Due to Radix inputs (from Compouund) requiring components be wrapped in Forms, a careful dance of wrapping aspects of the settings components in forms has been performed.

I'd suggest reviewing by checking the code changes first, then jest, then playwright changes in that order which will make the most sense. While the PR is huge, the majority of the trivial changes are component swicheroos or screenshot tests.

Changes areas with screenshot test:

  • ApperanceTab
  • CreateRoomDialog
  • DeclineInviteDialog
  • DevToolsDialog
  • ReportRoomDialog
  • RoomUpgradeWarningDialog
  • WidgetCapabilitiesPromptDialog
  • WidgetOpenIDPermissionsDialog
    • Looks hard to actually prompt, maybe skip?
  • EnableLiveShare
  • General Room Tab
  • Notifications
  • NotificationSettings (new)
  • SecurityTab
  • RoomSecurityTab
  • VoipRoomSettingsTab
  • PreferencesTab
  • VoiceUserSettingsTab
  • SpaceSettingsVisibilityTab

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
…o hs/update-toggles-to-use-consistent-style

# Conflicts:
#	playwright/snapshots/settings/general-room-settings-tab.spec.ts/General-room-settings-tab-should-be-rendered-properly-1-linux.png
#	playwright/snapshots/settings/notifications/notifications-settings-2-tab.spec.ts/standard-notifications-2-settings-linux.png
#	playwright/snapshots/settings/room-settings/room-security-tab.spec.ts/room-security-settings-linux.png
#	playwright/snapshots/settings/room-settings/room-security-tab.spec.ts/room-security-settings-world-readable-linux.png
#	playwright/snapshots/settings/room-settings/room-video-tab.spec.ts/room-video-settings-linux.png
#	playwright/snapshots/settings/security-user-settings-tab.spec.ts/security-settings-tab-linux.png
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy

t3chguy commented Dec 4, 2025 •

Copy link
Copy Markdown
Member

Suggesting this skips sonar given most of the untested code is the mostly-unused onSubmit prevent default on the Compound Form Roots which in many cases is not reachable but still worthwhile going forward in case more traditional form elements are used at any point later, and needed to satisfy the type and there are a lot of end to end tests covering these changes.

@t3chguy
t3chguy marked this pull request as ready for review December 4, 2025 13:25
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

This branch was successfully deployed

2 active deployments
EndToEndTests — 540a3335 Deployed Dec 4, 2025 by github-actions[bot]
Netlify — 540a3335 Deployed Dec 4, 2025 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Enhancement Z-Skip-Coverage Skip SonarQube coverage for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants