Skip to content

Fleet UI: show custom host vital row actions disabled with GitOps tooltip - #49506

Merged
nulmete merged 3 commits into
mainfrom
gitops-custom-host-vitals-row-actions
Jul 17, 2026
Merged

Fleet UI: show custom host vital row actions disabled with GitOps tooltip#49506
nulmete merged 3 commits into
mainfrom
gitops-custom-host-vitals-row-actions

Conversation

@nulmete

@nulmete nulmete commented Jul 17, 2026

Copy link
Copy Markdown
Member

Related issue: Relates to #44954

In GitOps mode, the Custom host vitals tab hid the row edit/delete icons entirely, while the "Add vital" button was shown disabled with the standard GitOps tooltip — an inconsistency. This makes the edit/delete icons behave like the Add button: shown but disabled with the GitOps tooltip (wrapped in GitOpsModeTooltipWrapper, which reads GitOps mode from context). The now-unused gitOpsModeEnabled prop/hook is removed.

This fixes something I've missed from the parent's story UI Test Plan section:

GitOps mode: add/edit/delete controls are disabled with the GitOps tooltip. Can still set individual per-host values.

Checklist for submitter

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

Already added as part of the feature which is in main.

Testing

  • QA'd all new/changed functionality manually
Screenshot 2026-07-17 at 4 31 24 PM

Summary by CodeRabbit

  • Bug Fixes
    • Improved the Custom Host Vitals table behavior when GitOps mode is enabled.
    • Edit and delete actions now remain visible but are appropriately disabled, with guidance displayed when unavailable.
    • Preserved existing token-copy and last-updated information in the table.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.07%. Comparing base (5da37b0) to head (d9471c6).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ustomHostVitalsTab/CustomHostVitalsTableConfig.tsx 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #49506      +/-   ##
==========================================
- Coverage   68.07%   68.07%   -0.01%     
==========================================
  Files        3882     3882              
  Lines      246392   246400       +8     
  Branches    13132    13138       +6     
==========================================
+ Hits       167742   167746       +4     
- Misses      63509    63513       +4     
  Partials    15141    15141              
Flag Coverage Δ
frontend 60.16% <50.00%> (-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.

@nulmete
nulmete marked this pull request as ready for review July 17, 2026 19:08
@nulmete
nulmete requested a review from a team as a code owner July 17, 2026 19:08
Copilot AI review requested due to automatic review settings July 17, 2026 19:08

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

This PR makes the Custom host vitals table’s per-row edit/delete actions consistent with the existing GitOps-mode behavior of the “Add vital” button: actions remain visible in GitOps mode but are disabled and show the standard GitOps tooltip. It also removes the now-unneeded gitOpsModeEnabled prop/hook plumbing.

Changes:

  • Show row edit/delete icons for write roles even in GitOps mode, but disable them via GitOpsModeTooltipWrapper so the tooltip appears.
  • Remove useGitOpsMode usage and the gitOpsModeEnabled parameter from the table header generator.

Reviewed changes

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

File Description
frontend/pages/ManageControlsPage/Variables/cards/CustomHostVitalsTab/CustomHostVitalsTableConfig.tsx Wraps row action buttons with GitOpsModeTooltipWrapper and removes the GitOps prop from header generation.
frontend/pages/ManageControlsPage/Variables/cards/CustomHostVitalsTab/CustomHostVitalsTab.tsx Removes useGitOpsMode and stops passing GitOps state into table header generation.

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

Comment on lines 101 to 124
<div className="custom-host-vitals-tab__actions">
<Button
variant="icon"
onClick={() => onEdit(vital)}
ariaLabel={`Edit ${vital.name}`}
>
<Icon name="pencil" color="ui-fleet-black-75" />
</Button>
<Button
variant="icon"
onClick={() => onDelete(vital)}
ariaLabel={`Delete ${vital.name}`}
>
<Icon name="trash" color="ui-fleet-black-75" />
</Button>
<GitOpsModeTooltipWrapper
renderChildren={(disableChildren) => (
<>
<Button
variant="icon"
disabled={disableChildren}
onClick={() => onEdit(vital)}
ariaLabel={`Edit ${vital.name}`}
>
<Icon name="pencil" color="ui-fleet-black-75" />
</Button>
<Button
variant="icon"
disabled={disableChildren}
onClick={() => onDelete(vital)}
ariaLabel={`Delete ${vital.name}`}
>
<Icon name="trash" color="ui-fleet-black-75" />
</Button>
</>
)}
/>
</div>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly states the main UI change: GitOps-disabled custom host vital row actions with tooltip.
Description check ✅ Passed The description includes the related issue, change summary, and manual testing, and it matches the template well enough for this UI-only fix.
✨ 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 gitops-custom-host-vitals-row-actions

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.

Wrap the actions cell's GitOpsModeTooltipWrapper around the container and
add fixedPositionStrategy + position=top so the tooltip renders on top
(escaping the table row's overflow clipping) instead of flipping left.
@nulmete
nulmete merged commit 7a275f4 into main Jul 17, 2026
26 checks passed
@nulmete
nulmete deleted the gitops-custom-host-vitals-row-actions branch July 17, 2026 19:39
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.

3 participants