VOOZH about

URL: https://phabricator.services.mozilla.com/D296488

⇱ ⚙ D296488 Bug 2034940 - Fix contrast on "Let's go" button disabled state in AI window firstrun. r=#ai-frontend-reviewers


Bug 2034940 - Fix contrast on "Let's go" button disabled state in AI window firstrun. r=#ai-frontend-reviewers
Needs RevisionPublic

Authored by czhou on Apr 25 2026, 2:04 AM.
Referenced Files
Unknown Object (File)
Mon, Jun 15, 6:20 PM
Unknown Object (File)
Mon, Jun 15, 12:13 PM
Unknown Object (File)
Thu, Jun 4, 3:40 AM
Unknown Object (File)
Thu, Jun 4, 3:32 AM
Unknown Object (File)
Thu, Jun 4, 1:38 AM
Unknown Object (File)
Wed, Jun 3, 11:55 PM
Unknown Object (File)
Wed, Jun 3, 11:35 PM
Unknown Object (File)
Wed, Jun 3, 8:12 PM

Details

Reviewers
Gijs
dao
Bugzilla Bug ID
2034940
Summary

The "Let's go" button on the AI window firstrun screen failed WCAG 2.2 1.4.3 Contrast (Minimum): its white text had a contrast ratio of only 2.06:1 against the gradient background due to CSS opacity: 0.5 being applied to the entire element.

This change raises the opacity to 0.75 (via a local --button-disabled-opacity variable) and explicitly sets the text color to --color-white, bringing the contrast within the minimum requirement. The cursor is also updated to not-allowed to communicate the unavailable state without suppressing pointer events.

renamed all local custom variables in this file are renamed to --aiwindow-firstrun-* prefix to avoid collisions with design system tokens, and forced-colors handling for the back button (label color and icon visibility) is moved into the existing @media (forced-colors) block so all HCM overrides live in one place.

Test Plan

Diff Detail

Repository
rFIREFOXAUTOLAND firefox-autoland
Branch
HEAD

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
Comment Actions

Code analysis found 1 defect in diff 1258318:

  • 1 defect found by stylelint (Mozlint)
IMPORTANT: Found 1 defect (error level) that must be fixed before landing.

You can run this analysis locally with:


If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 1258318.

Gijs requested changes to this revision.Apr 28 2026, 3:45 PM
Gijs added a subscriber: Gijs.
Comment Actions

Looks like this has stylelint complaints. Looks like elsewhere we use which might work here too?

This revision now requires changes to proceed.Apr 28 2026, 3:45 PM
czhou requested review of this revision.Apr 30 2026, 4:12 AM
czhou updated this revision to Diff 1262552.
Comment Actions

Looks like this has stylelint complaints. Looks like elsewhere we use which might work here too?

Thanks for your suggestion, @Gijs! I agree that meets the 3:1 contrast requirement, but I am concerned that because the 0.75 we use right now is already closer to the enabled state, using 0.8 might further remove the "disabled" affordance for users.
would prefer to keep it at 0.75 and add a comment to silence the design-token lint. Please let me know what do you think :)

Comment Actions

Thanks for the update and pushing back here. I guess this points to the question of why we're using custom styles for these buttons rather than something that relies entirely on existing design system bits. It's probably desirable from a UX/product pov, but unfortunate because threading the needle between reusing and custom values here ends up making this less maintainable: if the colours in the design system change, we may either fail WCAG again, or lose the disabled affordance anyway. That shouldn't stop us making the change but we'll probably need to be mindful of the nova updates.

This revision is now accepted and ready to land.Apr 30 2026, 10:30 AM
dao requested changes to this revision.Apr 30 2026, 10:34 AM
dao added a subscriber: dao.
dao added inline comments.
browser/components/aiwindow/ui/content/firstrun.css
19

This seems wrong for forced colors? Can you put this in a media block that excludes forced-color?

This revision now requires changes to proceed.Apr 30 2026, 10:34 AM
browser/components/aiwindow/ui/content/firstrun.css
19

Or I guess add in the forced-colors block.

I thought you were overriding the design system token here (which already handles forced-colors), but that's named , so this is rather confusing. :/ Wdyt about using a custom prefix and otherwise sticking to the design system naming scheme?

Comment Actions

Going back to https://bugzilla.mozilla.org/show_bug.cgi?id=2034940#c0, I feel like I still don't fully understand the intent here.

the button's white text has low contrast (2.06:1) with its background, due to CSS opacity:0.5. Although disabled buttons are exempt from minimum contrast, this button is not, in its current implementation, disabled.

What does "this button is not, in its current implementation, disabled" mean? In what sense is this button not disabled? Why does it match , and why are you using the term "disabled" in the variable name?

Comment Actions

Thanks for the update and pushing back here. I guess this points to the question of why we're using custom styles for these buttons rather than something that relies entirely on existing design system bits. It's probably desirable from a UX/product pov, but unfortunate because threading the needle between reusing and custom values here ends up making this less maintainable: if the colours in the design system change, we may either fail WCAG again, or lose the disabled affordance anyway. That shouldn't stop us making the change but we'll probably need to be mindful of the nova updates.

@Gijs Totally agree, the custom gradient is what forces this hand-tuned balance. Good news: Nova already overrides to 0.7, and Nova switches this button to a solid color with the 0.7 opacity, so once we migrate this button to Nova styles we can drop the custom 0.75 entirely and just use the standard token. I've also added a note in the comment pointing to var(--button-opacity-disabled) as the replacement once Nova lands here. Thank you for the guidance!

Comment Actions

Going back to https://bugzilla.mozilla.org/show_bug.cgi?id=2034940#c0, I feel like I still don't fully understand the intent here.

the button's white text has low contrast (2.06:1) with its background, due to CSS opacity:0.5. Although disabled buttons are exempt from minimum contrast, this button is not, in its current implementation, disabled.

What does "this button is not, in its current implementation, disabled" mean? In what sense is this button not disabled? Why does it match , and why are you using the term "disabled" in the

Thank you so much for reaching out, @dao! The comment saying was initially made when reporting an issue about the let's go button being focusable with a keyboard even when disabled. That's why it was noted as not being fully disabled. We've now fixed the keyboard focus issue, and the next step is to update the button's opacity to meet the minimum contrast requirements. The accessibility team still believes it's important to ensure the contrast is sufficient, despite the focus issue being addressed. Here's a Slack discussion that explains the reasoning behind this decision.

czhou requested review of this revision.May 7 2026, 4:20 AM
czhou updated this revision to Diff 1268643.
browser/components/aiwindow/ui/content/firstrun.css
19

Good point! I've updated it. Thanks so much!

czhou edited the summary of this revision. (Show Details)
dao requested changes to this revision.May 7 2026, 11:42 AM
Comment Actions

Thank you so much for reaching out, @dao! The comment saying was initially made when reporting an issue about the let's go button being focusable with a keyboard even when disabled. That's why it was noted as not being fully disabled. We've now fixed the keyboard focus issue, and the next step is to update the button's opacity to meet the minimum contrast requirements. The accessibility team still believes it's important to ensure the contrast is sufficient, despite the focus issue being addressed. Here's a Slack discussion that explains the reasoning behind this decision.

I'm still confused by that conversation because ensuring minimum contrast necessarily means the button will be less discernable as being disabled. I assume that's why disabled elements are exempt from contrast requirements in the first place. In some cases we have in fact reduced the opacity of disabled elements in prefers-contrast mode to ensure they don't look enabled. I don't understand why we'd want to do the opposite for this button even after reading that thread.

This revision now requires changes to proceed.May 7 2026, 11:42 AM
Comment Actions

Thank you so much for reaching out, @dao! The comment saying was initially made when reporting an issue about the let's go button being focusable with a keyboard even when disabled. That's why it was noted as not being fully disabled. We've now fixed the keyboard focus issue, and the next step is to update the button's opacity to meet the minimum contrast requirements. The accessibility team still believes it's important to ensure the contrast is sufficient, despite the focus issue being addressed. Here's a Slack discussion that explains the reasoning behind this decision.

I'm still confused by that conversation because ensuring minimum contrast necessarily means the button will be less discernable as being disabled. I assume that's why disabled elements are exempt from contrast requirements in the first place. In some cases we have in fact reduced the opacity of disabled elements in prefers-contrast mode to ensure they don't look enabled. I don't understand why we'd want to do the opposite for this button even after reading that thread.

Thanks for pushing back here @dao! re-reading the Slack thread, the reasoning is more nuanced than "WCAG 1.4.3 says so". A few key points from the a11y team:

  1. This isn't about meeting a WCAG conformance bar: they explicitly acknowledge it's *not* a WCAG violation in the strict sense (the disabled exemption would apply). It's about affordance for sighted users with color blindness, low vision, or even just bright glare on their monitor.
  1. The implicit question is: if a disabled button shouldn't need to be readable, why is it visible at all? Since it remains on screen, it's still communicating something to the user. And the instructional text that tells them "pick a model first" is spatially separated from the button — by the time the user reaches the button, that instruction may have dropped out of short-term memory. The label itself needs to stay readable enough to remind them.
  1. Crucially, they're *not* aiming for 4.5:1 (full WCAG AA) — that would defeat the disabled affordance, which is your concern. They're aiming for 3:1 — readable enough to discern, dim enough to still read as disabled. This is the Firefox-agreed standard for disabled text (per discussions with @jules from the Design Systems team).

So the spec we're targeting here is the Firefox "3:1 for disabled text" convention, which is a deliberate middle ground between WCAG AA (too readable) and the WCAG exemption (essentially invisible). 0.75 opacity hits that 3:1 target for the current gradient.

If it would be helpful, I'd be glad to connect you with the a11y team to share more about this rationale!

czhou requested review of this revision.May 15 2026, 5:08 AM
Comment Actions

I defer to @dao here but I'm not sure I understand the benefit of all the custom prefixes?

browser/components/aiwindow/ui/content/firstrun.css
59

See below

61

See below

63

This gets used for a background image, not a colour? So I don't think this works. Maybe just if we don't want the gradient?

68–69

Do we really not want to show images here in forced colors mode? That seems odd?

71

image as well

dao requested changes to this revision.Wed, May 27, 7:48 AM
Comment Actions

I defer to @dao here but I'm not sure I understand the benefit of all the custom prefixes?

This was motivated by https://phabricator.services.mozilla.com/D296488#inline-1611780. Essentially this looked confusingly like it was doing things in the "button" variable namespace.

Requesting changes for @Gijs' latest review comments.

I'm open to rubber-stamping this as we've already burnt too much time on this single button. The custom fiddling and reinventing the wheel seems unfortunate, and this is exactly what the design system aimed to prevent. Maybe I'm wish-casting, but I seem to remember reading somewhere that an upcoming design update brings the button back in line with the design system? Would be great if we could get there sooner rather than later.

This revision now requires changes to proceed.Wed, May 27, 7:48 AM

Revision Contents

PathSize
browser/
components/
aiwindow/
ui/
content/
176 lines
CommitTreeParentsAuthorSummaryDate
ade10d7e1fa1c1e6dd854d56a358f48a49a4chloezhouny
Bug 2034940 - Fix contrast on "Let's go" button disabled state in AI window… (Show More…)
Apr 25 2026, 2:01 AM

Diff 1268723

browser/components/aiwindow/ui/content/firstrun.css

Loading...