Skip to content

Fleet UI: Clean up empty enroll secret bugs#43233

Merged
RachelElysia merged 3 commits intomainfrom
0000-secret-styling
Apr 9, 2026
Merged

Fleet UI: Clean up empty enroll secret bugs#43233
RachelElysia merged 3 commits intomainfrom
0000-secret-styling

Conversation

@RachelElysia
Copy link
Copy Markdown
Member

Issue

Closes #43232

Description

  • Fix margin
  • Turn to link with underline
  • Turn to link with underline

Screenrecording

Screen.Recording.2026-04-08.at.10.32.13.AM.mov

Testing

  • QA'd all new/changed functionality manually

@RachelElysia RachelElysia requested a review from a team as a code owner April 8, 2026 14:46
Copilot AI review requested due to automatic review settings April 8, 2026 14:46
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

padding: 7px $pad-medium;
margin: $pad-large 0 0 44px;
}

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.

unused code

title="Manage enroll secrets"
className={baseClass}
>
<div className={`${baseClass} form`}>
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.

just moved the form div into the ternary, that's what was styling the empty state to be 100% width + its padding made the empty state overflow

margin: $pad-medium 0 0 0;
}

pre,
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.

unused

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses UI styling issues around the “no enroll secrets” empty states by adjusting layout and replacing button/plain-text CTAs with underlined link-style actions.

Changes:

  • Replace “Manage enroll secrets” CTAs with CustomLink in the Hosts page banner and Add Hosts modal.
  • Refactor EnrollSecretModal rendering to better handle empty vs. non-empty secrets layouts.
  • Remove unused pre/code styling blocks from enroll secrets modal SCSS.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx Converts the no-enroll-secrets InfoBanner CTA into a clickable CustomLink.
frontend/components/AddHostsModal/AddHostsModal.tsx Replaces the “Manage enroll secrets” button with CustomLink in the missing-secret error state.
frontend/components/EnrollSecrets/EnrollSecretModal/EnrollSecretModal.tsx Reorganizes modal structure to improve empty-state layout and spacing.
frontend/components/EnrollSecrets/EnrollSecretModal/_styles.scss Removes unused pre/code styling from the enroll secret modal styles.
frontend/components/EnrollSecrets/SecretEditorModal/_styles.scss Removes unused pre/code styling from the secret editor modal styles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1939 to +1942
<CustomLink
customClickHandler={() => setShowEnrollSecretModal(true)}
text="Manage enroll secrets"
/>{" "}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

CustomLink renders an <a href={url}>. In this new usage no url is provided, so the anchor can be rendered without an href, which is typically not announced as a link by screen readers and can behave inconsistently for keyboard users. Consider either providing a real url (and navigate to enroll secret management), or switching to a semantic button styled as a link / updating CustomLink usage to include appropriate href/role when it only opens a modal.

Suggested change
<CustomLink
customClickHandler={() => setShowEnrollSecretModal(true)}
text="Manage enroll secrets"
/>{" "}
<button
type="button"
onClick={() => setShowEnrollSecretModal(true)}
style={{
background: "none",
border: 0,
padding: 0,
margin: 0,
color: "inherit",
textDecoration: "underline",
cursor: "pointer",
font: "inherit",
}}
>
Manage enroll secrets
</button>{" "}

Copilot uses AI. Check for mistakes.
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.

CustomLink with no href is the only way we currently can get that underline like a link styling with a custom onclick. Maybe we can revisit with agentic programming to get a button to do the underline transition on hover in a future iteration.

Comment on lines 62 to +66
{openEnrollSecretModal ? (
<Button onClick={onManageEnrollSecretsClick} variant="inverse">
Manage enroll secrets
</Button>
<CustomLink
customClickHandler={onManageEnrollSecretsClick}
text="Manage enroll secrets"
/>
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

CustomLink renders an <a href={url}>, but this usage doesn’t pass a url. Anchors without href are usually not treated as links by assistive tech, even if they’re clickable. Consider passing a real url (or adjusting the component/usage to render a semantic button when it’s an in-app action that opens a modal).

Copilot uses AI. Check for mistakes.
@RachelElysia RachelElysia marked this pull request as draft April 8, 2026 18:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.85%. Comparing base (99b0241) to head (a9be14a).
⚠️ Report is 82 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #43233   +/-   ##
=======================================
  Coverage   66.85%   66.85%           
=======================================
  Files        2581     2583    +2     
  Lines      206985   207065   +80     
  Branches     9259     9290   +31     
=======================================
+ Hits       138373   138427   +54     
- Misses      56042    56069   +27     
+ Partials    12570    12569    -1     
Flag Coverage Δ
frontend 54.79% <100.00%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@RachelElysia RachelElysia marked this pull request as ready for review April 8, 2026 20:14
@RachelElysia RachelElysia merged commit 7b90f2d into main Apr 9, 2026
19 checks passed
@RachelElysia RachelElysia deleted the 0000-secret-styling branch April 9, 2026 15:04
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.

Fleet UI: No enroll secret styling bugs

3 participants