Repository navigation
feat(layout/observer): Add user preference for dark theme in LayoutObserver component. - #21255
Conversation
…bserver` component.
WalkthroughThe changes introduce functionality in the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- bigbluebutton-html5/imports/ui/components/layout/observer.tsx (1 hunks)
🔇 Additional comments not posted (1)
bigbluebutton-html5/imports/ui/components/layout/observer.tsx (1)
Line range hint
1-283: Overall implementation looks good with minor clarification needed.The changes to implement the dark theme preference are well-integrated into the existing
LayoutObservercomponent. The implementation follows the general structure and practices of the codebase.However, as mentioned in the previous comment, there's a slight discrepancy between the PR objectives and the actual implementation regarding the parameter name. Once this is clarified or addressed, the implementation appears to be ready for merging.
ramonlsouza
left a comment
There was a problem hiding this comment.
dark mode remains enabled after a refresh if bbb_prefer_dark_theme=true and the user selects dark mode = off in the settings modal
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (8)
docs/docs/development/api.md (4)
115-115: Approved: New parameter for dark theme preference added.The addition of
userdata-bbb_prefer_dark_themeto thejoinendpoint is correctly documented and aligns with the PR objectives. This change enhances user experience by allowing frontends to specify dark mode preferences.Consider adding a brief explanation of the parameter's functionality, e.g., "Allows frontends to specify if a user prefers to join the session in dark mode."
Line range hint
1055-1055: Approved: Join endpoint parameters updated.The
joinendpoint documentation has been correctly updated with new parameters, includinguserdata-bbb_prefer_dark_theme. The removal of deprecated parameters and replacement of others indicate a positive evolution of the API.For clarity, consider adding a brief note explaining why
defaultLayoutwas removed and replaced byuserdata-bbb_default_layout. This would help developers understand the transition between API versions.
Line range hint
1784-1827: Excellent addition: Supported Document Types section.The new "Supported Document Types" section is a valuable addition to the documentation. It provides a clear and comprehensive list of supported file formats, which is crucial information for developers integrating with BigBlueButton.
To further enhance this section, consider adding links to the mentioned backend and frontend lists for developers who might need more detailed information. For example:
For more detailed information, see the [backend list](https://github.com/bigbluebutton/bigbluebutton/blob/v2.7.10/bbb-common-web/src/main/java/org/bigbluebutton/presentation/MimeTypeUtils.java#L28-L47) and [frontend list](https://github.com/bigbluebutton/bigbluebutton/blob/v2.7.10/bigbluebutton-html5/private/config/settings.yml#L824-L862).
Line range hint
1-1827: Comprehensive and valuable API documentation update.This update to the API documentation is thorough and aligns well with the PR objectives. Key improvements include:
- Addition of the
userdata-bbb_prefer_dark_themeparameter to support dark mode preferences.- Updated
joinendpoint documentation reflecting new and replaced parameters.- New "Supported Document Types" section providing clear information on file format support.
These changes significantly enhance the documentation's value for developers integrating with BigBlueButton.
To further improve the documentation:
- Consider adding a "Changes Log" section at the beginning of the document to highlight recent updates. This would help returning developers quickly identify new features or changes.
- Ensure that all new parameters and features are consistently documented across relevant sections of the API documentation.
docs/docs/administration/customize.md (4)
1455-1455: Consider adding more details about the dark theme featureWhile the new parameter is correctly documented, it might be helpful to provide more context about the dark theme feature. For example, you could mention when it was introduced, any limitations, or how it interacts with other theme-related settings.
1455-1455: Enhance the gladia.io configuration sectionThe new section on configuring gladia.io is a valuable addition. However, consider the following improvements:
- Add a brief explanation of what gladia.io is and its benefits for BigBlueButton users.
- Clarify if there are any costs associated with using gladia.io, especially after the free trial.
- Mention any performance implications or requirements for using this feature.
- Consider adding a troubleshooting subsection for common issues users might encounter.
These additions would make the documentation more comprehensive and user-friendly.
1455-1455: Enhance the meeting configuration tableThe table of meeting configuration parameters is a useful addition. Consider the following improvements:
- Add a brief introduction explaining where and how these configurations can be applied.
- For boolean options, consistently use "true/false" instead of mixing with "Integer (0=disable)" for clarity.
- Consider grouping related parameters (e.g., all timeout-related settings) for better organization.
- Add links to relevant sections of the documentation for parameters that might need more detailed explanation.
- Include information about which BigBlueButton version introduced each parameter, if applicable.
These changes would make the table more user-friendly and informative.
Line range hint
1-1455: Consider overall document structure and navigation improvementsThe document has been significantly expanded with valuable information. To improve its usability, consider the following suggestions:
- Add a table of contents at the beginning of the document for easier navigation.
- Use consistent heading levels throughout the document for better structure.
- Consider breaking this large document into smaller, more focused pages if it becomes too long.
- Add cross-references between related sections to help users find relevant information.
- Include a "What's New" or "Recently Added" section to highlight recent changes or additions to the customization options.
These improvements would make the document more navigable and user-friendly, especially as it continues to grow with new customization options.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- docs/docs/administration/customize.md (1 hunks)
- docs/docs/development/api.md (1 hunks)
🔇 Additional comments (1)
docs/docs/administration/customize.md (1)
1455-1455: New parameter added for dark theme preferenceThe addition of the
userdata-bbb_prefer_dark_themeparameter is a good enhancement for user customization. It allows setting the dark theme as the default option.
… move it to Settings class.
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
bigbluebutton-html5/imports/ui/services/settings/index.js (2)
36-39: LGTM: Correct implementation of dark theme preference.The implementation correctly retrieves the user's dark theme preference, falling back to the default setting if not specified. This aligns well with the PR objectives.
Consider adding a brief comment explaining the purpose of this code block for improved readability:
+// Retrieve user's dark theme preference, falling back to default if not specified const showDarkThemeDefault = getFromUserSettings( 'bbb_prefer_dark_theme', window.meetingClientSettings.public.app.defaultSettings.application.darkTheme, );
Line range hint
6-41: Overall: Well-implemented feature for user dark theme preference.The changes successfully implement the user preference for dark theme as requested. The code is clean, concise, and integrates well with the existing
Settingsclass. Great job!To complete this feature:
Update the documentation as suggested in the PR comments:
- Add a line to the customization documentation at
https://github.com/bigbluebutton/bigbluebutton/blob/v3.0.x-release/docs/docs/administration/customize.md?plain=1#L1455- Mention the new parameter in the API documentation at
https://github.com/bigbluebutton/bigbluebutton/blob/v3.0.x-release/docs/docs/development/api.md?plain=1#L115Consider adding unit tests to verify the behavior of the new dark theme preference setting.
Ensure that the
LayoutObservercomponent (mentioned in the PR title but not present in this file) correctly uses this new setting.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- bigbluebutton-html5/imports/ui/services/settings/index.js (2 hunks)
🔇 Additional comments (2)
bigbluebutton-html5/imports/ui/services/settings/index.js (2)
6-6: LGTM: New import for user settings.The new import for
getFromUserSettingsis correctly placed and aligns with the PR objectives to implement user preferences for the dark theme.
41-41: LGTM: Correct assignment of dark theme preference.The dark theme preference is correctly assigned to the writable default values.
To ensure this change doesn't introduce any unintended side effects, please verify that:
- The dark theme is correctly applied when the user preference is set.
- The system default is used when no user preference is specified.
- The user can still override this setting within the application.
You can test this by:
- Creating a session with
userdata-bbb_prefer_dark_theme=true- Creating a session without specifying the parameter
- Changing the theme within the application after joining with each of the above scenarios
Automated tests Summary✅ All the CI tests have passed! |



What does this PR do?
This PR implements a feature request to add a new parameter,
userdata-bbb_prefer_dark_theme=true, which allows frontends to specify whether a user prefers to join a BigBlueButton (BBB) session in dark mode or normal mode.Closes Issue(s)
Closes #21228 and #21260 (partial)
Motivation
This was requested during the Community Call on September 17.
How to test
Create a session with the following custom parameter:
userdata-bbb_prefer_dark_theme=true