Open Bug 2068503 Opened 6 days ago Updated 6 days ago

The expand/collapse icon still shows 'collapse' even after the widgets auto-minimize

Categories

(Firefox :: New Tab Page, defect)

Desktop
All
defect

Tracking

()

Tracking Status
firefox155 --- affected

People

(Reporter: csasca, Unassigned)

References

(Blocks 1 open bug)

Details

Found in

  • Firefox 155.0 (NewTab addon v157.0.20260831.183837)

Affected versions

  • Firefox 155.0
  • Firefox 157.0a1 (2026-09-01)

Tested platforms

  • Affected platforms: macOS 27, Windows 11, Ubuntu 26.04

Preconditions

  • Have widgets enabled

Steps to reproduce

  1. Set the pref browser.newtabpage.activity-stream.pageLayouts.variant to auto-minimize-widgets
  2. Open a new tab and wait for ~3-4 seconds
  3. Look for ^ near the widgets after are minimized

Expected result

  • The " ^ " icon is inverted downwards to indicate the user that the widgets can be expanded back.

Actual result

  • The " ^ " icon stays the same after the widgets are minimized.

Regression range

  • New feature

Additional notes

The header toggle's arrow direction is bound to the widget size state, not to whether the section is collapsed.

In browser/extensions/newtab/content-src/components/Widgets/Widgets.jsx the button's class is `widgets-expand-button${isMaximized ? " is-maximized" : ""}`, and the only rule that turns the icon over is _Widgets.scss.is-maximized { transform: rotate(180deg) } over the static arrow-down.svg. Auto-collapse never writes widgets.maximized; it sets local autoCollapsed state, from which sectionCollapsed derives. So the arrow keeps whatever orientation the size state gave it and never flips when the section minimizes.

Blame supports that reading: bug 2066527 (30e59ac0) gave this button its new role by switching the data-l10n-id (#694-696) and the handlers (#708-717), but left line 704 as bug 2027885 wrote it — label and action were updated for the new role, icon direction was not.

Fix: derive the rotation from the role rather than the size pref, e.g.

const headerTogglePointsUp = autoMinimizeActive ? !sectionCollapsed : isMaximized;

and key the class at #704 off that (or give the SCSS rule a role-neutral class name, since is-maximized no longer describes both uses). Arrow up = collapse, arrow down = expand, consistent with the existing minimize/maximize pairing.

Two adjacent problems in the same block, worth fixing together:

  • The data-l10n-id switches on autoMinimizeActive rather than sectionCollapsed, so "Show widgets" is exposed for the whole pre-collapse delay while the widgets are still on screen — contrary to the string's own comment in newtab.ftl. The handler choice would have to move to the same condition.
  • In this role the button controls #widgets-container but has no aria-expanded/aria-controls, unlike .widgets-row-toggle (#1005-1006). That toggle is display: none while collapsed, so the collapsed state currently reaches assistive tech only via inert.

Tests: the auto-minimize block in Widgets.test.jsx covers data-section-collapsed, inert, telemetry and the override pref, but nothing asserts the button's class, iconsrc or l10n id — the icon direction is uncovered. Its makeState also pins widgets.maximized: false, so a regression test should exercise the maximized case, which is where the wrong "^" is visible.

Reasoned from the source; not built or run.


Suggested severity: S4
The icon orientation is cosmetic — the button still works and its tooltip/aria-label ("Show widgets") already names the correct action, so the cost is a misleading affordance for profiles on the auto-minimize-widgets variant.


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.

You need to log in before you can comment on or make changes to this bug.