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

Brave Rewards button #669

Closed
petemill opened this issue Jul 31, 2018 · 14 comments · Fixed by brave/brave-core#431
Closed

Brave Rewards button #669

petemill opened this issue Jul 31, 2018 · 14 comments · Fixed by brave/brave-core#431
Assignees
Labels
design A design change, especially one which needs input from the design team feature/rewards feature/user-interface All UI related QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Yes

Comments

@petemill
Copy link
Member

petemill commented Jul 31, 2018

Description

A new button in the BraveActions area, along with the Shields button (see #668).
This button should have the following states:

  • Rewards On
  • Rewards Off
  • Non-Rewards page

Clicking the button should invoke a web-ui popup which displays overall Rewards status (balance, etc) and actions for the active Tab. TBD whether this is an extension page or webui page.

@petemill petemill added the design A design change, especially one which needs input from the design team label Jul 31, 2018
@petemill petemill added this to the Backlog milestone Jul 31, 2018
@petemill petemill self-assigned this Jul 31, 2018
@petemill petemill modified the milestones: Backlog, Releasable builds Jul 31, 2018
@NejcZdovc
Copy link
Contributor

There is one more stage, rewards on with notification

@petemill
Copy link
Member Author

Here's my current thoughts on how we should do the data for this button:

  • Create a browser class very similar to ExtensionAction, RewardsAction. This can have per-tab data for icon and badge text, falling back to global values if no per-tab value is set. It will be the central class for the Rewards service to update the icon data (based on the navigation events it needs to monitor), and the UI layer to read the data from. It will store:
    • Which icon state to be in, per-tab. We can use an enum value instead of an exact Image here.
    • Badge text

As already decided, clicking the button will open a WebUI page in a popup. If we need to vary the exact URL that should open based on the tab publisher state or otherwise (which I don't think we will want to do atm) then RewardsAction can also store the URL which should open.

Since you've been working on the Rewards service so far and and I haven't looked at the branch yet @bridiver @NejcZdovc please let me know if you think this is something the Rewards service can send the data to for each tab.

@NejcZdovc
Copy link
Contributor

@petemill update. We will only have enable and disable state. There will not be verified state

@bridiver
Copy link
Contributor

I think this probably makes more sense as an extension browser/page action. Then there's no need for a bunch of new code to handle opening a webui page

@bridiver
Copy link
Contributor

we can create a new extension api to provide the necessary info

@NejcZdovc
Copy link
Contributor

@petemill url will always be the same (that we want to open). webui will receive publisher data that will be displayed. It will also receive wallet summary for the current month

@bridiver
Copy link
Contributor

bridiver commented Aug 23, 2018

actually we should look at component actions too and possibly subclass ExtensionActionViewController for it

@petemill
Copy link
Member Author

Sure @bridiver we can probably use another extension - I believe in a previous discussion @bbondy may have mentioned WebUI was preferable. I forget the reasons, but possibly due to ease of specific data access and providing events, though obviously we do that for shields.

I have already subclassed ExtensionActionViewController for the shields button in order to give it a different style to the other extensions.

@bridiver
Copy link
Contributor

I think creating a popup view that displays a webui is probably going to be more complicated, but we can potentially subclass ExtensionActionViewController to do that as well

@petemill
Copy link
Member Author

@bridiver I did a cursory look and the popup accepts a GURL pretty early on in the call stack

@bridiver
Copy link
Contributor

bridiver commented Aug 23, 2018

you can't just pass any url to it. It creates an extension host and you can't open a webui in an extension process. Even if it allows you to which I don't think it will, you would be creating a security issue

@NejcZdovc
Copy link
Contributor

update: we will just have on state and notification indicator if there will be one

@NejcZdovc
Copy link
Contributor

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design A design change, especially one which needs input from the design team feature/rewards feature/user-interface All UI related QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Yes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants