-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Part of #17670: Replace Typography with Text component in CancelSpeedupPopover #18638
Conversation
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. |
There was a problem hiding this 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.
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Outdated
Show resolved
Hide resolved
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Outdated
Show resolved
Hide resolved
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Outdated
Show resolved
Hide resolved
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Outdated
Show resolved
Hide resolved
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.stories.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Outdated
Show resolved
Hide resolved
* addresses MetaMask#18651 * taken from MetaMask#18752 as suggested in MetaMask#18638 (comment)
There was a problem hiding this 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 👍
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 🙏
@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 |
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: Everybody cool if I push this change in here? It's adding |
@georgewrmarshall I think a fluke, i am rerunning |
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. |
|
* replace CSS with props styling * use `Button` from `component-library` * tooltip HTML refactor with `component-library` components * remove whitespace in story
* addresses MetaMask#18651 * taken from MetaMask#18752 as suggested in MetaMask#18638 (comment)
There was a problem hiding this 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 💯 🙏
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Outdated
Show resolved
Hide resolved
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! |
There was a problem hiding this 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
LGTM! I updated the branch to see if the jest error will pass (which it should be) |
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 |
0fb6e19
0fb6e19
to
73307fd
Compare
@@ -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, |
There was a problem hiding this comment.
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
There was a problem hiding this 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>, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<> | ||
<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> | ||
</> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool
bdd0899
to
a6fb0dd
Compare
There was a problem hiding this 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 🙏
Part of #17670.
Switch
Typography
components withText
component within theCancelSpeedupPopover
. Additionally, created story for it. And kicked out some redundantBox
anddiv
as they were not doing anything except for bloating the DOM, although still a bit confused about all the nestedBox
usage even within theText
component. AlsoboxProps
are redundant with newText
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 anh6
should not directly follow anh2
.Screenshots/Screencaps
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
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.