Repository navigation
feat(html5): add static bbb-* CSS classes to key components for theming - #26193
ramonlsouza merged 1 commit into
Conversation
Styled-components class names change on every build, so themes, plugins and custom.css had to target data-test attributes, ids and DOM structure (:has(), nth-child, span[color]). Key elements now carry stable classes named bbb-block, bbb-block__element and bbb-block--state. State modifiers come only from props and state the components already had: no new queries, subscriptions or hooks. The avatar, for instance, gets bbb-avatar--moderator, --presenter, --you and --talking from the props UserAvatar already receives. Covered: navigation sidebar, sidebar content and panel header, chat (form and messages), user list, avatar, common Button, actions bar (mute and camera toggles), nav bar (title, recording, connection status, leave, talking indicator), presentation and its toolbar, webcam tiles, timer indicator and notifications bar. data-test attributes are untouched.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughMeeting UI components across controls, navigation, chat, presentation, participant lists, and video now receive CSS classes. Several components also receive conditional modifier classes based on states such as muted, offline, recording, or collapsed. The changes do not alter rendering conditions or child components except where class names depend on existing state. Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
|
Once it's merged, we can update the automated tests to take advantage of it and remove the |
✅ Automated tests have passed! |
I rely on data-test attributes for various css overrides (mostly hiding element X or Y) on deployments. Maybe I misunderstood but do you really intend on removing the data-test from the source OR remove its reliance inside of some playwright tests? |
Indeed, a lot of people might be relying on My comment was more of a long-term idea. Ideally, once we have proper CSS classes for these elements, people can start using them instead of For automated tests, we could stop relying on Then, once we're confident people have had enough time to migrate, we can finally remove them. Maybe in BBB 4.2? lol |
Documents the part of the 4.0.1 delta that landed on v4.0.x-develop after the first sync (#26290) audited cd89568: cd89568..410727c, the PRs that go to v4.0.x-release with #26309, plus #25775. new-features.md - Other notable changes: "Static CSS classes for custom styles" for the bbb-* classes from #26193. - bbb-web properties changes / Added: tag the maxPresentationsPerRequest, insertDocument* and presentationConversion* entries from #25786 with "added in BBB 4.0.1", and link the insertDocument entry to its customize.md section. - bbb-apps-akka settings changes: the same tag on the two #25786 entries. development/api.md, "Updated in 4.0", each item "(added in 4.0.1)" - create: the maxPresentationsPerRequest cap and documentsDropped (#25786), and the recordingmarks and meetingID parameters on the meetingEndedURL callback (#26243; 4.0.0 called the URL unchanged). - insertDocument (new item): the same cap, the per-meeting rate limit (rateLimitExceeded), and the messageKey every FAILED response now carries (notFound, invalidFilename, presentationDisabled, noDocuments are new; the messages are unchanged). administration/customize.md - "Static CSS classes for client elements" after the custom-style section: the naming scheme, what the classes cover, an example, and public.app.customStyleUrl for loading a stylesheet for every user. Not documented: the fixes (#26215; #26289, which brought its own docs; #26278, since SVG was already refused on every upload path), the dependency bumps (#26296 and the dependabot PRs) and the CI changes (#26190, #26295, #26297, #26307, and #25775, which documents itself in .github/ci-tested-plugins.md). settings.yml, ApiParams.java, LockSettingsParams.java, create.tsx and join.tsx are unchanged in the range, and resources.xml only gains entries, so there is no upgrade warning to add.
…ement The classes landed in 4.0.1 (bigbluebutton/bigbluebutton#26193), so this is now main. The README asks for 4.0.1 or later and points 4.0.0 servers to the bbb-4.0.0 branch, which keeps the data-test selectors; the parts about the presenter badge and the selectors describe the classes. Version 0.4.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dk5p3LePeVSvoN8vYvza8y
Follow-up to #26193. Adds classes to elements that themes still had to reach through data-test attributes, ids or the DOM structure: - bbb-avatar__talking: the avatar layer the client animates while the user talks - bbb-chat-message__bubble, bbb-chat-message__notice, and bbb-chat-message__time on the time shown on hover in the bubble's corner (follow-up messages and system notices) - bbb-chat__list, bbb-chat-form__textarea, bbb-chat-form__send, bbb-chat-reply-intention - bbb-user-list-item__toolbar, bbb-crowd-actions (__item, __label) - bbb-webcam__name-wrapper, bbb-webcam__pin-area Classes only; no markup, styles, data-test attributes or ids change.
What does this PR do?
Adds static, prefixed CSS classes to key elements of the HTML5 client, so themes, plugins and
custom.csscan target them without relying ondata-testattributes or on the DOM structure.Naming follows a BEM-like scheme with a
bbb-prefix, to avoid collisions with plugin and custom styles:bbb-blockfor a component (bbb-avatar,bbb-navigation)bbb-block__elementfor a part of it (bbb-navigation__item,bbb-chat-message__time)bbb-block--statefor a state (bbb-avatar--presenter,bbb-mute-toggle--muted)State classes are derived only from props and state each component already had. No queries, subscriptions or hooks were added, and no component re-renders more than before.
data-testattributes and ids are untouched.Classes added
user-avatar)bbb-avatar,--moderator,--presenter,--you,--talkingbbb-navigation(--collapsedon mobile),__bar,__list,__separator,__logobbb-navigation__item,--active,--notification,--disabled,--lockedbbb-sidebar-content,bbb-sidebar-content--{panel}(chat,userlist,poll,generic-content-sidekick...),bbb-sidebar-content__panelcontrol-header)bbb-panel-header,bbb-panel-header__titlebbb-chat(message area),bbb-chat-form,bbb-chat-form__inputbbb-chat-message,--own,--system,__name,__timebbb-user-list,bbb-user-list__search,bbb-user-list-item,bbb-user-list-item__namecommon/button)bbb-button,bbb-button--{color},bbb-button--circle,bbb-button__icon(the colored span of circle buttons)bbb-actions-bar,__left,__center,__right,__media-buttonsbbb-mute-toggle,--muted;bbb-video-toggle,--offbbb-navbar,__left,__center,__right,__bottom,__titlebbb-recording-indicator(--recording),bbb-connection-status-button(--normal,--warning,--danger,--critical,--offline),bbb-leave-button,bbb-options-buttonbbb-talking-indicator,bbb-talking-indicator__item,--talking,--muted,--moderator,--youbbb-presentation,bbb-presentation__content,bbb-presentation-toolbar,__slide-controls,__zoom-controlsbbb-webcam,--talking,bbb-webcam__name(with and without the user menu),bbb-webcam__presenter-badgebbb-timer-indicator(--running),bbb-notifications-barCloses Issue(s)
Closes #
Motivation
styled-components generates new class names on every build, so anyone customizing the client today has to write selectors such as:
These break whenever markup or test ids change, and
data-testwas never meant to be a styling API. Some states can't be reached at all. For example, the presenter's avatar carries no marker, so a theme plugin has to subscribe to the users list and inject a stylesheet keyed by user id to draw a presenter badge. With this PR, the same rules become:A real use case: bbb-plugin-flat-theme
This PR came out of bbb-plugin-flat-theme, a theme plugin for the 4.0 client. It ships pure CSS as a plugin: full-height flat sidebars, round avatars with a moderator crown and a presenter badge, Lucide icons in the icon bar and actions bar, and red mic/camera icons when they are off. Its
mainbranch works on today's client, so it is built on the selectors shown above. Some of its features exist only as workarounds, for example:<style>with[data-id="<userId>"]selectors for the current presenter.div[role="button"][aria-expanded="true"].colorattribute styled-components leaves on a<span>.data-test, so the one without a menu stayed unstyled.The
bbb-static-classesbranch of the plugin is already ported to the classes in this PR and is just waiting for it to be merged. It has been tested against a client built from this branch:data-testselectors go from 108 to 20 (the rest are menu items and inner buttons not covered here), and all:has()andnth-childworkarounds on the layout are gone..bbb-user-list-item > .bbb-avatar--presenter::after..bbb-navigation__item--active,.bbb-mute-toggle--muted), so it is much cleaner, and it no longer breaks when markup or test ids change.As soon as this PR is merged, that branch becomes the plugin's
main.Static classes can also help e2e tests: selectors for these elements and their states could move from
data-testvariants (webcamItem/webcamItemTalkingUser,muteMicButton/unmuteMicButton) to a single class plus a state modifier. This PR doesn't change any test.How to test
bbb-avatar bbb-avatar--moderator bbb-avatar--presenter bbb-avatar--you; making another user presenter moves--presenter.bbb-navigation__item--activeon its button andbbb-sidebar-content--{panel}on the sidebar.bbb-mute-toggle--muted; enabling the camera removesbbb-video-toggle--off.bbb-chat-message--own, and system messages have--system.bbb-recording-indicator--recording.Quick check from the console:
More
className, built withclassnameswhere there is a state.common/control-headernow accepts and mergesclassName, so styled wrappers keep working.BBBModal, from@bigbluebutton/bbb-ui-components-react) and the MUI dropdown menus, which already expose stableMuiMenu-*/MuiMenuItem-*classes. The modal would need the classes in that library.tsc --noEmitpasses.customStyleUrl)