Skip to content

Fleet UI: Fix empty button boxes in batch run script modal - #49997

Merged
RachelElysia merged 2 commits into
mainfrom
49879-batch-run-script-empty-button
Jul 27, 2026
Merged

Fleet UI: Fix empty button boxes in batch run script modal#49997
RachelElysia merged 2 commits into
mainfrom
49879-batch-run-script-empty-button

Conversation

@RachelElysia

@RachelElysia RachelElysia commented Jul 27, 2026

Copy link
Copy Markdown
Member

Issue

Resolves #49879

Description

  • Bug fix (root cause): Clear button styles #49292 swapped the row's Run script button from variant="inverse" (transparent) to variant="secondary" (bordered + off-white fill), but the local hover-reveal CSS only faded .children-wrapper. The new border/fill stayed fully visible → empty button box on every row.
  • Reworked to use a shared .row-hover-button class scoped under .paginated-list__row in PaginatedList/_styles.scss — mirrors the tr .row-hover-button pattern already used in TableContainer/_styles.scss. Fades the whole button (border + fill + children) and reveals on row hover + button :focus-visible.
  • Deleted the local hover CSS in RunScriptBatchPaginatedList/_styles.scss.
  • Prevention: added a comment on Button's .children-wrapper warning against the anti-pattern, and documented .row-hover-button as the canonical hover-reveal in .claude/rules/fleet-frontend.md.

Screenrecording

Screen.Recording.2026-07-27.at.10.02.39.AM.mov

Testing

  • yarn lint — 0 errors in touched files
  • npx prettier --check — clean
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • New Features

    • Row-level actions now appear when a row is hovered or when the action receives keyboard focus.
    • Improved keyboard accessibility by ensuring focused actions are visible and interactive.
  • Bug Fixes

    • Hidden row actions no longer intercept mouse or touch interactions.
    • Preserved reliable interaction behavior for action menus and loading states.

Resolves #49879. #49292 swapped the row's Run script button from the
transparent `inverse` variant to the bordered `secondary` variant, but
the local hover-reveal CSS only faded `.children-wrapper` — leaving the
new border + off-white fill visible on every row.

Reworked the reveal to use a shared `.row-hover-button` class in
`PaginatedList/_styles.scss` (mirrors the `TableContainer` pattern for
`tr`), added a comment on `Button`'s `.children-wrapper` warning
against the anti-pattern, and documented the convention in
`.claude/rules/fleet-frontend.md`.
Copilot AI review requested due to automatic review settings July 27, 2026 17:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the “empty button box” hover artifact in the batch Run script modal by switching the row-hover reveal behavior to fade the entire button (including border/fill), and centralizing the pattern in shared list/table styling.

Changes:

  • Add className="row-hover-button" to the batch run script row action button.
  • Remove the local hover CSS that only faded Button’s .children-wrapper, and add shared .row-hover-button hover/focus-visible rules under PaginatedList rows.
  • Document the anti-pattern in Button styles and codify the canonical approach in .claude/rules/fleet-frontend.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/pages/hosts/ManageHostsPage/components/RunScriptBatchPaginatedList/RunScriptBatchPaginatedList.tsx Applies the shared hover-reveal utility class to the per-row Run script button.
frontend/pages/hosts/ManageHostsPage/components/RunScriptBatchPaginatedList/_styles.scss Removes the local hover/fade implementation that only affected .children-wrapper.
frontend/components/PaginatedList/_styles.scss Introduces the shared .row-hover-button fade + reveal behavior for paginated list rows.
frontend/components/buttons/Button/_styles.scss Adds guidance discouraging fading .children-wrapper for hover-reveal actions.
.claude/rules/fleet-frontend.md Documents .row-hover-button as the canonical row hover-reveal pattern for tables and paginated lists.

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

Comment on lines +75 to +86
// Fade the entire button (border + fill + children), not just its children,
// so bordered/filled variants like `secondary` don't leave an empty box behind.
.row-hover-button {
opacity: 0;
transition: opacity 250ms;

// Reveal on the button's own keyboard focus, not just row hover —
// otherwise tabbing to a hidden row-hover button never shows it.
&:focus-visible {
opacity: 1;
}
}

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.

ok, sounds good

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.95%. Comparing base (8d2a2d1) to head (59e27ab).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #49997   +/-   ##
=======================================
  Coverage   67.95%   67.95%           
=======================================
  Files        3922     3922           
  Lines      250011   250012    +1     
  Branches    13336    13337    +1     
=======================================
+ Hits       169888   169894    +6     
+ Misses      64829    64824    -5     
  Partials    15294    15294           
Flag Coverage Δ
frontend 60.41% <ø> (+0.01%) ⬆️

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.

`.row-hover-button` fades via `opacity: 0`, but the hidden button still
receives pointer events and can intercept row clicks (a real hazard on
touch devices where there is no `:hover`). Set `pointer-events: none`
while hidden and restore `auto` on row `:hover` / button
`:focus-visible`; tab navigation is unaffected because pointer-events
only gates mouse/touch, not keyboard focus. Kept `.actions-dropdown`
hit-testable so react-select's keyboard-nav bookkeeping still works.
Copilot AI review requested due to automatic review settings July 27, 2026 19:47
@RachelElysia
RachelElysia marked this pull request as ready for review July 27, 2026 19:48
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f9bcb9e9-8884-4e5e-9023-2b64524c20f3

📥 Commits

Reviewing files that changed from the base of the PR and between 958fe8b and 59e27ab.

⛔ Files ignored due to path filters (1)
  • .claude/rules/fleet-frontend.md is excluded by !**/*.md
📒 Files selected for processing (5)
  • frontend/components/PaginatedList/_styles.scss
  • frontend/components/TableContainer/_styles.scss
  • frontend/components/buttons/Button/_styles.scss
  • frontend/pages/hosts/ManageHostsPage/components/RunScriptBatchPaginatedList/RunScriptBatchPaginatedList.tsx
  • frontend/pages/hosts/ManageHostsPage/components/RunScriptBatchPaginatedList/_styles.scss
💤 Files with no reviewable changes (1)
  • frontend/pages/hosts/ManageHostsPage/components/RunScriptBatchPaginatedList/_styles.scss

Walkthrough

Added shared styling that hides row action buttons by default, disables pointer interaction while hidden, and reveals them on row hover or keyboard focus. Table dropdown actions remain pointer-interactive. Batch script row buttons now use the shared styling class, replacing component-specific opacity rules. Added documentation comments for button child-wrapper behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the batch run script modal button-box fix reflected in the changeset.
Description check ✅ Passed The description includes the issue, fix summary, and testing notes; only optional checklist items are omitted.
Linked Issues check ✅ Passed The changes address #49879 by hiding the full button, revealing it on hover/focus, and applying the shared row-hover-button class.
Out of Scope Changes check ✅ Passed The added style and comment changes support the same hover-reveal fix and do not introduce unrelated functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 49879-batch-run-script-empty-button

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@RachelElysia
RachelElysia merged commit 29f20ac into main Jul 27, 2026
28 checks passed
@RachelElysia
RachelElysia deleted the 49879-batch-run-script-empty-button branch July 27, 2026 20:07
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.

Weird empty button in batch run script modal

3 participants