Skip to content

Commit f693520

Browse files
n3pscursoragent
andauthored
chore(ui): activity details as modal on wide viewport (#47309)
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## **Description** This PR makes the Activity Details dialog look like a proper modal on wide viewports while preserving the current full-screen appearance on narrow sized viewports. The goal is to serve as reference for future componetization of this pattern, to be used in wide layouts ## **Changelog** CHANGELOG entry: null ## **Related issues** Prepares for full-screen layout work by @amelieyc ## **Manual testing steps** **Testing on wide viewport (desktop browser):** 1. Build and run the extension in a desktop browser (Chrome/Brave/Edge) 2. Open MetaMask and navigate to the Activity tab 3. Click on any transaction in the activity list to open the details dialog 4. Verify the dialog appears as a centered modal 5. Click outside the dialog or press Escape to close it **Testing on narrow viewport (popup/sidepanel):** 1. Open the extension 2. Navigate to the Activity tab 3. Click on any transaction to open the details 4. Verify the dialog appears full-screen (same as before this PR) ## **Screenshots/Recordings** <!-- I was unable to capture before/after screenshots because the development build was not running during PR creation. The build is managed externally per repo policy. Visual verification should be performed during review using the manual testing steps above. --> ### **Before** N/A - No screenshots available (build not running during PR creation) ### **After** N/A - No screenshots available (build not running during PR creation) ## **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 (existing tests pass, no new tests needed for styling change) - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable (no new functions added) - [ ] 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. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-a5e61e3e-8ab0-5920-af69-0ce80c3b7f50?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-a5e61e3e-8ab0-5920-af69-0ce80c3b7f50&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Responsive styling and dialog UX only; no auth, routing logic, or data-handling changes beyond existing dialog open/close behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 179ee4f. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent d71a407 commit f693520

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

‎tailwind.config.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ module.exports = {
2727
white: brandColor.white,
2828
},
2929
fontSize: {}, // This removes all default Tailwind font sizes. We want to rely on the design system font sizes and enforce use of the Text component
30-
extend: {},
30+
extend: {
31+
borderRadius: {
32+
'4xl': '2rem',
33+
},
34+
},
3135
},
3236
plugins: [
3337
plugin(({ addVariant, addUtilities, addBase }) => {

‎ui/pages/activity/activity-list.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,11 @@ export function ActivityList({
235235

236236
<dialog
237237
ref={dialogRef}
238-
className="dialog-modal w-full h-dvh max-h-dvh mx-auto p-0 border-0 bg-background-default text-default"
238+
className="dialog-modal w-full h-dvh max-h-dvh mx-auto p-0 border-0 bg-background-default text-default md:max-w-[480px] md:h-auto md:max-h-[90vh] md:rounded-4xl md:border md:border-alternative open:backdrop:opacity-100 starting:open:backdrop:opacity-0 backdrop:transition-discrete backdrop:transition-all"
239239
onClose={handleClose}
240+
// @ts-expect-error closedby missing in React types
241+
// eslint-disable-next-line react/no-unknown-property -- valid on <dialog>
242+
closedby="any"
240243
>
241244
<TransactionDetails
242245
chainId={selectedItem?.chainId}

‎ui/pages/details/components/token-row.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useMemo } from 'react';
2-
import { Text } from '@metamask/design-system-react';
2+
import cn from 'clsx';
33
import type { CaipChainId } from '@metamask/utils';
44
import {
55
applyDisplaySign,
@@ -50,15 +50,15 @@ export function TokenRow({
5050
return (
5151
<div className="flex items-center gap-2">
5252
<ChainBadge chainId={chainId}>{avatar}</ChainBadge>
53-
<Text
54-
variant="heading-lg"
55-
color={
56-
token.direction === 'in' ? 'text-success-default' : 'text-default'
57-
}
53+
<h2
54+
className={cn(
55+
'text-s-heading-lg font-bold leading-8',
56+
token.direction === 'in' ? 'text-success-default' : 'text-default',
57+
)}
5858
data-testid="transaction-list-item-primary-currency"
5959
>
6060
{formattedAmount}
61-
</Text>
61+
</h2>
6262
</div>
6363
);
6464
}

0 commit comments

Comments
 (0)