-
Notifications
You must be signed in to change notification settings - Fork 5.2k
fix: NFT Grid tooltip #31625
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
fix: NFT Grid tooltip #31625
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
🖥️ @MetaMask/wallet-ux
|
import Tooltip from '../../ui/tooltip/tooltip'; | ||
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../shared/constants/app'; | ||
// eslint-disable-next-line import/no-restricted-paths | ||
import { getEnvironmentType } from '../../../../app/scripts/lib/util'; |
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.
Hmm this rule is meant to prevent the UI from requesting stuff from the background/scripts.
Is there another getEnvironmentType
or utility we can use here?
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.
As far as I know, this is the only utility. We're using it in a few places already. Do you know of another one we can use instead?
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.
Aw damn. No I don't know of another one we can use.
Thats okay then 😄
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 at the implementation, I'm not sure why this can only be used in the background.
metamask-extension/app/scripts/lib/util.ts
Lines 55 to 56 in a4179bc
const getEnvironmentType = (url = window.location.href) => | |
getEnvironmentTypeMemo(url); |
I think it can be moved to the shared folder in the future.
ellipsis | ||
> | ||
{nft?.name} | ||
</Text>{' '} |
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 this whitespace needed?
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 catch. Don't know where this came from, will remove
Builds ready [93facbd]
UI Startup Metrics (1214 ± 60 ms)
Bundle size diffs
|
Builds ready [0c55317]
UI Startup Metrics (1202 ± 65 ms)
Bundle size diffs
|
Builds ready [1155f70]
UI Startup Metrics (1252 ± 61 ms)
Bundle size diffs
|
b7a8af2
Builds ready [94b833f]
UI Startup Metrics (1197 ± 57 ms)
|
Builds ready [4e2610b]
UI Startup Metrics (1225 ± 74 ms)
Bundle size diffs
|
## **Description** Adds tooltip to truncated NFT Grid titles. [](https://codespaces.new/MetaMask/metamask-extension/pull/31625?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** Hover over NFT grid item that is truncated, if truncated it should tooltip, if the title is fully visible it should not tooltip ## **Screenshots/Recordings** https://github.com/user-attachments/assets/ea98bb55-1325-4c83-ba17-a830318f3ecf ## **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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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.
Description
Adds tooltip to truncated NFT Grid titles.
Related issues
Fixes:
Manual testing steps
Hover over NFT grid item that is truncated, if truncated it should tooltip, if the title is fully visible it should not tooltip
Screenshots/Recordings
demo.mov
Pre-merge author checklist
Pre-merge reviewer checklist