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

Part of #17670: Replace Typography with Text component in CancelSpeedupPopover #18638

Conversation

kremalicious
Copy link
Contributor

@kremalicious kremalicious commented Apr 18, 2023

Part of #17670.

Switch Typography components with Text component within the CancelSpeedupPopover. Additionally, created story for it. And kicked out some redundant Box and div as they were not doing anything except for bloating the DOM, although still a bit confused about all the nested Box usage even within the Text component. Also boxProps are redundant with new Text component as far as I can see.

Also nicer balanced spacing between text, divider, and the rest.

As for the story, was a bit tricky getting the right context providers and their respective test data. In end had to slap in 3 providers and used mock data from the ./test folder instead of ./storybook folder. If this is not desired, I could look into figuring out which exact mock data needs to be added to the mock data files under ./storybook. And if anybody knows an easier way to get the story for this component running, I'm all ears!

Finally, also saw this code suggestion by @georgewrmarshall on a former closed PR but I do not agree, as, semantically, a p is perfectly fine for the modal description up there and an h6 should not directly follow an h2.

Screenshots/Screencaps

Before

Screenshot 2023-04-18 at 13 27 43

After

Screenshot 2023-04-20 at 12 43 17

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@kremalicious kremalicious requested a review from a team as a code owner April 18, 2023 13:16
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Hey @kremalicious, this is excellent! Thank you very much for your contribution. The story is outstanding 💯 I've made some more suggestions that are out of the scope of the original task but they are small updates compared to the extra work you've put in on the story and think it will further improve this component. As for the h6 suggestion you are totally correct! Unfortunately the old Typography component automatically set the semantic tags so those had to be set to ensure e2e tests would pass.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Apr 19, 2023
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Looking good! Seems like e2e tests are failing but I'm not sure why

kremalicious added a commit to kremalicious/metamask-extension that referenced this pull request Apr 25, 2023
DDDDDanica
DDDDDanica previously approved these changes Apr 27, 2023
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Looking great! One small suggestion and then I will approve 👍

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! 💯 Thanks for your contribution @kremalicious 🙏

DDDDDanica
DDDDDanica previously approved these changes Apr 28, 2023
@georgewrmarshall
Copy link
Contributor

@brad-decker I'm not familiar with this build issue have you seen it before? Don't seem to see it on any other PRs and have logged out and back in

Screenshot 2023-04-28 at 7 31 34 PM

@kremalicious
Copy link
Contributor Author

kremalicious commented Apr 28, 2023

I would have a small additional change after seeing that the info tooltip is not consistent with the other tooltip from the "Gas" headline. Have a change which would make it like so:

Before:
Screenshot 2023-04-28 at 13 24 04

After:
Screenshot 2023-04-28 at 13 22 12

Everybody cool if I push this change in here? It's adding TextVariant.bodyXs to the respective components.

@brad-decker
Copy link
Contributor

@georgewrmarshall I think a fluke, i am rerunning

@georgewrmarshall
Copy link
Contributor

Hey @kremalicious, I also noticed the text size change and was ok with it because I think larger font size helps with accessibility and our new Tooltip will be at this size. Ok with either as this would be consistent with current tooltips.

@brad-decker
Copy link
Contributor

brad-decker commented May 2, 2023

@kremalicious if you have revoked circleCI access to your GitHub it may prevent your fork from running our test suite. I just updated your branch again to see if this will resolve itself if not you may want to investigate from your end on a permission level. To our knowledge no other contributors are presently experiencing CI issues that aren't relevant to their changes or tests we know to be flaky. In this case the entire pipeline is failing to run. NVM looks like it ran this time?

@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2023
* replace CSS with props styling
* use `Button` from `component-library`
* tooltip HTML refactor with `component-library` components
* remove whitespace in story
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Hey @kremalicious, I went to the liberty of resolving the conflicts and pushing up the changes. I hope you don't mind. Definitely one of the most thorough and well written contributions I've seen in a while. Thank you very much for your time, care and effort on this one 💯 🙏

@georgewrmarshall
Copy link
Contributor

Hey @kremalicious, just wanted to check in. It looks like this PR is almost there. Did you still want to work on it? If so, that's great! Let us know if you need any assistance or if there are any blockers. If you're unable to continue working on it or haven't had a chance to address it, no worries! I can take it from here and carry it forward. Cheers!

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! Not sure why tests are passing will try re-run them otherwise I may need some support from @brad-decker

  • pulled branch and checked storybook

garrettbear
garrettbear previously approved these changes Jun 1, 2023
@garrettbear
Copy link
Contributor

LGTM! I updated the branch to see if the jest error will pass (which it should be)

@georgewrmarshall
Copy link
Contributor

Looks like tests are failing legitimately this time and some investigation will be needed it may be that the semantic html needs to be updated in the e2e tests

@georgewrmarshall georgewrmarshall dismissed stale reviews from garrettbear and themself via 0fb6e19 June 19, 2023 19:03
@georgewrmarshall georgewrmarshall force-pushed the feature/17670-cancel-speedup-popover branch from 0fb6e19 to 73307fd Compare June 19, 2023 20:30
@@ -125,7 +125,7 @@ describe('CancelSpeedupPopover', () => {
it('information tooltip should contain the correct text if editGasMode is cancel', async () => {
await act(async () => render());
expect(
InfoTooltip.mock.calls[0][0].contentText.props.children[0],
InfoTooltip.mock.calls[0][0].contentText.props.children[0].props.children,
Copy link
Contributor

Choose a reason for hiding this comment

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

I hate this but don't have time right now to improve the tests for this

Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

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

More questions then feedback. Possibly just questions for @georgewrmarshall

>
{t('cancelSpeedUpLabel', [
<strong key="cancelSpeedupReplace">{t('replace')}</strong>,
<strong key="cancelSpeedupCancel">{t('replace')}</strong>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Question, why was the key changed on this? Also...why is the key needed? This might be a question for @georgewrmarshall

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question! This may have been a mistake. I'll remove it

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah right I'm not super familiar with locales but because it's in an array it needs a key

Screenshot 2023-06-20 at 4 10 17 PM

Comment on lines +112 to +127
<>
<Text variant={TextVariant.bodySm}>
{t('cancelSpeedUpTransactionTooltip', [
editGasMode === EditGasModes.cancel
? t('cancel')
: t('speedUp'),
])}
</Text>
<ButtonLink
variant={TextVariant.bodySm}
href="https://community.metamask.io/t/how-to-speed-up-or-cancel-transactions-on-metamask/3296"
target="_blank"
>
{t('learnMoreUpperCase')}
</ButtonLink>
</>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the choice to remove the in favor of a fragment related to the issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not particularly related to the issue but could have some minor performance benefits as there are no utility props being used on the Box so could save a small amount of render time?

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool

@georgewrmarshall georgewrmarshall force-pushed the feature/17670-cancel-speedup-popover branch from bdd0899 to a6fb0dd Compare June 20, 2023 23:12
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for your contribution @kremalicious 🙏

@georgewrmarshall georgewrmarshall merged commit 113fdc1 into MetaMask:develop Jun 26, 2023
50 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external-contributor team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants