diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts index b927e3f50a..7b8f7262b1 100644 --- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts +++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts @@ -12,6 +12,7 @@ import { PlatformTablePercentValue, PlatformTableRelativeTimeValue, PlatformTableTemperatureValue, + PlatformTableToolbar, createPlatformTableFilterState, formatPlatformTableBytesValue, formatPlatformTableCountRatioValue, @@ -235,6 +236,31 @@ describe('filterPlatformResources', () => { }); }); +describe('PlatformTableToolbar', () => { + it('keeps table view options inside the shared filter toolbar with the row counter', () => { + render(() => + PlatformTableToolbar({ + search: () => '', + onSearchChange: () => undefined, + searchPlaceholder: 'Search rows', + status: 'all', + onStatusChange: () => undefined, + statusOptions: [{ value: 'all', label: 'All' }], + visible: 2, + total: 3, + rowNoun: 'rows', + viewOptionsTrailing: 'Columns', + }), + ); + + const columnsLabel = screen.getByText('Columns'); + const filterBar = columnsLabel.closest('.filter-bar'); + + expect(filterBar).not.toBeNull(); + expect(filterBar).toContainElement(screen.getByText('2 of 3 rows')); + }); +}); + describe('formatPlatformTableTextValue', () => { it('trims text values and uses the canonical platform-table empty cell marker', () => { expect(formatPlatformTableTextValue(' kubelet ')).toBe('kubelet'); diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx index 1508906245..a462681a18 100644 --- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx +++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx @@ -786,6 +786,7 @@ export function PlatformTableToolbar(props: { // chips behind "+ Filter". filters?: FilterDef[]; savedViewsKey?: string; + viewOptionsTrailing?: JSX.Element; }) { const { isMobile } = useBreakpoint(); @@ -837,11 +838,14 @@ export function PlatformTableToolbar(props: { filters={allFilters} savedViewsKey={props.savedViewsKey} viewOptionsTrailing={ - + <> + {props.viewOptionsTrailing} + + } showClearAll={() => Boolean(props.hasActiveFilters && props.onResetFilters)} onClearAll={props.onResetFilters} diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx index bff2579271..31f62df267 100644 --- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx +++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx @@ -1352,34 +1352,32 @@ export const AgentsMachinesTable: Component<{ } >
-
-
- -
- -
+ } + /> 0} diff --git a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx index e3e09bf54e..617f9d3561 100644 --- a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx +++ b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx @@ -123,6 +123,24 @@ afterEach(() => { }); describe('AgentsMachinesTable', () => { + it('keeps the column picker inside the shared machine filter toolbar', () => { + render(() => ( + + )); + + const search = screen.getByPlaceholderText('Search machines'); + const columnsButton = screen.getByTitle('Choose which columns to display'); + const filterBar = columnsButton.closest('.filter-bar'); + + expect(filterBar).not.toBeNull(); + expect(filterBar).toContainElement(search); + }); + it('surfaces machine-native monitoring columns for agent machines', async () => { render(() => (