Newtab context menus no longer match user theme
Categories
(Firefox :: New Tab Page, defect, P1)
Tracking
()
| 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
- Set newtab background to light if you have a dark theme, or dark if you have a light theme.
- Click the shortcut context menu button.
Expected: Should match your theme.
Actual: It matches the wallpaper.
| Reporter | ||
Updated•27 days ago
|
| Reporter | ||
Updated•27 days ago
|
Updated•27 days ago
|
| Reporter | ||
Updated•27 days ago
|
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.
Comment 2•27 days ago
|
||
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 | ||
Comment 4•27 days ago
|
||
Updated•27 days ago
|
Comment 6•26 days ago
|
||
| bugherder | ||
Comment 7•26 days ago
|
||
The patch landed in nightly and beta is affected.
:ini, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox156towontfix.
For more information, please visit BugBot documentation.
Comment 8•26 days ago
|
||
Setting Fx156 to wontfix since this can train hop
Updated•19 days ago
|
Updated•18 days ago
|
Updated•17 days ago
|
Comment 9•13 days ago
|
||
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.
Updated•12 days ago
|
Description
•