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

refactor: [M3-9431] [Akamai Design System] Radio Button Component #11878

Conversation

bill-akamai
Copy link
Contributor

@bill-akamai bill-akamai commented Mar 18, 2025

Description 📝

This PR updates the Radio Button component to conform to the Akamai Design System specifications.

Changes 🔄

  • Implemented Akamai Design System radio button theme tokens
  • Updated colors, spacing, SVGs, etc to match design specs

Preview 📷

Before After

Verification steps

  • Open Cloud Manager, navigate to different views
  • Confirm radio button design matches ADS specs (check different states)
  • Also check if Dark Mode theme looks correct
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

Sorry, something went wrong.

@bill-akamai bill-akamai added the Design Tokens Laying the groundwork for Design Tokens label Mar 18, 2025
@bill-akamai bill-akamai force-pushed the M3-9431-akamai-design-system-radio-button-component branch from 9064908 to 50e483a Compare March 18, 2025 19:30
@bill-akamai bill-akamai marked this pull request as ready for review March 18, 2025 19:31
@bill-akamai bill-akamai requested a review from a team as a code owner March 18, 2025 19:31
@bill-akamai bill-akamai requested review from hana-akamai and abailly-akamai and removed request for a team March 18, 2025 19:31
'& $checked': {
color: primaryColors.main,
'&:active': {
color: theme.tokens.radio.Active.Active.Border,
Copy link
Contributor Author

@bill-akamai bill-akamai Mar 18, 2025

Choose a reason for hiding this comment

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

It can be a little confusing, but Border is the correct property to use here for color (confirmed with Design). Some aspects of the radio button needed additional handling with Color.Neutrals.

Copy link

Coverage Report:
Base Coverage: 79.96%
Current Coverage: 79.96%

@abailly-akamai
Copy link
Contributor

abailly-akamai commented Mar 19, 2025

@bill-akamai I believe those e2e failures are relevant to these changes. You may have to adjust a few things in those tests (or the ui util) - please let me know if you need help with this!

edit: maybe only some of them - I see some firewall tests failing on other PRs

@abailly-akamai
Copy link
Contributor

@bill-akamai you also need to address the changes made to our tokens by rebasing/merging this PR with develop

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…-component
@bill-akamai
Copy link
Contributor Author

bill-akamai commented Mar 20, 2025

@bill-akamai I believe those e2e failures are relevant to these changes. You may have to adjust a few things in those tests (or the ui util) - please let me know if you need help with this!

edit: maybe only some of them - I see some firewall tests failing on other PRs

@abailly-akamai I was able to get these to pass (locally) by adding a longer timeout to the Boots a config test in linode-config.spec.ts:

    it('Boots a config', () => {
      cy.defer(
        () =>
          createLinodeAndGetConfig(
            { booted: true },
            { securityMethod: 'vlan_no_internet', waitForBoot: true },
          ),
          {
            label: 'Creating and booting test Linode',
            timeout: 120000 
          }
      )

Should we make this change in a separate PR?

@abailly-akamai
Copy link
Contributor

@bill-akamai if that's unrelated to your PR then we should probably let @jdamore-linode handle it 👍

Will review!

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Great work! clean code and accurate usage of tokens. 🥇

Confirmed styles and behavior of Radios in app and storybook, both light and dark themes. ✅

Copy link
Contributor

@hana-akamai hana-akamai left a comment

Choose a reason for hiding this comment

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

It seems like the radio icons are slightly larger in dark mode (also existing issue in dev) - not sure if this is intentional 🤔

Preview
Screen.Recording.2025-03-21.at.2.32.27.PM.mov

@bill-akamai
Copy link
Contributor Author

It seems like the radio icons are slightly larger in dark mode (also existing issue in dev) - not sure if this is intentional 🤔

Preview
Screen.Recording.2025-03-21.at.2.32.27.PM.mov

Great pick up @hana-akamai - just addressed this.

Copy link
Contributor

@hana-akamai hana-akamai left a comment

Choose a reason for hiding this comment

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

Input size is also slightly different in dark mode but looks good otherwise!

Preview
Screen.Recording.2025-03-21.at.3.39.31.PM.mov

@hana-akamai hana-akamai added the Approved Multiple approvals and ready to merge! label Mar 21, 2025
'.MuiSvgIcon-fontSizeMedium': {
fontSize: '20px',
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think setting the size in light.ts will apply to both

dark.ts inherits light.ts defaults via deep merge (dark.ts is basically an override)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hana-akamai input size updated, thanks!
@abailly-akamai something might be incorrect in our implementation here. I had to explicitly add the adjustments in dark.ts to see that change take effect. The deep merge doesn't seem to be carrying over all style properties as expected. I'll look to see why.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see. Maybe something has changed recently. perhaps @jaalah-akamai has input?

I still find the theme setup quite mysterious in many aspects

Copy link
Contributor Author

@bill-akamai bill-akamai Mar 21, 2025

Choose a reason for hiding this comment

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

@abailly-akamai I'm a bit new to this setup myself but I've found that the theme inheritance works differently based on how styles are defined. Static styles defined as objects (like MuiSvgIcon) get inherited between themes, but functional styles (like the MuiRadio styles that use ({ theme }) => ({})) don't do this inheritance. So no prob when light.ts defines the shared style as the static object but the functional styles would need a shared constant or utility function to avoid duplication if I'm understanding things correctly.

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 1 failing test on test run #9 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
1 Failing539 Passing3 Skipped132m 51s

Details

Failing Tests
SpecTest
linode-config.spec.tsEnd-to-End » Clones a config

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/linodes/linode-config.spec.ts"

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…-component
@bill-akamai bill-akamai merged commit 3b2ee22 into linode:develop Mar 24, 2025
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Design Tokens Laying the groundwork for Design Tokens
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants