Skip to content

fix: client crash due to incorrect toggle usage in notification settings - #24154

Merged
antobinary merged 1 commit into
bigbluebutton:v3.1.x-releasefrom
prlanzarin:u31/fix/crash-notification-settings-toggle
Nov 5, 2025
Merged

antobinary merged 1 commit into
bigbluebutton:v3.1.x-releasefrom
prlanzarin:u31/fix/crash-notification-settings-toggle

Conversation

@prlanzarin

Copy link
Copy Markdown
Member

What does this PR do?

  • fix: client crash due to incorrect toggle usage in notification settings
    • Client is crashing when opening the notification settins panel in a
      LiveKit-enabled meeting. This is caused by a 3.0 -> 3.1 merge
      introducing the new "mute" notification option from 3.0 without
      porting the toggle usage to 3.1's variant.
    • Fix the client crash by adjusting the mute notification setting to use
      3.1's components. Additionally, remove the now unused FormElementCenter
      style from the settings submenus.

Closes Issue(s)

Closes #24128

Client is crashing when opening the notification settins panel in a
LiveKit-enabled meeting. This is caused by a 3.0 -> 3.1 merge
introducing the new "mute" notification option from 3.0 without
porting the toggle usage to 3.1's variant.

Fix the client crash by adjusting the mute notification setting to use
3.1's components. Additionally, remove the now unused FormElementCenter
style from the settings submenus.
@prlanzarin prlanzarin added this to the Release 3.1 milestone Oct 29, 2025
@github-actions

Copy link
Copy Markdown

Automated tests Summary

⏳ Tests are running...

@coderabbitai

coderabbitai Bot commented Oct 29, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request removes the unused FormElementCenter styled component from the settings submenus styles modules (application, notification, and root styles files). In the notification component, it replaces the Toggle component with SubMenusStyle.MaterialSwitch for alert controls, updates layout wrappers from FormElementCenter to FormElementRight, and migrates accessibility labels from the ariaLabel prop to inputProps with aria-label on the Material Switch. The onChange handlers and user-facing behavior remain unchanged; these are structural and styling updates to the notification settings component.

Sequence Diagram

sequenceDiagram
    participant User
    participant NotificationUI as Notification Component
    participant MaterialSwitch
    participant State as Component State

    User->>NotificationUI: Toggle audio alert
    NotificationUI->>MaterialSwitch: checked={isMutedAudio}
    activate MaterialSwitch
    MaterialSwitch->>User: Render controlled switch
    deactivate MaterialSwitch
    
    User->>MaterialSwitch: Click switch
    MaterialSwitch->>NotificationUI: onChange triggered
    NotificationUI->>State: Update isMutedAudio state
    State->>NotificationUI: State updated
    NotificationUI->>MaterialSwitch: checked={newValue}
    MaterialSwitch->>User: Display updated state
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • File heterogeneity: Changes span 4 files but follow consistent patterns (removal of FormElementCenter and component replacement in notification component)
  • Key areas for attention:
    • Verify that MaterialSwitch is properly imported and available in the notification component
    • Confirm that the inputProps and aria-label structure correctly replaces the previous ariaLabel prop for accessibility compliance
    • Ensure FormElementRight provides the correct alignment replacement for the removed FormElementCenter wrapper
    • Validate that no other components depend on the removed FormElementCenter styled component from the style modules

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "fix: client crash due to incorrect toggle usage in notification settings" is specific, concise, and clearly captures the primary objective of the changeset. The title accurately reflects the main change: fixing a client crash in the notification settings panel by replacing incorrect Toggle usage with the correct MaterialSwitch component appropriate for 3.1. The title is neither vague nor misleading, and it directly relates to the central issue being addressed.
Linked Issues Check ✅ Passed The code changes directly address the core requirement of issue #24128, which reports a "Toggle is not defined" crash when accessing notification settings. The PR replaces the incorrect local Toggle component with SubMenusStyle.MaterialSwitch in the notification component, which resolves the ReferenceError. The accessibility labeling has been properly updated to use inputProps with aria-label, and onChange handlers are maintained to preserve user-facing behavior. The fix appears complete and targeted at the specific crash symptom described in the linked issue.
Out of Scope Changes Check ✅ Passed All changes in this PR remain within the stated objectives. The primary changes involve replacing Toggle with MaterialSwitch and updating layout wrappers from FormElementCenter to FormElementRight, which are necessary to fix the notification settings crash. The removal of FormElementCenter style definitions from three style files (application, notification, and main submenus) is explicitly mentioned in the PR description as cleanup of the now-unused FormElementCenter component, making this a direct consequence of the primary fix rather than an out-of-scope change. No extraneous modifications appear to be present.
Description Check ✅ Passed The pull request description is clearly related to the changeset and provides meaningful context. It explains the root cause (a 3.0 → 3.1 merge that incorrectly used a 3.0 component without adapting to 3.1), describes the fix (adjusting the mute notification setting to use 3.1's components), mentions the cleanup of unused FormElementCenter styles, and references the closed issue. The description directly corresponds to the code changes present in the PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57fadf6 and 4b3ff9b.

📒 Files selected for processing (4)
  • bigbluebutton-html5/imports/ui/components/settings/submenus/application/styles.js (0 hunks)
  • bigbluebutton-html5/imports/ui/components/settings/submenus/notification/component.jsx (1 hunks)
  • bigbluebutton-html5/imports/ui/components/settings/submenus/notification/styles.js (0 hunks)
  • bigbluebutton-html5/imports/ui/components/settings/submenus/styles.js (0 hunks)
💤 Files with no reviewable changes (3)
  • bigbluebutton-html5/imports/ui/components/settings/submenus/notification/styles.js
  • bigbluebutton-html5/imports/ui/components/settings/submenus/application/styles.js
  • bigbluebutton-html5/imports/ui/components/settings/submenus/styles.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-package (bbb-html5)
🔇 Additional comments (2)
bigbluebutton-html5/imports/ui/components/settings/submenus/notification/component.jsx (2)

202-211: LGTM! Crash fix correctly applied.

The mute/unmute audio alert now uses the correct 3.1 components (SubMenusStyle.MaterialSwitch and FormElementRight) and follows the exact pattern established by other notification rows in this file. The accessibility label is properly constructed with context.


214-224: LGTM! Disabled switch correctly migrated.

The disabled push alert switch correctly uses SubMenusStyle.MaterialSwitch and FormElementRight, matching the 3.1 component structure. The accessibility label appropriately excludes status information since the switch is disabled.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@Arthurk12
Arthurk12 self-requested a review November 3, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants