Closed Bug 2070290 Opened 27 days ago Closed 26 days ago

Newtab context menus no longer match user theme

Categories

(Firefox :: New Tab Page, defect, P1)

defect

Tracking

()

VERIFIED FIXED
157 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox-esr153 --- unaffected
firefox155 --- unaffected
firefox156 --- wontfix
firefox157 --- verified
firefox158 --- verified

People

(Reporter: thecount, Assigned: ini)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [hnt])

Attachments

(1 file)

Regression: https://phabricator.services.mozilla.com/D311432

That was included in bug 2051742 which looks to maybe have multiple patches.

To test

  1. Set newtab background to light if you have a dark theme, or dark if you have a light theme.
  2. Click the shortcut context menu button.

Expected: Should match your theme.
Actual: It matches the wallpaper.

Component: Profile Backup → New Tab Page
Status: NEW → RESOLVED
Closed: 27 days ago
Resolution: --- → FIXED
Whiteboard: [hnt]
Keywords: regression
Regressed by: 2051742

Reopening: this was marked FIXED at filing time by accident, no patch has landed. Setting P1/S2. The regressing patch (D311432) is in browser/extensions/newtab, so it rides the trainhop; the 157 XPI cut Aug 31 likely carries it to release users this week, and Beta 156 ships Sep 15. Assignee left to Scott.

Severity: -- → S2
Status: RESOLVED → REOPENED
Priority: -- → P1
Resolution: FIXED → ---

Set release status flags based on info from the regressing bug 2051742

:jbrown, since you are the author of the regressor, bug 2051742, could you take a look?

For more information, please visit BugBot documentation.

This looks like CSS color-scheme inheritance rather than anything in the menu code.

browser/extensions/newtab/content-src/components/TopSites/_TopSites.scss applies the wallpaper-contrast-fix mixin (browser/extensions/newtab/content-src/styles/_mixins.scss) to .top-site-outer while the tile is hovered or .active, forcing color-scheme: light|dark from the .lightWallpaper/.darkWallpaper body class. The tile carries .active exactly while its menu is open. D311432 (443bdfc9eea4) swapped the old .context-menu div — styled from --newtab-* theme variables, which don't react to color-scheme — for <panel-list> (browser/extensions/newtab/content-src/components/TopSites/TopSite.jsx), whose tokens are light-dark()-based (--panel-list-background-color: var(--background-color-box), toolkit/content/widgets/panel-list/panel-list.tokens.css). A popover still inherits from its DOM parent, so the menu now resolves those tokens against the wallpaper's scheme instead of the theme's. The section menu has the same exposure — its panel-list sits under .section-context-wrapper, which also includes the mixin (browser/extensions/newtab/content-src/components/DiscoveryStreamComponents/CardSections/_CardSections.scss).

Proposed fix: re-assert the page's theme scheme on the menus instead of letting them inherit the wallpaper's. Record it as a custom property alongside the existing branches in browser/extensions/newtab/content-src/styles/_theme.scss (--newtab-theme-color-scheme: light, dark under [lwt-newtab-brighttext] at #89-92 and in the prefers-color-scheme: dark block at #120-122), then apply color-scheme: var(--newtab-theme-color-scheme) to panel-list globally next to the existing rule in browser/extensions/newtab/content-src/styles/activity-stream.scss, so all four migrated menus are covered at once. color-scheme: initial is not a substitute — it pins light-dark() to its light branch and breaks dark themes, the same caveat already noted in browser/extensions/newtab/content-src/components/Base/_Grid.scss.

No existing test asserts menu theming. browser/extensions/newtab/test/browser/browser_topsites_section.js and browser/extensions/newtab/test/browser/browser_topsites_contextMenu_options.js already open the panel-list and are the natural place to add a check that the computed color-scheme of panel-list matches the document root's with a contrasting wallpaper class applied.


Suggested severity: S3
The menu is mis-themed but not broken: --panel-list-background-color and --panel-list-text-color flip together, so it stays legible and fully usable, and only users whose wallpaper luminance differs from their theme see it.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-wrong-file, ai-triage-wrong-cause, ai-triage-hallucination, ai-triage-out-of-scope, ai-triage-wrong-fix, ai-triage-shallow-fix.

Assignee: nobody → ini
Pushed by ini@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/984bb1989afc https://hg.mozilla.org/integration/autoland/rev/b6f962f02a53 Keep New Tab panel-list menus on the browser theme when a wallpaper is set. r=thecount
Status: REOPENED → RESOLVED
Closed: 27 days ago → 26 days ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch

The patch landed in nightly and beta is affected.
:ini, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(ini)

Setting Fx156 to wontfix since this can train hop

Flags: needinfo?(jbrown)
Flags: needinfo?(ini)
QA Whiteboard: [qa-triage-done-c158/b157][qa-ver-needed-c158/b157]
Flags: qe-verify+
QA Contact: tzsoldos
QA Contact: tzsoldos

I have verified this issue using the latest Firefox Nightly 158.0a1 (Build ID: 20260921195707) and Firefox Beta 157.0b4 (Build ID: 20260921090921) on Windows 10 x64, macOS 15.7.3, and Ubuntu 24.04.1.

  • The context menu of shortcuts matches the user’s theme.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
QA Whiteboard: [qa-triage-done-c158/b157][qa-ver-needed-c158/b157] → [qa-triage-done-c158/b157][qa-ver-done-c158/b157]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: