Skip to content

Conversation

@jaalah-akamai
Copy link
Contributor

@jaalah-akamai jaalah-akamai commented Mar 7, 2025

Description 📝

Update the search field components (DebouncedSearchTextField) to conform to the new Akamai Design System specifications. This includes standard inputs, adornments, and all relevant states. This PR prioritizes DebouncedSearchTextField, with other component modifications resulting from necessary adjustments to the broader MuiInputBase theme.

Note

Both Autocomplete and TextField components inherit from the same underlying components: MuiInputBase and MuiInputAdornment. I've consolidated the core styling in these shared components to minimize duplication. For component-specific styling, use the dedicated theme overrides: MuiAutocomplete and MuiTextField.

Changes 🔄

Foundations

  • MuiInputAdornment: Both TextField and Autocomplete use identical adornment components, which should maintain 20×20 pixel dimensions, with the sole exception of the clear/close icon which requires a smaller 16×16 pixel size.
  • MuiInputBase: Contains core input styling for both TextField and Autocomplete for all relevant component states.
  • MuiOutlinedInput: Removed since this was unused along with other dead styles.

Components

  • Autocomplete: New ChevronDownIcon and reduced adornment size
  • DebouncedSearchTextField:
    • InputProps is deprecated; changed to slotProps and using inputSlotProps for the component prop.
    • Ensure InputAdornment is being used for all adornments
    • New close and search icons
    • Removed styled components
  • StrengthIndicator: Fixed a minor spacing regression from the MUIv6 update affecting the grid-wrapped strength indicator divs. All elements have been properly centered for consistent alignment.
  • HideShowText: InputProps is deprecated; changed to slotProps
  • AlgoliaSearchBar: Cleanup - styles handled by theme
  • SearchBar: A unique implementation of our search (Autocomplete) with custom styling and options container. It will require further cleanup/refactoring at another time.

Target release date 🗓️

3/25

Preview 📷

Just a sample - there are lots of instances

Before After
cloud linode com_linodes_create (1) Screenshot 2025-03-07 at 10 30 27 PM
cloud linode com_linodes_create Screenshot 2025-03-07 at 10 30 19 PM

How to test 🧪

  1. See ticket details for figma files for various states
  2. There will definitely be one-off styles in various components, the goal is to find them.

Verification steps

  • Anywhere we're using TextFields or Autocompletes
  • Ensure Autocomplete component height can expand when multiple options are selected
  • Check both light/dark mode
  • Check Top Menu search
  • Check Algolia search on Support landing
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

@jaalah-akamai jaalah-akamai added the Design Tokens Laying the groundwork for Design Tokens label Mar 7, 2025
@jaalah-akamai jaalah-akamai self-assigned this Mar 7, 2025
@jaalah-akamai jaalah-akamai changed the title change: [M3-9432] - Theme changes to InputBase (DebounceSearchTextField, Autocomplete, TextField) refactor: [M3-9432] - Theme changes to InputBase (DebounceSearchTextField, Autocomplete, TextField) Mar 8, 2025
@jaalah-akamai jaalah-akamai changed the title refactor: [M3-9432] - Theme changes to InputBase (DebounceSearchTextField, Autocomplete, TextField) change: [M3-9432] - Theme changes to InputBase (DebounceSearchTextField, Autocomplete, TextField) Mar 8, 2025
export const DebouncedSearchTextField = React.memo(
(props: DebouncedSearchProps) => {
const {
InputProps,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deprecated - using slotProps

pr={2}
top={1}
/>
<InputAdornment position="start">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When using adornments, let's ensure we use InputAdornment to wrap things for proper theme-level styling.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we create a ticket for this? Found several adornments not wrapped in InputAdornment in the codebase:

  • CopyableTextField
  • RegionSelect
  • DatabaseEngineSelect
  • StackScriptLandingTable

[theme.breakpoints.down('sm')]: {
textAlign: 'center',
},
top: 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.

Removed since alignItems: 'center' made more sense.

color: theme.tokens.header.Search.Text.Placeholder,
fontStyle: 'italic',
slotProps={{
htmlInput: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

slotProps.htmlInput is the equivalent of inputProps
slotProps.input is the equivalent of InputProps
slots.paper is the equivalent of PaperComponent

Comment on lines +371 to +385
sx: {
'&:active, &:focus, &.Mui-focused, &.Mui-focused:hover': {
backgroundColor: theme.tokens.header.Search.Background,
borderColor: theme.tokens.header.Search.Border.Active,
color: theme.tokens.header.Search.Text.Filled,
},
'&:hover': {
backgroundColor: theme.tokens.header.Search.Background,
borderColor: theme.tokens.header.Search.Border.Hover,
color: theme.tokens.header.Search.Text.Filled,
},
backgroundColor: theme.tokens.header.Search.Background,
borderColor: theme.tokens.header.Search.Border.Default,
color: theme.tokens.header.Search.Text.Filled,
maxWidth: '100%',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As noted in the description, the Top Menu search represents a unique styling implementation. While we can revisit this later, these modifications effectively serve as theme overrides.

@jaalah-akamai jaalah-akamai marked this pull request as ready for review March 10, 2025 13:58
@jaalah-akamai jaalah-akamai requested a review from a team as a code owner March 10, 2025 13:58
@jaalah-akamai jaalah-akamai requested review from cpathipa and hkhalil-akamai and removed request for a team March 10, 2025 13:58
Copy link
Contributor

@hkhalil-akamai hkhalil-akamai left a comment

Choose a reason for hiding this comment

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

TextFields and Autocompletes across the app look as expected in light and dark mode
✅ Input adornments appearing as expected
✅ Tested multiple variations of the above components as well as LinodeSelect and RegionSelect in storybook -- verified these match the Figma mockups

pr={2}
top={1}
/>
<InputAdornment position="start">
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we create a ticket for this? Found several adornments not wrapped in InputAdornment in the codebase:

  • CopyableTextField
  • RegionSelect
  • DatabaseEngineSelect
  • StackScriptLandingTable

@hkhalil-akamai hkhalil-akamai added the Add'tl Approval Needed Waiting on another approval! label Mar 11, 2025
@jaalah-akamai
Copy link
Contributor Author

@hkhalil-akamai Yes those will need to be updated. Since there's no serious regressions with most of those, I'll tackle in a follow-up.

@github-actions
Copy link

github-actions bot commented Mar 12, 2025

Coverage Report:
Base Coverage: 79.82%
Current Coverage: 79.81%

Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

The Autocomplete Loading state is a bit broken

Screen.Recording.2025-03-12.at.5.22.13.PM.mov

@bnussman-akamai
Copy link
Member

The spinner is still a bit wonky.

Screen.Recording.2025-03-13.at.7.53.02.PM.mov

I wonder if we should remove this or change the CSS selector to apply to any child (.MuiInputAdornment-positionEnd > *) other than svgs. Looks like the MUI spinner is wrapped in a span for whatever reason

Screenshot 2025-03-13 at 7 58 38 PM

@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager Mar 14, 2025
@cpathipa cpathipa added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Mar 14, 2025
Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for fixing that loading state issue 🙏

Not blocking: The endAdornment icons are much smaller now (and closer together) which makes them seem a bit harder to click/press

@jaalah-akamai
Copy link
Contributor Author

jaalah-akamai commented Mar 17, 2025

Yea the icons only have 4px padding between them and have been reduced in size by design. I will most likely be revisiting this in follow-ups as I have discussions with the UX team. I'll continue to do refinements as I tackle TextField next which is related to this.

Edit: The down chevron icon needed to be replaced in the UI package. It's still smaller, but larger than is was 16px > 20px (still a reduction from the 28px that it was)

@jaalah-akamai
Copy link
Contributor Author

These tests appear somewhat flaky. All pass except Clone Linode, which I'm looking into.

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 2 failing tests on test run #16 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
2 Failing537 Passing3 Skipped121m 41s

Details

Failing Tests
SpecTest
google-pay.spec.tsGoogle Pay » adds google pay method
google-pay.spec.tsGoogle Pay » tests make payment flow - google pay

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/billing/google-pay.spec.ts"

@jaalah-akamai jaalah-akamai merged commit 4d5ed8b into linode:develop Mar 17, 2025
26 of 27 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager Mar 17, 2025
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 Ready for Review

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants