Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move widget stack state to list format #9584

Closed
ryanml opened this issue May 2, 2020 · 3 comments · Fixed by brave/brave-core#5445
Closed

Move widget stack state to list format #9584

ryanml opened this issue May 2, 2020 · 3 comments · Fixed by brave/brave-core#5445

Comments

@ryanml
Copy link
Contributor

ryanml commented May 2, 2020

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.
@srirambv
Copy link
Contributor

srirambv commented Jun 3, 2020

Blocked by #10067

@kjozwiak
Copy link
Member

kjozwiak commented Jun 9, 2020

As discussed during the desktop planning and triage meeting, #10067 will be addressed in another. If it's fixed in time, we can get it into 1.11.x.

Lets run through as much as we can with the above cases and label this as verified. Removing the QA/Blocked label.

@srirambv
Copy link
Contributor

srirambv commented Jun 12, 2020

Verification passed on

Brave 1.10.90 Chromium: 83.0.4103.97 (Official Build) (64-bit)
Revision 326d148b9655369b86498d9ecca39f63dd2bdd2d-refs/branch-heads/4103@{# 657}
OS Linux
Clean Install

Widget Position

  • Verified Rewards widget is the first widget on a clean profile and Binance widget is in background
  • Toggle

  • Verified disabling Binance via dashboard and enabling it brings Binance widget into foreground
  • Verified with rewards in background and disabling it via dashboard and enabling it again brings rewards into focus
  • Verified when rewards widget shows grant notification, disabling and enabling doesn't lose the notification
  • Verified when a rewards notification is shown on the widget, clicking Binance to bring it to focus and then clicking rewards again doesn't lose the notification
  • Verified `Hide Binance` hides the widget and disables in dashboard. Also removes disconnects widget when hidden
  • Encountered [Desktop] Enabling Brave Rewards widget via settings page doesn't enable it in NTP #10067 and [Desktop] Unable to use menu items for stacked widgets  #10199 during testing
  • Upgrade Install

    Both widgets enabled

    - Clean install `1.9.80`
    - Keep both widgets enabled
    - Upgraded to `1.10.90`
    - Both widgets remained enabled
    

    Both widgets disabled

    - Clean install `1.9.80`
    - Disabled both widgets from dashboard
    - Upgraded to `1.10.90`
    - Both widgets remained disabled
    

    Binance enabled Rewards disabled

    - Clean install `1.9.80`
    - Disable rewards via dashboard and keep Binance enabled
    - Upgraded to `1.10.90`
    - Rewards remained disabled and Binance remained enabled
    

    Binance disabled Rewards enabled

    - Clean install `1.9.80`
    - Disable Binance via dashboard and keep Rewards enabled
    - Upgraded to `1.10.90`
    - Binance remained disabled and Rewards remained enabled
    

    Binance Widget state

  • Verified upgrading from `1.9.80` to `1.10.90` retains the widgets connected state

  • Verification passed on

    Brave 1.10.90 Chromium: 83.0.4103.97 (Official Build) (64-bit)
    Revision 326d148b9655369b86498d9ecca39f63dd2bdd2d-refs/branch-heads/4103@{# 657}
    OS Windows 10 OS Version 1809 (Build 17763.379)
    Clean Install

    Widget Position

  • Verified Rewards widget is the first widget on a clean profile and Binance widget is in background
  • Toggle

  • Verified disabling Binance via dashboard and enabling it brings Binance widget into foreground
  • Verified with rewards in background and disabling it via dashboard and enabling it again brings rewards into focus
  • Verified when rewards widget shows grant notification, disabling and enabling doesn't lose the notification
  • Verified when a rewards notification is shown on the widget, clicking Binance to bring it to focus and then clicking rewards again doesn't lose the notification
  • Verified `Hide Binance` hides the widget and disables in dashboard. Also removes disconnects widget when hidden
  • Encountered [Desktop] Enabling Brave Rewards widget via settings page doesn't enable it in NTP #10067 and [Desktop] Unable to use menu items for stacked widgets  #10199 during testing
  • Upgrade Install

    Both widgets enabled

    - Clean install `1.9.80`
    - Keep both widgets enabled
    - Upgraded to `1.10.90`
    - Both widgets remained enabled
    

    Both widgets disabled

    - Clean install `1.9.80`
    - Disabled both widgets from dashboard
    - Upgraded to `1.10.90`
    - Both widgets remained disabled
    

    Binance enabled Rewards disabled

    - Clean install `1.9.80`
    - Disable rewards via dashboard and keep Binance enabled
    - Upgraded to `1.10.90`
    - Rewards remained disabled and Binance remained enabled
    

    Binance disabled Rewards enabled

    - Clean install `1.9.80`
    - Disable Binance via dashboard and keep Rewards enabled
    - Upgraded to `1.10.90`
    - Binance remained disabled and Rewards remained enabled
    

    Binance Widget state

  • Verified upgrading from `1.9.80` to `1.10.90` retains the widgets connected state

  • Verification passed on

    Brave 1.10.90 Chromium: 83.0.4103.97 (Official Build) (64-bit)
    Revision 326d148b9655369b86498d9ecca39f63dd2bdd2d-refs/branch-heads/4103@{# 657}
    OS macOS Version 10.15.4 (Build 19E287)
    Clean Install

    Widget Position

  • Verified Rewards widget is the first widget on a clean profile and Binance widget is in background
  • Toggle

  • Verified disabling Binance via dashboard and enabling it brings Binance widget into foreground
  • Verified with rewards in background and disabling it via dashboard and enabling it again brings rewards into focus
  • Verified when rewards widget shows grant notification, disabling and enabling doesn't lose the notification
  • Verified when a rewards notification is shown on the widget, clicking Binance to bring it to focus and then clicking rewards again doesn't lose the notification
  • Verified `Hide Binance` hides the widget and disables in dashboard. Also removes disconnects widget when hidden
  • Encountered [Desktop] Enabling Brave Rewards widget via settings page doesn't enable it in NTP #10067 and [Desktop] Unable to use menu items for stacked widgets  #10199 during testing
  • Upgrade Install

    Both widgets enabled

    - Clean install `1.9.80`
    - Keep both widgets enabled
    - Upgraded to `1.10.90`
    - Both widgets remained enabled
    

    Both widgets disabled

    - Clean install `1.9.80`
    - Disabled both widgets from dashboard
    - Upgraded to `1.10.90`
    - Both widgets remained disabled
    

    Binance enabled Rewards disabled

    - Clean install `1.9.80`
    - Disable rewards via dashboard and keep Binance enabled
    - Upgraded to `1.10.90`
    - Rewards remained disabled and Binance remained enabled
    

    Binance disabled Rewards enabled

    - Clean install `1.9.80`
    - Disable Binance via dashboard and keep Rewards enabled
    - Upgraded to `1.10.90`
    - Binance remained disabled and Rewards remained enabled
    

    Binance Widget state

  • Verified upgrading from `1.9.80` to `1.10.90` retains the widgets connected state
  • Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment