Closed Bug 2085931 Opened 22 days ago Closed 5 days ago

[Nova] Drop-to-group highlight colors do not match spec

Categories

(Firefox :: Tabbed Browser: Tab Groups, defect, P2)

Firefox 154
defect
Points:
1

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: sthompson, Assigned: sthompson)

References

Details

(Whiteboard: [fidefe-post-nova])

Attachments

(1 external file)

Steps to reproduce:

  1. Set browser.nova.enabled to true and use dark mode.
  2. Drag an ungrouped tab and hold it over another ungrouped tab (or a split view) until the "create new group" drop highlight appears.
  3. Separately, drag an ungrouped tab and hold it over a collapsed tab group label until the "drop into collapsed group" highlight appears on the group label

Actual results:
The highlighted tab is filled with --dragover-tab-group-color-invert and outlined with --dragover-tab-group-color, but the two come from different color ramps. When Nova is enabled, --dragover-tab-group-color uses the Nova --tab-group-${color} but --dragover-tab-group-color-invert uses the Proton --tab-group-${color}-invert since the Nova layer doesn't override that token.

Expected results:
The fill and outline should be a matched pair from the Nova tab group palette.

Cause:
Bug 2046942 added a Nova tab group palette in tab.nova.tokens.json, which generates the tokens-foundation-nova layer in browser/themes/shared/tabbrowser/tab.tokens.css. It defines only the base, -hover and -text token for each color (--tab-group-<color>, --tab-group-<color>-hover, --tab-group-<color>-text). The --tab-group-<color>-invert and --tab-group-<color>-text-invert tokens are still only defined in the tokens-foundation layer, with values that pair with the old palette. The other definitions in browser/themes/shared/tabbrowser/tabs.css are inside @media not -moz-pref("browser.nova.enabled"), so they do not apply. Under Nova, the base token therefore comes from the new palette and the invert token from the old one.

The same mismatch affects the highlight on a collapsed tab group label when dragging a tab over it (tab-group[collapsed] ... [dragover-groupTarget]): its fill and text use --tab-group-color-invert and --tab-group-text-color-invert (old palette), while its outline uses --tab-group-background-color (Nova palette).

Gray is not affected because Nova does not override any gray tokens.

Fix:
Add invert and text-invert entries for each color to tab.nova.tokens.json, using the values from the Nova design spec, and regenerate with mach buildtokens. Verify that the invert and text-invert tokens are correctly applied to tabs and tab group labels. Note that --tab-group-<color>-pale tokens are still not needed under Nova and they will be deleted when post-Nova cleanup is complete.

Note: it seems to me like there are three definitions of tab group tokens:

  1. tab.tokens.css base layer
  2. tab.tokens.css Nova layer
  3. tabs.css media query for non-Nova

It looks to me like #3 (the colors and tokens for Proton) are all correct and working fine.

#1 and #2 look strange to me. For example, it looks like the --tab-group-${color} base layer value is not actually used anywhere because it's overridden for both Nova (in the Nova layer) and non-Nova (in tabs.css). I think we may have gotten into a situation where the base layer was supposed to take the Nova values and then be overridden in tabs.css for Proton, but after we did that, there were Figma edits to the tab group colors that got synced to the tab.tokens.css Nova layer instead of the base layer.

Since #3 should be fine, I wonder if a better solution is to combine this with some cleanup work. We could move all of the tab.nova.tokens.json tab group tokens into tab.tokens.json to overwrite the base layer with Nova values, then add the new -invert and -text-invert values in tab.tokens.json. I think this should result in the following:

  1. tab.tokens.css base layer (reflecting Nova colors and tokens)
  2. tabs.css media query for non-Nova (reflecting Proton colors and tokens)

and then the cleanup of pre-Nova stuff would have an easier time of deleting the Proton-specific stuff.

This patch makes the base layer for tab.tokens.css reflect the Nova values for tab group tokens while leaving tabs.css unchanged to override Proton values for those tokens.

It looks like the current state was:

  1. tab.tokens.css base layer describes older values for Nova
  2. tab.tokens.css Nova layer describes the latest values for Nova
  3. tabs.css describes the Proton values

Parts 1 and 2 were confusing because some values are different and some token definitions were missing. This patch makes the base token layer set all of the Nova tokens with Nova values.

This change accomplishes two goals:

  1. fixes bug 2085931 by making sure each tab group token's invert counterpart is a correct light-dark swap of the non-inverted token
  2. makes it easier to clean up Proton tab group tokens, since they are now clearly in one location in tabs.css
Assignee: nobody → sthompson
Status: NEW → ASSIGNED
Pushed by sthompson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/09b86521110c https://hg.mozilla.org/integration/autoland/rev/aeba22d2efdd use Nova tab group token values by default r=nsharpley,desktop-theme-reviewers,tabbrowser-reviewers,reusable-components-reviewers,tgiles
Status: ASSIGNED → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: