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

Fix partially hidden grant captcha drag and drop target image #4735

Merged
merged 1 commit into from
Mar 4, 2020

Conversation

zenparsing
Copy link
Collaborator

@zenparsing zenparsing commented Feb 25, 2020

Resolves brave/brave-browser#7597
Resolves brave/brave-browser#7147

Currently, when the grant captcha title text spans more than one line the drag-and-drop target image can extend below the bottom border of the rewards extension popup. This is because the GrantWrapper is an absolutely positioned overlay (rendered on top of the wallet UI), and absolutely positioned elements without explicit height to not grow the height of their parent.

This change modifies the rewards extension so that GrantWrapper is relatively positioned and the wallet UI is not rendered at the same time. GrantWrapper is also used in the promotions component of the settings page; in order to avoid layout changes there, a new style prop, overlay (boolean) has been added to the component which will cause it to be absolutely positioned.

Submitter Checklist:

Test Plan:

BR Panel

  • Launch Brave with a clean profile and --rewards=staging=true
  • Open BR panel, join rewards, and click "Claim"
    • Verify: draggable BAT logo is centered and drop tagets are visible
  • Right-click the "Prove that you are human" text and select "Inspect"
  • In DevTools, double-click the "Prove that you are human text" to edit
  • Add a long string of many words to the text
  • Press the TAB button to display the change
    • Verify: the size of the panel has grown to accomodate the additional text
  • Solve the catcha image
    • Verify: the confirmation UI is displayed correctly

BR Settings Page

  • Launch Brave with a clean profile and --rewards=staging=true
  • Navigate to brave://rewards and join rewards
  • Click the "Claim" button
    • Verify: the captcha UI is displayed correctly
  • Solve the captcha
    • Verify: the confirmation UI is displayed correctly

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@zenparsing zenparsing self-assigned this Feb 26, 2020
@zenparsing zenparsing marked this pull request as ready for review February 26, 2020 14:42
@zenparsing zenparsing added this to the 1.7.x - Nightly milestone Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants