Skip to content

Move widget stack state to list format #9584

Closed
brave/brave-core
#5445
@ryanml

Description

@ryanml

Description

Currently, the state of the widget stack on the NTP is binary:

export type StackWidget = 'rewards' | 'binance'

interface NTPState {
  currentStackWidget: StackWidget
}

This doesn't allow for ease of adding more widgets to it, which we plan to do. This attribute should be moved to a list, which is enumerated over and controls the display of the widgets in the stack. This will result in 0 change to the user experience, but will pave the way for the future widgets we plan to add. The piece of work should also migrate older states when upgrading to this new format.

Test Plan

  1. Clean Profile
  2. Perform a general regression test of the widget stack, which includes showing/hiding Binance and Rewards, as well as toggling between the two to move them between the foreground and background.
  3. Ensure that turning the widgets on and off via brave://settings/newTab works as expected.
  4. Upgrade from a previous profile, with varying states of the widget stack (ex: each in foreground, one off, one on, both off) and ensure that the state is preserved upon upgrade.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions