Skip to content
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(28081): design tweak for network badge #29324

Merged
merged 8 commits into from
Dec 20, 2024
Merged

Conversation

DDDDDanica
Copy link
Contributor

@DDDDDanica DDDDDanica commented Dec 18, 2024

Description

This PR address feedback from design quality check to tweak board color and width for network badge.

Open in GitHub Codespaces

Related issues

Fixes: #28081

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

See PR for related changes

After

See PR for related changes

Pre-merge author checklist

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.

@DDDDDanica DDDDDanica added team-design-system All issues relating to design system in Extension team-extension-platform team-wallet-ux labels Dec 18, 2024
@DDDDDanica DDDDDanica self-assigned this Dec 18, 2024
@DDDDDanica DDDDDanica requested a review from a team as a code owner December 18, 2024 15:33
Copy link
Contributor

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.

Comment on lines +286 to +287
backgroundColor={BackgroundColor.backgroundDefault}
borderWidth={2}
Copy link
Contributor Author

@DDDDDanica DDDDDanica Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
Screenshot 2024-12-18 at 13 11 18

After:
Screenshot 2024-12-18 at 13 40 01

CSS breakdown:
Screenshot 2024-12-18 at 13 20 28

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @DDDDDanica, should the before and after images be swapped? For example, should the 2px border be after and the 1px border be before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot ! switched 🙏🏻

@@ -74,7 +74,7 @@ export const BadgeStatus: React.FC<BadgeStatusProps> = ({
backgroundColor={badgeBackgroundColor}
borderRadius={BorderRadius.full}
borderColor={badgeBorderColor}
borderWidth={isConnectedAndNotActive ? 2 : 4}
borderWidth={2}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
Screenshot 2024-12-18 at 15 29 05

After:
Screenshot 2024-12-18 at 15 08 14

Copy link
Contributor

@georgewrmarshall georgewrmarshall Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated so now the background color of the badge matches the header icon

Before

Screenshot 2024-12-19 at 7 54 10 AMScreenshot 2024-12-19 at 7 54 25 AM

After

Screenshot 2024-12-19 at 7 41 54 AMScreenshot 2024-12-19 at 7 42 08 AM

@@ -90,7 +90,7 @@ export const ConnectedSiteMenu = ({
? BorderColor.successDefault
: BackgroundColor.backgroundDefault
}
borderWidth={isConnectedtoOtherAccountOrSnap ? 2 : 3}
borderWidth={2}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before (not connected):
Screenshot 2024-12-18 at 15 41 03

After (not connected):
Screenshot 2024-12-18 at 15 39 32

Before (connected):
Screenshot 2024-12-18 at 15 41 21

After (connected)
Screenshot 2024-12-18 at 15 39 17
:

@@ -62,7 +62,7 @@ import {
getMultichainShouldShowFiat,
} from '../../../selectors/multichain';
import { useMultichainAccountTotalFiatBalance } from '../../../hooks/useMultichainAccountTotalFiatBalance';
import { ConnectedStatus } from '../connected-status/connected-status';
import { ConnectedStatus } from '../connected-status';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path simplification

@DDDDDanica DDDDDanica force-pushed the fix/28081-design-tweak branch from 2311b79 to 1061690 Compare December 18, 2024 15:55
@DDDDDanica DDDDDanica requested review from a team as code owners December 18, 2024 15:55
@metamaskbot
Copy link
Collaborator

Builds ready [1061690]
Page Load Metrics (1747 ± 68 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15392148175015172
domContentLoaded15292066171013967
load15412106174714168
domInteractive2584452110
backgroundConnect1081372110
firstReactRender157029199
getState565202010
initialActions01000
loadScripts11251582128712058
setupStore67014178
uiStartup17732378198415775
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -61 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@DDDDDanica DDDDDanica force-pushed the fix/28081-design-tweak branch from 1061690 to 573e5a7 Compare December 18, 2024 18:23
@metamaskbot
Copy link
Collaborator

Builds ready [573e5a7]
Page Load Metrics (1862 ± 212 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27433611805560269
domContentLoaded147933351835445214
load149633631862442212
domInteractive23141553316
backgroundConnect984292110
firstReactRender1695492512
getState592172211
initialActions01000
loadScripts105826301380379182
setupStore774182110
uiStartup166040082147545262
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -61 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🔥 I made some small updates hope that is ok!

@@ -476,7 +476,7 @@ exports[`SnapUIAddress renders legacy Ethereum address 1`] = `
<rect
fill="#F29602"
height="32"
transform="translate(-2.81750896228304 4.951916544006229) rotate(230.4 16 16)"
transform="translate(-2.8175089622830405 4.951916544006229) rotate(230.4 16 16)"
width="32"
x="0"
y="0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that these snapshots update regardless of changes not sure if we want to include them or not 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found similar thing in weird svg snapshot failure, FAIL ui/components/multichain/connect-accounts-modal/connect-accounts-modal.test.tsx (5.461 s), and this one only failed in github actions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to manually applying those snapshot changes locally and see how it goes 🙇🏻‍♀️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed: c27d151

@@ -42,7 +42,7 @@ export const DefaultStory = Template.bind({});

export const NotConnectedStory = Template.bind({});
NotConnectedStory.args = {
badgeBackgroundColor: Color.borderMuted,
badgeBackgroundColor: BackgroundColor.iconAlternative,
Copy link
Contributor

@georgewrmarshall georgewrmarshall Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before

Screenshot 2024-12-19 at 7 53 05 AM

After

Screenshot 2024-12-19 at 7 40 20 AM

@@ -74,7 +74,7 @@ export const BadgeStatus: React.FC<BadgeStatusProps> = ({
backgroundColor={badgeBackgroundColor}
borderRadius={BorderRadius.full}
borderColor={badgeBorderColor}
borderWidth={isConnectedAndNotActive ? 2 : 4}
borderWidth={2}
Copy link
Contributor

@georgewrmarshall georgewrmarshall Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated so now the background color of the badge matches the header icon

Before

Screenshot 2024-12-19 at 7 54 10 AMScreenshot 2024-12-19 at 7 54 25 AM

After

Screenshot 2024-12-19 at 7 41 54 AMScreenshot 2024-12-19 at 7 42 08 AM

let badgeBackgroundColor = Color.borderMuted; // //TODO: Replace it once Background color has this value.
let badgeBorderColor = BorderColor.backgroundDefault; // TODO: Replace it once border-color has this value.
let badgeBackgroundColor = BackgroundColor.iconAlternative;
Copy link
Contributor

@georgewrmarshall georgewrmarshall Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We recently updated border muted to be transparent which is why the UI looked "broken" I've updated it to use icon/alternative. This also matches Figma

Screenshot 2024-12-19 at 7 41 54 AMScreenshot 2024-12-19 at 7 42 08 AM
Screenshot 2024-12-19 at 7 43 48 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks George ! that makes sense !

@@ -43,6 +43,7 @@ const DetectedTokenDetails = ({
src={CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP[chainId]}
name={currentNetwork?.nickname || ''}
backgroundColor={testNetworkBackgroundColor}
borderWidth={2}
Copy link
Contributor

@georgewrmarshall georgewrmarshall Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before

Screenshot 2024-12-19 at 7 56 19 AM

After

Screenshot 2024-12-19 at 7 48 02 AM

Comment on lines +286 to +287
backgroundColor={BackgroundColor.backgroundDefault}
borderWidth={2}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @DDDDDanica, should the before and after images be swapped? For example, should the 2px border be after and the 1px border be before?

@DDDDDanica DDDDDanica force-pushed the fix/28081-design-tweak branch 2 times, most recently from a8ccba3 to d224ed3 Compare December 19, 2024 03:10
@DDDDDanica DDDDDanica force-pushed the fix/28081-design-tweak branch from d224ed3 to a2d9da4 Compare December 19, 2024 03:11
@metamaskbot
Copy link
Collaborator

Builds ready [c27d151]
Page Load Metrics (1515 ± 59 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint39717831459274131
domContentLoaded13281776149612158
load13361783151512459
domInteractive21172513517
backgroundConnect85320136
firstReactRender1572342311
getState44512136
initialActions01000
loadScripts9501383111411354
setupStore58710
uiStartup15262001171514067
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -45 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@dbrans dbrans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@DDDDDanica DDDDDanica enabled auto-merge December 20, 2024 14:47
Copy link
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DDDDDanica DDDDDanica added this pull request to the merge queue Dec 20, 2024
@DDDDDanica DDDDDanica removed this pull request from the merge queue due to a manual request Dec 20, 2024
@DDDDDanica DDDDDanica enabled auto-merge December 20, 2024 15:29
@metamaskbot
Copy link
Collaborator

Builds ready [b7f2147]
Page Load Metrics (1880 ± 66 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15582132188313766
domContentLoaded15472121186113766
load15572135188013766
domInteractive27233514421
backgroundConnect97122178
firstReactRender1878472512
getState65013136
initialActions01000
loadScripts11261592139011053
setupStore75820189
uiStartup18292446215613666
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -45 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@DDDDDanica DDDDDanica added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 36f084c Dec 20, 2024
77 checks passed
@DDDDDanica DDDDDanica deleted the fix/28081-design-tweak branch December 20, 2024 16:09
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2024
@metamaskbot metamaskbot added the release-12.11.0 Issue or pull request that will be included in release 12.11.0 label Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.11.0 Issue or pull request that will be included in release 12.11.0 team-design-system All issues relating to design system in Extension team-extension-platform team-wallet-ux
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Design quality]: Update border weight and color for networks and status badges
6 participants