Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

"Add funds" notification: Reduce nag level and add button to "Turn off notifications" #5469

Merged
merged 3 commits into from
Nov 9, 2016

Conversation

ayumi
Copy link
Contributor

@ayumi ayumi commented Nov 7, 2016

Fix #5418
Fix #5299

Auditors: @bsclifton

Test Plan / Quieter notification:

  1. Trigger the "Add funds" notification.
    a. Update reconcileStamp to <24 hours from now (or a few days in the past)
    b. Ensure not enough balance
  2. Change startup notification delay in ledger.js L484 from 15m to 5s
  3. Open Brave and observe notification. Click Later.
  4. Close Brave and reopen. Notification should not reappear.
    (Next Add funds notification timestamp is set in Application Support/brave-development/session-store-1 notification-add-funds-timestamp)

Test Plan / Turn off button:
5. Trigger the Add funds notification again by closing Brave and editing session-store-1 notification-add-funds-timestamp to the past.
6. Open Brave, and when the notification appears choose Turn off.
7. Open Preferences > Payments and click Advanced Settings... and observe notifications are disabled.

Image / Before
screen shot 2016-11-07 at 12 22 25

Image / After
screen shot 2016-11-08 at 14 30 38

Image 2 / After
screen shot 2016-11-08 at 14 19 39

cc @bbondy @bradleyrichter

@bradleyrichter
Copy link
Contributor

I am worried that this new button will be the first choice for most people and the result is a drop off in re-ups for month 2.

If we don’t want to do the work based on my suggestion, then let’s at least order the buttons so the CTA remains at the right side.

[TON] [Later] [Add Funds]

On Nov 7, 2016, at 1:27 PM, ayumi yu notifications@github.com wrote:

Fix #5418 #5418
Auditors: @bsclifton https://github.com/bsclifton
Test Plan / Quieter notification:

Trigger the "Add funds" notification.
a. Update reconcileStamp to <24 hours from now (or a few days in the past)
b. Ensure not enough balance
Change startup notification delay in ledger.js L484 from 15m to 5s
Open Brave and observe notification. Click Later.
Close Brave and reopen. Notification should not reappear.
(Next Add funds notification timestamp is set in Application Support/brave-development/session-store-1 notification-add-funds-timestamp)
Test Plan / Turn off button:
5. Trigger the Add funds notification again by closing Brave and editing session-store-1 notification-add-funds-timestamp to the past.
6. Open Brave, and when the notification appears choose Turn off.
7. Open Preferences > Payments and click Advanced Settings... and observe notifications are disabled.

Image / Before
https://cloud.githubusercontent.com/assets/521861/20076580/cc6deb5a-a4ed-11e6-9cbe-e92fd20d159f.png
Image / After
https://cloud.githubusercontent.com/assets/521861/20076587/d54f47fa-a4ed-11e6-9851-3044fba5ec5a.png
cc @bbondy https://github.com/bbondy @bradleyrichter https://github.com/bradleyrichter
You can view, comment on, or merge this pull request online at:

#5469 #5469
Commit Summary

Limit Add funds notification to once every 3 days
In Add funds notification add button to turn off notifications
File Changes

M app/extensions/brave/locales/en-US/app.properties https://github.com/brave/browser-laptop/pull/5469/files#diff-0 (1)
M app/ledger.js https://github.com/brave/browser-laptop/pull/5469/files#diff-1 (63)
M app/locale.js https://github.com/brave/browser-laptop/pull/5469/files#diff-2 (1)
M js/constants/appConfig.js https://github.com/brave/browser-laptop/pull/5469/files#diff-3 (2)
M js/constants/settings.js https://github.com/brave/browser-laptop/pull/5469/files#diff-4 (1)
M less/notificationBar.less https://github.com/brave/browser-laptop/pull/5469/files#diff-5 (2)
Patch Links:

https://github.com/brave/browser-laptop/pull/5469.patch https://github.com/brave/browser-laptop/pull/5469.patch
https://github.com/brave/browser-laptop/pull/5469.diff https://github.com/brave/browser-laptop/pull/5469.diff

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #5469, or mute the thread https://github.com/notifications/unsubscribe-auth/AM4jqjj8Wk08iRI35b5SV86mfl67EqAkks5q75e0gaJpZM4Krt0d.

@ayumi
Copy link
Contributor Author

ayumi commented Nov 7, 2016

Is it our convention to have primary buttons at the rightmost side? I put it on the left because I'd assumed it was reading order / left to right.

RE Drop off: I think nagging people every month currently doesn't lead to much re-upping, so removing notifications would lose just a small number of users. Also, nagging annoys users.

I feel auto monthly reload would fix these problems.

@bsclifton bsclifton self-assigned this Nov 8, 2016
@bbondy bbondy added this to the 0.12.9dev milestone Nov 8, 2016
@bbondy
Copy link
Member

bbondy commented Nov 8, 2016

Agree if someone wants to turn off notifications, then let them. They can go in preferences if they want it. We don't want to nag people in this way. Not every hour, not every 6 hours, not every day, not every month.

@bbondy
Copy link
Member

bbondy commented Nov 8, 2016

I think the convention is that default button is rightmost and I think we should be consistent with it.

@bbondy
Copy link
Member

bbondy commented Nov 8, 2016

Some examples of button order.

screenshot 2016-11-08 08 40 24

screenshot 2016-11-08 08 38 31

screenshot 2016-11-08 08 38 27

screenshot 2016-11-08 08 40 14

@bradleyrichter
Copy link
Contributor

Nag them we should not. Not in a boat. Not with a goat.

And yes, button order should be flipped.

I wish the notify-off button text was shorter but I don't have a better solution at the moment.

On Nov 8, 2016, at 5:41 AM, Brian R. Bondy notifications@github.com wrote:

Some examples of button order.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

ayumi added 2 commits November 8, 2016 14:08
Related: #5418

Auditors: @bsclifton

Test Plan:
1. Trigger the "Add funds" notification.
  - Update reconcileStamp to <24 hours from now (or a few days in the past)
  - Ensure not enough balance
2. Change startup notification delay in ledger.js L484 from 15m to 5s
3. Open Brave and observe notification
4. Close Brave and reopen. Notification should not reappear.
(Next Add funds notification timestamp is set in Application Support/brave-development/session-store-1 `notification-add-funds-timestamp`)
Fix #5418

Auditors: @bsclifton

Test plan:
1. Trigger "Add funds" notification by having Payments enabled and editing session-store-1 reconcileDate to in the past
2. Observe notification with new "Turn off notification" button.
3. Click it
4. Open Preferences > Payments and click Advanced Settings... and observe notifications are disabled.
@ayumi ayumi force-pushed the fix/payments-add-funds-quiet branch from 1c2d16b to aa08129 Compare November 8, 2016 22:08
@bsclifton
Copy link
Member

Heads up (coming soon by @jkup !) We will be updating the styles throughout the app to be consistent 😄

EX: these flat buttons
screen shot 2016-11-08 at 4 43 49 pm

Versus the fancy 🎩
screen shot 2016-11-08 at 4 45 05 pm

@@ -320,12 +320,13 @@ if (ipc) {
const win = electron.BrowserWindow.getFocusedWindow()
if (message === addFundsMessage) {
appActions.hideMessageBox(message)
// See showNotificationAddFunds() for buttons.
// buttonIndex === 1 is "Later"; the timestamp until which to delay is set
// in showNotificationAddFunds() when triggering this notification.
if (buttonIndex === 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These indexes (indices?) would be great as constants, IMO. Instead of checking against 0, it could look like:
if (buttonIndex === ledgerButton.Later) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your comment, i think it'd make the code easier to follow.. maybe button indexes should be replaced by button values or something .. like if buttonValue === ledgerButton.later

The index shouldn't matter, just the button action. This would also handle cases where button sets don't contain Later or Turn off because they're not applicable.

@bsclifton
Copy link
Member

Dismissing (or choosing to turn off notifications) sets the timestamp as 3 days in the future. So I can re-enable if I change my mind afterwards and I'll be prompted again 3 days from when I chose hide (effectively same as dismiss)

Tested locally and it works great; merging 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants