Skip to content

Clear button styles - #49292

Merged
spalmesano0 merged 53 commits into
mainfrom
clear-button-styles
Jul 23, 2026
Merged

Clear button styles#49292
spalmesano0 merged 53 commits into
mainfrom
clear-button-styles

Conversation

@spalmesano0

@spalmesano0 spalmesano0 commented Jul 14, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #49276

New features

  • Added new "Secondary" (bordered, off-white fill) and "Subdued" (borderless, low-emphasis) button variants to match the Figma spec, alongside the existing Primary style.
  • Allowed rows to be selected in Controls > OS updates.

Cleanup

  • Once nothing referenced the old styles anymore, fully removed the old text-icon, brand-inverse-icon, inverse-alert, inverse, and icon button variants (type, styles, and Storybook entries) from the shared Button component.
  • Removed the iconStroke prop, which had become a no-op once the old variants it supported were gone.
  • Renamed ActionsDropdown's variants (button/brand-button/small-button) to subdued/primary/secondary to match the same naming used everywhere else.
  • Replaced a one-off dropdown implementation on the Software title page with the shared ActionsDropdown component, instead of maintaining duplicate styling logic.
  • Changed the button name on Host details > Reports > Report details from "View data for all hosts" to "View report for all hosts" (to match the previous page's Actions drop-down options).

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually
Screenshot 2026-07-21 at 06 35 49 Screenshot 2026-07-21 at 06 37 18 Screenshot 2026-07-21 at 06 37 30 Screenshot 2026-07-21 at 06 37 46 Screenshot 2026-07-22 at 07 03 22 Screenshot 2026-07-21 at 06 41 20

- Updated the styling for the shared Manage Automation, and Pagination buttons.
- Made the chevron button only appear on hover in the software table.
- Make Transfer button icon size variable.
- Fix height for DropdownWrapper and LabelFilterSelect.
- Reduce spacing between buttons in modals.
…odal

- Make view all hosts behavior a button, not a text link.
- Also updated the shared TableContainer padding.
- Also update padding in shared TableContainer.
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.40000% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.83%. Comparing base (940706c) to head (24db35f).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...ollSecrets/EnrollSecretModal/EnrollSecretModal.tsx 0.00% 6 Missing ⚠️
...dates/components/OSVersionTable/OSVersionTable.tsx 0.00% 6 Missing ⚠️
...ntend/components/TableContainer/TableContainer.tsx 0.00% 4 Missing ⚠️
frontend/components/icons/Transfer.tsx 25.00% 3 Missing ⚠️
...tSoftwareLibraryTable/HostSoftwareLibraryTable.tsx 40.00% 3 Missing ⚠️
...end/components/ActionsDropdown/ActionsDropdown.tsx 94.87% 2 Missing ⚠️
...ustomLabelGroupHeading/CustomLabelGroupHeading.tsx 0.00% 2 Missing ⚠️
frontend/components/Editor/Editor.tsx 0.00% 1 Missing ⚠️
...eContainer/DataTable/ActionButton/ActionButton.tsx 50.00% 1 Missing ⚠️
.../components/TableContainer/DataTable/DataTable.tsx 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #49292      +/-   ##
==========================================
- Coverage   67.90%   67.83%   -0.08%     
==========================================
  Files        3896     3895       -1     
  Lines      248843   247785    -1058     
  Branches    13101    13233     +132     
==========================================
- Hits       168970   168077     -893     
+ Misses      64653    64564      -89     
+ Partials    15220    15144      -76     
Flag Coverage Δ
frontend 60.30% <74.40%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

<div className={`${baseClass}__row-actions`}>
<Button
variant="icon"
variant="subdued"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would expect these buttons to be the same variant as script buttons that are also only showing on hover:

Image Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For tracking: #49823

onFileOpen: (files: FileList | null) => void;
}

const FileChooser = ({ isLoading, onFileOpen }: IFileChooserProps) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code smell, I'm pretty sure wehave FileUploader or something similar already that's reused. Wonder wh this modal gets its own... filing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

}

/** TODO: Legacy component, should be replaced with newer FileUploader */
const FileChooser = ({ isLoading, onFileOpen }: IFileChooserProps) => (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same code smell

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

&__actions {
display: flex;
align-items: center;
gap: $pad-medium;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

$pad-small plz <3

@@ -67,7 +67,7 @@ const generateTableHeaders = ({
return (
<div className="global-variables__token">
<TextCell value={token} />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Out of scope, I noticed this has no TooltipTruncation, just truncation. Filing bug.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

onClick: onEnablePackClick,
buttonText: "Enable",
variant: "inverse",
variant: "secondary",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will need 8px gap, and use gap instead of margin-right

Image

value={
<>
{slug} <CopyButton copyText={slug} variant="compact" />
{slug} <CopyButton copyText={slug} variant="subdued" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Image

it needs to be size small since this pushes the layout

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For tracking: #49822

disabledTooltipContent?: React.ReactNode;
onClick?: (evt: React.MouseEvent<HTMLButtonElement>) => void;
/** Default: "secondary" */
variant?: "secondary" | "subdued";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Zero call sites pass variant="subdued". The "subdued" branch of the union type in RevealButton.tsx:19 is dead.

Two cleanup options if you want to file it (either as part of the button-variants cleanup or its own quick-win):

  1. Drop the variant prop entirely from RevealButton — hardcode variant="secondary" inside, delete the union type, delete every redundant
    variant="secondary" at call sites.
  2. Keep the prop, delete the redundant variant="secondary" spam at call sites — leaves "subdued" available if someone ever needs it.

<br />
<Button
variant="inverse"
variant="secondary"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Image

This now needs a gap

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch, I wasn't able to view that page. I noticed the same thing and made a fix for this modal though (not sure if we need to apply it per-instance or if we can set up a rule globally):

Screenshot 2026-07-23 at 07 05 22

// CSS `:focus-visible` (even via `:has(input:focus-visible)`) fires on a
// mouse click as well as Tab, because browsers always treat a focused text
// input as focus-visible. customStyles tracks the last input method itself
// (see isKeyboardFocus in ActionsDropdown.tsx) to tell them apart.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

actions-dropdown focus visible looks thicker than button focus visible

Searched for 5 patterns, read 2 files (ctrl+o to expand)

⏺ You're right — they're both "1px" but they render differently. Two mechanisms in play:

Button (_styles.scss:11-20, button-focus-outline mixin):
&::after {
content: "";
width: 100%; height: 100%;
position: absolute;
border: 1px solid $core-focused-outline;
border-radius: $border-radius;
}
A pseudo-element sitting inside the button's footprint (no offset). At the rounded corners it's clipped/anti-aliased against the button's own edge, so
the stroke reads as a soft, thin line — some of that pixel gets absorbed into the button's own border-pixel.

ActionsDropdown (ActionsDropdown.tsx:280-283):
boxShadow: 0 0 0 1px ${COLORS["core-fleet-black"]},
A spread shadow drawn 1px outside the control's outer edge. No offset, no blur — a fully-rendered pixel-perfect halo on the page background. No
anti-aliasing softness, no border-radius eating into it.

Same color ($core-focused-outline resolves to core-fleet-black, matches the ActionsDropdown value), same nominal 1px — but outside-with-full-contrast
vs. inside-with-corner-clip always reads bolder.

Extra bump on variant="secondary": the control already has border: 1px solid ui-fleet-black-25 (line 247). When focus fires, the 1px black box-shadow
sits immediately outside that grey border → visually stacks as ~2px (grey + black bands touching).

Screen.Recording.2026-07-22.at.2.45.36.PM.mov

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wow, good catch. I had a lot of difficulties with that ActionsDropdown! 😅

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For tracking: #49820

@RachelElysia RachelElysia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for all this! I only got to confirm/test about half the changes. Feeling pretty confident about the majority of all this! Approving with the understanding that @spalmesano0 will followup with a second PR for button gaps and any other nits I already flagged in this PR. <3

@spalmesano0

Copy link
Copy Markdown
Member Author

@RachelElysia Thank you for that huge review! I'll be on PTO for a while, but I'll definitely follow up on all of this when I get back.

@spalmesano0
spalmesano0 merged commit 62ed358 into main Jul 23, 2026
25 checks passed
@spalmesano0
spalmesano0 deleted the clear-button-styles branch July 23, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to new button styles

5 participants