-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: some updates on the gator permission details #37768
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
base: main
Are you sure you want to change the base?
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. |
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (5 files, +451 -141)
|
Builds ready [48847d4]
UI Startup Metrics (1212 ± 115 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ui/components/multichain/pages/gator-permissions/components/review-gator-permission-item.tsx
Outdated
Show resolved
Hide resolved
Builds ready [ce94620]
UI Startup Metrics (1228 ± 95 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ui/components/multichain/pages/gator-permissions/components/review-gator-permission-item.tsx
Show resolved
Hide resolved
ui/components/multichain/pages/gator-permissions/components/review-gator-permission-item.tsx
Outdated
Show resolved
Hide resolved
Builds ready [23fd967]
UI Startup Metrics (1253 ± 90 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [8640a4d]
UI Startup Metrics (1261 ± 95 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [3a00d0e]
UI Startup Metrics (1216 ± 100 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [e09cd1c]
UI Startup Metrics (1257 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
dc8b63b to
01f7100
Compare
Builds ready [dc4099b]
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [662ce77]
UI Startup Metrics (1200 ± 96 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ui/components/multichain/pages/gator-permissions/components/review-gator-permission-item.tsx
Show resolved
Hide resolved
Builds ready [2fd2d06]
UI Startup Metrics (1224 ± 89 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
- Introduced `useGatorPermissionTokenInfo` hook to manage token info fetching logic. - Updated `ReviewGatorPermissionItem` component to utilize the new hook for token info. - Removed direct calls to `getGatorPermissionTokenInfo` and related state management. - Enhanced test coverage for the new hook, including various scenarios for token info retrieval. - Improved handling of native tokens and caching mechanisms for better performance.
Builds ready [c3b65be]
UI Startup Metrics (1229 ± 83 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…etrieval in PermissionItem
…in DisconnectPermissionsModal tests
Builds ready [0a2f776]
UI Startup Metrics (1205 ± 100 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| }, [accountText]); | ||
|
|
||
| // Handle copy button click | ||
| const handleCopyClick = useCallback(() => { |
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 is an existing useCopyToClipboard hook that already handles a lot of things and an existing CopyIcon component. Better use those for consistency and reusage.
| color={TextColor.TextAlternative} | ||
| variant={TextVariant.BodyMd} | ||
| > | ||
| Justification |
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.
Why are we handling the translation for this later? In other parts we have done it right away?
And if we are handling it seperatly, lets open an issue for that and here add a TODO comment for adding translation
| ? t('gatorPermissionUnknownTokenAmount') | ||
| : `${getDecimalizedHexValue(amountPerPeriod, decimals)} ${symbol}`, | ||
| value: loading | ||
| ? t('gatorPermissionUnknownTokenAmount') |
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.
Maybe add a spinner here if in loading state?
Description
Changelog
CHANGELOG entry: feat: add justification field to gator permission details
CHANGELOG entry: feat: add display account name and option to copy address
CHANGELOG entry: feat: show the time only if it's within 24 hours
CHANGELOG entry: fix: permission appears with "Unknown" amount issue
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Add justification field to gator permission details
Display account name and option to copy address
Show the time only if it's within 24 hours
Fix permission appears with "Unknown" amount issue
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Introduces a token info hook and updates permission details to show justification, account name with copy/feedback, conditional date-time formatting, and resilient token metadata handling to avoid "Unknown amount".
useGatorPermissionTokenInfo: New hook to resolve token metadata (native/erc20) via cache/imported/API/on-chain with promise dedupe; exported fromui/hooks/gator-permissions.review-gator-permission-item.tsx: Uses the new hook; adds account name display with copy-to-clipboard and success feedback; shows justification in expanded view; renders "Unknown amount" while loading; keeps weekly amount/frequency and adds conditional time in dates.permission-item.tsx: Refactors to the new hook; surfaces loading as"Unknown amount"in summaries.convertTimestampToReadableDate: ShowsMM/dd/yyyy HH:mmonly if timestamp is within 24 hours; otherwiseMM/dd/yyyy.Written by Cursor Bugbot for commit 0a2f776. This will update automatically on new commits. Configure here.