-
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
feat: Display advanced section within confirmation by default for some users #25687
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. |
bf3b4da
to
90685dd
Compare
ui/pages/confirmations/components/confirm/info/contexts/advanced-details-context.tsx
Outdated
Show resolved
Hide resolved
ui/pages/confirmations/components/confirm/header/header-info.test.tsx
Outdated
Show resolved
Hide resolved
ui/pages/confirmations/components/confirm/header/header.test.tsx
Outdated
Show resolved
Hide resolved
ui/pages/confirmations/components/confirm/info/contexts/advanced-details-context.tsx
Outdated
Show resolved
Hide resolved
fe4cbff
to
05e03d0
Compare
05e03d0
to
9e97025
Compare
@@ -94,6 +94,7 @@ export default class PreferencesController { | |||
featureNotificationsEnabled: false, | |||
showTokenAutodetectModal: null, | |||
showNftAutodetectModal: null, // null because we want to show the modal only the first time | |||
isConfirmationAdvancedDetailsOpen: false, |
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.
isConfirmationAdvancedDetailsOpen
sounds more like app state then preference
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.
It is an app state though, we substituted useState
with this background preference property for expanding and collapsing advanced details...
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.
Even though it's triggered via a toggle, it is still a mechanism to indicate their preference which we could theoretically use elsewhere.
So maybe showConfirmationAdvancedDetails
?
const advancedDetailsObject = useMemo( | ||
() => ({ showAdvancedDetails, setShowAdvancedDetails }), | ||
[showAdvancedDetails, setShowAdvancedDetails], | ||
); |
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.
useMemo here does not looks very useful.
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.
The useMemo
is primarily used for maintaining referential equality and potentially preventing unnecessary re-renders in child components.
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 think the container for the properties typically shouldn't matter, as any dependent component or hook would be using the values within the object as dependencies, rather than the container itself.
require('../../../../../../store/actions').setConfirmationAdvancedDetailsOpen; | ||
|
||
getConfirmationAdvancedDetailsOpenMock.mockReturnValue(false); | ||
setConfirmationAdvancedDetailsOpenMock.mockReturnValue(null); |
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.
spyOn
may also be used here for mocking.
size={ButtonIconSize.Sm} | ||
// to reset the button padding | ||
style={{ marginLeft: '-4px' }} | ||
data-testid="edit-nonce-icon" |
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 hope this left margin does not effect existing use cases.
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 made the change in the name of consistency with the designs, so I think it's safe.
'.settings-page__header__title-container__close-button', | ||
); | ||
} | ||
|
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.
👍
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.
Great work 👍
I left some small feedbacks
a405255
to
314e4aa
Compare
314e4aa
to
69a8226
Compare
16dc553
to
bd64934
Compare
…nonce editing (EIP1559)
… without custom nonce editing (EIP1559
bd64934
to
5cf58d4
Compare
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #25687 +/- ##
===========================================
- Coverage 69.76% 69.75% -0.01%
===========================================
Files 1398 1400 +2
Lines 49171 49199 +28
Branches 13574 13578 +4
===========================================
+ Hits 34303 34318 +15
- Misses 14868 14881 +13 ☔ View full report in Codecov by Sentry. |
Builds ready [5cf58d4]
Page Load Metrics (65 ± 7 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Display advanced details section within confirmation by default for users that have edit nonce or showing hex data on. The PR includes e2e tests for these changes.
This PR also changes the copy for the nonce toggle and includes minor refactors to the gas fees logic.
Related issues
Fixes: #2737
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist