From 02c3b006eba3852ec37324b9d7611047a8ff1a9d Mon Sep 17 00:00:00 2001 From: Anso Date: Sun, 14 Jun 2026 22:35:45 -0400 Subject: [PATCH] feat(fleet): refine the Fleet Overview toolbar (#1376) * feat(fleet): tidy the Overview toolbar and shorten tab labels - Move the Add node button into the Overview toolbar beside the Grid/Topology toggle so it sits with the view it acts on instead of showing on every Fleet tab. It stays admin-only. - Collapse the node search to an icon button that expands to the full input on click and collapses again on blur once the query is empty, reclaiming toolbar width. An active query keeps it open. - Match the sort-direction toggle and the sort dropdown to the outlined dark fill of the Filters button for a consistent toolbar row. - Swap the Check Updates icon to the refresh-with-dot glyph. - Rename two tabs: Fleet Actions to Actions, Dependencies to Map (display labels only; internal keys unchanged). Update the feature docs to the new tab labels. * feat(fleet): move Check Updates into the Overview tab toolbar Check Updates is an Overview-specific action, but it lived in the shared Fleet header toolbar that renders across every tab. Move it into the Overview tab's own toolbar, to the right of the Add node button, so it only appears where it applies. The relocated button now spins and disables while a check is in flight, matching the Refresh button's loading feedback. The shared header keeps Refresh and Export Dossier. --- frontend/src/components/FleetView.tsx | 13 +++---------- .../src/components/FleetView/OverviewTab.tsx | 6 ++++++ .../components/FleetView/OverviewToolbar.tsx | 19 ++++++++++++++++++- .../__tests__/OverviewToolbar.test.tsx | 17 +++++++++++++++++ 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/FleetView.tsx b/frontend/src/components/FleetView.tsx index f2eb70b6..661fe3a9 100644 --- a/frontend/src/components/FleetView.tsx +++ b/frontend/src/components/FleetView.tsx @@ -1,5 +1,5 @@ import { - RefreshCw, RefreshCcwDot, Camera, FileDown, + RefreshCw, Camera, FileDown, Network, SlidersHorizontal, Send, KeyRound, ArrowLeftRight, Wrench, Workflow, } from 'lucide-react'; @@ -133,15 +133,6 @@ export function FleetView({ onNavigateToNode }: FleetViewProps) {
- )} + + {onCheckUpdates && ( + + )}
); } diff --git a/frontend/src/components/FleetView/__tests__/OverviewToolbar.test.tsx b/frontend/src/components/FleetView/__tests__/OverviewToolbar.test.tsx index de4acf8b..8ea5cc5f 100644 --- a/frontend/src/components/FleetView/__tests__/OverviewToolbar.test.tsx +++ b/frontend/src/components/FleetView/__tests__/OverviewToolbar.test.tsx @@ -93,4 +93,21 @@ describe('OverviewToolbar', () => { render(); expect(screen.queryByRole('button', { name: 'Add node' })).not.toBeInTheDocument(); }); + + it('renders the Check Updates button and fires onCheckUpdates when provided', () => { + const onCheckUpdates = vi.fn(); + render(); + fireEvent.click(screen.getByRole('button', { name: /Check Updates/ })); + expect(onCheckUpdates).toHaveBeenCalledTimes(1); + }); + + it('omits the Check Updates button when onCheckUpdates is not provided', () => { + render(); + expect(screen.queryByRole('button', { name: /Check Updates/ })).not.toBeInTheDocument(); + }); + + it('disables the Check Updates button while a check is in flight', () => { + render(); + expect(screen.getByRole('button', { name: /Check Updates/ })).toBeDisabled(); + }); });