-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: added fallback value for Name component #37299
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
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/confirmations (2 files, +12 -5)
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [099bf40]
UI Startup Metrics (1241 ± 95 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [d073d76]
UI Startup Metrics (1276 ± 90 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> - Added optional prop, `fallbackName` to `name-details` component. - Provide token symbol from shield pricing as a `fallbackName` prop in Shield-subscription-approval page. [](https://codespaces.new/MetaMask/metamask-extension/pull/37299?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Added optional prop, `fallbackName` to `name-details` component. CHANGELOG entry: Provide token symbol from shield pricing as a `fallbackName` prop in Shield-subscription-approval page. ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a fallbackName prop to Name/NameDisplay and uses the selected token symbol as a fallback in Shield subscription approval; exposes selectedTokenPrice from pricing hook and updates tests. > > - **Name components**: > - Add optional `fallbackName` prop to `ui/components/app/name/name-details/name-display.tsx` and plumb through `ui/components/app/name/name.tsx`. > - Render shortened `fallbackName` when resolved `name` is unavailable; keep full-name rendering for resolved names when `showFullName` is true. > - **Shield subscription approval UI**: > - Use `fallbackName` in `EstimatedChanges` by passing `tokenSymbol` to `Name`. > - Derive `tokenSymbol` via `selectedTokenPrice` from `useShieldSubscriptionPricingFromTokenApproval` and pass through in `shield-subscription-approve.tsx`. > - **Hooks**: > - `useShieldSubscriptionPricingFromTokenApproval` now returns `selectedTokenPrice` alongside `productPrice` and `pending`. > - **Tests**: > - Add tests for `NameDisplay` including fallback rendering. > - Update subscription pricing tests to assert initial `selectedTokenPrice` is undefined and that it resolves with crypto payment method. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d073d76. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [0391320]
UI Startup Metrics (1269 ± 87 ms)
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [aab4c64]
UI Startup Metrics (1290 ± 106 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
fallbackNametoname-detailscomponent.fallbackNameprop in Shield-subscription-approval page.Changelog
CHANGELOG entry: Added optional prop,
fallbackNametoname-detailscomponent.CHANGELOG entry: Provide token symbol from shield pricing as a
fallbackNameprop in Shield-subscription-approval page.Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Adds a fallbackName prop to Name components and surfaces token symbol from subscription pricing (via selectedTokenPrice) to Shield approval UI, with updated hook and tests.
fallbackNameprop toui/components/app/name/name-details/name-display.tsxandui/components/app/name/name.tsx.fallbackNamewhennameis unavailable; keep full-name rendering only whennameexists.name-display.test.tsx.useShieldSubscriptionPricingFromTokenApprovalnow returnsselectedTokenPricealongsideproductPrice/pending.selectedTokenPricepresence.EstimatedChangesacceptstokenSymboland passes it asfallbackNametoName.shield-subscription-approve.tsxwiresselectedTokenPrice?.symbolintoEstimatedChanges.Written by Cursor Bugbot for commit aab4c64. This will update automatically on new commits. Configure here.