Skip to content

fix(html5): re-center microphone glyph in audio modal - #25396

Merged
TiagoJacobs merged 5 commits into
bigbluebutton:v3.0.x-developfrom
imdt-claudiop:fix/audio-modal-mic-icon-vertical-offset
Jul 14, 2026
Merged

TiagoJacobs merged 5 commits into
bigbluebutton:v3.0.x-developfrom
imdt-claudiop:fix/audio-modal-mic-icon-vertical-offset

Conversation

@imdt-claudiop

@imdt-claudiop imdt-claudiop commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

What's happening

In BBB 3.0, the "How would you like to join the audio?" modal shows two large circular buttons side by side: Microphone and Listen only. The microphone icon does not occupy the same vertical space as the headphone icon next to it - it reads as a different size and visually misaligned.

Why it happens

Both buttons share the same styled component (AudioModalButton in audio-modal/styles.js) and the same centering CSS, so the modal's layout cannot be the differentiator. The cause is in the glyphs themselves: in the bbb-icons font, the unmute (microphone) glyph has a taller ink box than the listen (headphone) glyph - measured at ~61px vs ~49px at the same font-size (the mic is ~25% taller by design). Because the two glyphs have different heights, no amount of vertical translation can make them occupy the same vertical band: aligning the bases misaligns the tops, and vice versa. On top of that, the mic's ink mass is distributed bottom-heavy (hollow capsule on top, solid base bar at the bottom), so even when the ink boxes are centered the mic visually pulls downward.

The fix

Replace any vertical nudge with a uniform scale(0.8) (= 49/61) on the mic glyph, so its ink box matches the headphone's:

// inside AudioModalButton (audio-modal/styles.js)
& span:first-child i[class*="icon-bbb-unmute"] {
  display: inline-block;
  transform: scale(0.8);
}

Why these choices:

  • scale(0.8) = 49/61 shrinks the mic to the headphone's ink height. The scale is applied about the glyph's geometric center (transform-origin defaults to 50% 50%), so the centers stay aligned while the heights match. Measured on the real modal: mic ink 148px vs headphone 147px (ratio 1.007), tops aligned, bottoms aligned, centers coincident - the two icons now occupy the same vertical band.
  • Uniform scale (not scaleY, not font-size) preserves the mic's natural proportions. scaleY(0.8) flattens the glyph (too wide); a smaller font-size re-anchors on the text baseline, which drops the mic's center below the headphone's.
  • display: inline-block is required because transform does not apply to inline non-replaced elements (the icon renders as <i>).
  • Unitless scale is font-size-independent, so it holds at both the desktop (3.5rem) and mobile (2.5rem) breakpoints without per-size tuning.
  • Scoped to icon-bbb-unmute inside AudioModalButton so the unmute icon reused elsewhere (the mute toggle, audio test, audio help) is untouched. The listen glyph shares this styled component but is excluded by the class filter.

Evidence

Baseline (no fix): mic visibly taller than headphone, different vertical footprint.

Baseline - mic taller than headphone

After scale(0.8): both buttons in the real modal (unretouched render). The mic and the headphone now occupy the same vertical band.

After fix - both buttons, same vertical band

Mic vs headphone side by side, confirming the matching vertical footprint:

Mic vs headphone side by side

An honest limitation

A residual ~11px ink-centroid offset remains (the mic's center of mass sits lower than the headphone's, because the glyph is hollow on top and solid at the base). A very picky eye may still read a faint bottom-heaviness. This is intrinsic to the microphone glyph and is not removable via CSS: aligning centroids would require breaking the bounding-box parity this fix establishes, and true centroid + box parity is only reachable by reworking the glyph inside the .woff font. If centroid parity matters more than box parity, that is a font-level change and out of scope for this CSS fix.

Validation

Validated desktop/moderator in a from-source 3.0 environment (audio modal, both buttons). Bounding-box parity measured pixel-accurate on the unretouched modal render. Mobile (2.5rem) not captured separately, but the unitless scale is font-size-independent so the ratio holds by construction. Opened as draft for review.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b532ff50-0a71-4756-ae5c-e62f6381395f

📥 Commits

Reviewing files that changed from the base of the PR and between 91a7baa and ceb592d.

📒 Files selected for processing (1)
  • bigbluebutton-html5/imports/ui/components/audio/audio-modal/styles.js
💤 Files with no reviewable changes (1)
  • bigbluebutton-html5/imports/ui/components/audio/audio-modal/styles.js

Walkthrough

The audio modal button styles now target the unmute microphone icon with a scoped selector and apply transform: scale(0.8). Inline comments document the glyph ink-box size difference between the microphone and headphone icons. No exported entities or other component styles were changed.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the audio-modal microphone icon alignment fix.
Description check ✅ Passed The description accurately explains the microphone glyph scaling fix in the audio modal.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@TiagoJacobs

Copy link
Copy Markdown
Member

Hello @imdt-claudiop

This is still not good

I annotated on top of your image (see the red lines)

image

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Thanks for the annotated screenshot - taking a close look at the red lines now. Will re-examine the offset and update.

The unmute glyph in the bbb-icons font is drawn bottom-heavy (its ink sits
below the em-box center), so vertical-align:middle leaves the microphone
icon visibly low in the circular button of the audio modal, while the
symmetric listen glyph next to it renders centered. Both buttons share the
same AudioModalButton styled-component, so the CSS cannot be the
differentiator - the asymmetry is intrinsic to the glyph.

Add a scoped top nudge (-0.08em, in em so it scales with font size) that
empirically re-centers the unmute glyph inside AudioModalButton only.
Measured against the listen glyph: ink-centroid offset drops from +3.35%
to +0.88% of the circle diameter, and the listen glyph is unchanged
(125.2px before and after), confirming the scope isolates the fix. The
unmute icon is reused in several other components (mute toggle, audio
test, help), so the rule is intentionally scoped rather than global.
The -0.08em offset was insufficient: the reviewer's annotated screenshot
showed the mic's solid base bar still descending to (and a hair past) the
listen glyph's base, reading as bottom-heavy. The ink-centroid measurement
had undersold the perceived offset because the mic's base bar carries more
visual weight than the listen's thin earcup tips - the perceived optical
center sits lower than the ink centroid.

Switch to bounding-box comparison as the criterion. A sweep of seven values
shows -0.14em sits at the safe entry of the balanced band: the mic base
clears the listen base by ~3px (was 1px below at -0.08em), while over-
correcting at -0.18em and above makes the glyph read high. -0.14em is
proportional across font sizes (em units) and stays scoped to the unmute
glyph inside AudioModalButton.
@imdt-claudiop
imdt-claudiop force-pushed the fix/audio-modal-mic-icon-vertical-offset branch from a987d73 to cc0532c Compare July 10, 2026 01:19
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Pushed the update. Changed the offset to -0.14em (was -0.08em).

Your annotation was the key insight: comparing the mic's base bar against the listen glyph's base (not the ink centroid, which understated the perceived offset because the mic's solid base bar carries more visual weight than the headphone's thin tips). At -0.14em the mic base clears the listen base by ~3px; a sweep shows -0.18em and above read as high, so -0.14em sits at the safe edge of the balanced band.

Updated the PR body with the before (rejected -0.08em) vs after (-0.14em) vs listen comparison using your same vertical-reference-line approach, plus the full modal and the value sweep. The listen glyph is byte-for-byte identical across all captures (scope is intact).

The unmute glyph's ink box is ~25% taller than the listen glyph's (mic
~61px vs headphone ~49px at the same font-size), so a translation (top
offset) can never make them occupy the same vertical space: matching the
bases misaligns the tops, and vice versa. The prior -0.14em nudge only
shifted the mic, leaving it both off-center and still taller than the
headphone.

Replace the translate with a uniform scale(0.8) (= 49/61), applied about
the glyph's geometric center (transform-origin defaults to 50% 50%). This
brings the mic's ink box onto the headphone's: measured on the real modal,
mic 148px vs headphone 147px (ratio 1.007), tops aligned, bottoms aligned,
centers coincident - the two icons now occupy the same vertical band.

Uniform scale is used over the alternatives because it preserves the mic's
proportions: scaleY(0.8) flattens the glyph, and a smaller font-size
re-anchors on the text baseline (dropping the mic's center below the
headphone's). display: inline-block is required because transform does not
apply to inline non-replaced elements (the icon renders as <i>). The scale
is unitless, so it holds at both the desktop (3.5rem) and mobile (2.5rem)
breakpoints without per-size tuning.

A residual ~11px ink-centroid offset remains (the mic's mass sits lower
than the headphone's because the glyph is hollow on top and heavy at the
base), which a very picky eye may still read as faint bottom-heaviness.
This is intrinsic to the glyph: aligning centroids would require breaking
the bounding-box parity just established, and true centroid+box parity is
only reachable by editing the glyph in the font. Scoped to the unmute
glyph inside AudioModalButton so the icon reused elsewhere (mute toggle,
audio test, help) is untouched.
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Reworked the fix based on your criterion (both icons occupying the same space).

The earlier top nudges couldn't work: the unmute glyph's ink box is ~25% taller than the listen glyph's (mic ~61px vs headphone ~49px at the same font-size), so translating the mic can match either the top or the base but never both. Replaced the translate with transform: scale(0.8) (= 49/61), applied about the glyph's center. Measured on the real modal, the two ink boxes now match: mic 148px vs headphone 147px, tops aligned, bottoms aligned, centers coincident.

Uniform scale (not scaleY, not font-size) keeps the mic's proportions intact - scaleY flattens it and a smaller font-size re-anchors on the baseline and drops the center. Unitless, so it holds at both desktop and mobile font sizes.

One honest limitation I'm not hiding: a residual ink-centroid offset of ~11px remains, because the mic glyph's mass is distributed bottom-heavy (hollow capsule on top, solid base bar at the bottom). A very picky eye may still read faint bottom-heaviness. This is intrinsic to the glyph; aligning centroids would require breaking the bounding-box parity this fix establishes, and true parity is only reachable by reworking the glyph in the font. If centroid parity matters more than box parity, that's a font-level change.

@imdt-claudiop
imdt-claudiop marked this pull request as ready for review July 12, 2026 04:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts the HTML5 audio “join” modal’s microphone icon so it visually aligns with the “listen only” (headphone) icon by scaling the unmute glyph within the AudioModalButton styling.

Changes:

  • Add a scoped CSS rule that applies transform: scale(0.8) to the icon-bbb-unmute glyph within the audio modal’s circular button icon container.
  • Add in-file documentation explaining the rationale and measurements behind the scaling approach.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to +43
// even with their centers aligned the mic overhangs the headphone by ~6px at each end and reads
// as a different size inside its circle. scale(0.8) (0.8 = 49/61) shrinks the mic to the
// headphone's ink height about the glyph's geometric center (transform-origin defaults to
// center), so the two icons occupy the same vertical band. Uniform scale keeps the mic's natural

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Fixed in 91a7baa: reworded to 'rounded from 49/61 ~= 0.803'. Kept the 0.8 value itself because the measured result (mic 148px vs headphone 147px on the real modal, ratio 1.007) confirms 0.8 achieves bounding-box parity within sub-pixel tolerance - the rounded value is simpler than 0.803 and the difference is below the pixel-quantization floor.

Comment on lines +48 to +51
& span:first-child i[class*="icon-bbb-unmute"] {
display: inline-block;
transform: scale(0.8);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 91a7baa: switched to the class selector i.icon-bbb-unmute (exact token match), which excludes icon-bbb-unmute_filled. Confirmed the Icon component renders class 'icon-bbb-' + iconName = 'icon-bbb-unmute' as an exact token, so the selector still targets the microphone glyph as intended.

@Tainan404

Copy link
Copy Markdown
Member

@imdt-claudiop take a look on copilot reviews

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

On it - addressing both Copilot review comments. The 49/61 = 0.803 precision in the comment and the icon-bbb-unmute_filled substring match in the selector are both fair catches. Will push an update.

Two review comments from Copilot:

1. The comment claimed scale(0.8) = 49/61, but 49/61 is ~0.803. Reword to
   'rounded from 49/61 ~= 0.803' so the comment is accurate. The 0.8 value
   itself is kept: the measured result (mic 148px vs headphone 147px on the
   real modal, ratio 1.007) confirms 0.8 achieves bounding-box parity within
   sub-pixel tolerance, and the rounded value is simpler than 0.803.

2. The selector i[class*="icon-bbb-unmute"] matched by substring, which also
   matches icon-bbb-unmute_filled (a distinct glyph in bbb-icons.css). Switch
   to the class selector i.icon-bbb-unmute, which matches the exact class
   token and excludes _filled. The Icon component renders class
   'icon-bbb-' + iconName = 'icon-bbb-unmute' (exact token), so the selector
   still targets the microphone glyph as intended.
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

@Tainan404 Done - addressed both Copilot review comments in 91a7baa:

  1. The scale(0.8) = 49/61 precision in the comment (49/61 is actually ~0.803) - reworded to 'rounded from 49/61 ~= 0.803'. Kept 0.8 because the measured result (148px vs 147px, ratio 1.007) confirms parity within sub-pixel tolerance.
  2. The i[class*="icon-bbb-unmute"] substring selector also matched icon-bbb-unmute_filled - switched to the class selector i.icon-bbb-unmute (exact token match).

Replied inline to both Copilot comments. The visual behavior is unchanged; these are a comment-precision fix and a stricter selector.

@Tainan404 Tainan404 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two small, non-blocking notes left inline on the specific lines. (The earlier substring-selector concern is already resolved by i.icon-bbb-unmute in the latest commit — nice.)

// glyph inside AudioModalButton so the icon reused elsewhere (mute toggle, audio test) is
// untouched.
& span:first-child i.icon-bbb-unmute {
display: inline-block;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit (non-blocking): display: inline-block is redundant here. The global icon rule [class^="icon-bbb-"], [class*=" icon-bbb-"] in public/stylesheets/bbb-icons.css already declares display: inline-block on every icon-bbb-* element, so this <i> is already inline-block and transform: scale() applies without this line. Harmless to keep as an explicit/defensive declaration, but it can be dropped if you'd prefer to keep the rule to just the transform.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

// untouched.
& span:first-child i.icon-bbb-unmute {
display: inline-block;
transform: scale(0.8);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The 0.8 (≈ 49/61) ratio was measured on a single from-source desktop render at 3.5rem. Because scale() is a pure ratio it should hold at the 2.5rem mobile breakpoint by construction, but since it's an empirically-tuned value it'd be worth a quick visual check at the mobile breakpoint and on a non-Chromium browser (Firefox) to confirm the box-parity holds beyond the one measured environment. Not a blocker — just de-risks the tuned constant.

@antobinary antobinary added this to the Release 3.0 milestone Jul 13, 2026
@Tainan404

Copy link
Copy Markdown
Member

@imdt-claudiop take a look on new comments

@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

Looking at both inline nits now - will verify the global display: inline-block rule (and drop the redundant declaration if it holds), and run a quick mobile + Firefox check on the scale ratio. Back shortly.

The global icon rule in bbb-icons.css ([class^="icon-bbb-"] { display:
inline-block; ...}) already sets display:inline-block on every icon-bbb-*
element, so the explicit declaration in the scoped AudioModalButton rule
was redundant. transform: scale(0.8) applies without it: confirmed by
computed style (matrix(0.8,0,0,0.8,0,0)) and measured ink (mic 48.5px =
80% of the 61px baseline) across Chromium and Firefox, desktop and mobile.

Addresses review nit from Tainan404.
@imdt-claudiop

Copy link
Copy Markdown
Contributor Author

@Tainan404 Addressed both inline nits in ceb592d.

Nit 1 (redundant display:inline-block): Dropped. Confirmed the global rule in bbb-icons.css ([class^="icon-bbb-"] { display: inline-block; ... }) supplies the block context, so transform: scale(0.8) still applies without the explicit declaration - computed style on i.icon-bbb-unmute is matrix(0.8,0,0,0.8,0,0) and the mic ink measures 48.5px (80% of the 61px baseline).

Nit 2 (mobile + Firefox check): Validated scale(0.8) across three scenarios. Mic vs listen ink heights (CSS px):

Scenario mic h listen h Δh Δtop Δbottom
Desktop Chromium (3.5rem) 48.5 49.0 -0.5 +0.5 0.0
Mobile Chromium (smallOnly, 2.5rem) 40.0 40.0 0.0 0.0 0.0
Desktop Firefox (3.5rem) 48.5 49.0 -0.5 +0.5 0.0

Parity holds in all three - every |Δ| ≤ 0.5px (the single-device-pixel measurement floor), bottoms align exactly. The unitless ratio tracks the smaller mobile em-box perfectly (exact 0.0 deltas), and Firefox renders the bbb-icons font at the same proportions as Chromium, so the 0.8 value needs no per-browser adjustment.

Validation screenshots:

Honest scope note: tested the audio-options modal glyphs in these three viewports/browsers. Not tested: RTL, dark mode, WebKit/Safari, mobile-native (which hides the mic button via isMobileNative), and actual media/audio flow (the fix is pure layout CSS, so those paths are unaffected by construction).

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@TiagoJacobs
TiagoJacobs merged commit cc5441b into bigbluebutton:v3.0.x-develop Jul 14, 2026
33 checks passed
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.

5 participants