Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lucky-colts-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---

fix: Switch to 'all' after filters change on kubernetes dashboard page
7 changes: 7 additions & 0 deletions packages/app/src/KubernetesDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ export const InfraPodsStatusTable = ({
where: string;
}) => {
const [phaseFilter, setPhaseFilter] = React.useState('running');

// Auto-switch to "All" when search filters are applied
useEffect(() => {
if (where) {
setPhaseFilter('all');
}
}, [where]);
const [sortState, setSortState] = React.useState<{
column: InfraPodsStatusTableColumn;
order: 'asc' | 'desc';
Expand Down
20 changes: 20 additions & 0 deletions packages/app/tests/e2e/features/kubernetes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,24 @@ test.describe('Kubernetes Dashboard', { tag: ['@kubernetes'] }, () => {
'ResourceAttributes.k8s.namespace.name:"default"',
);
});

test('should switch to "All" tab when filtering by pod or namespace', async ({
page,
}) => {
// Verify initial state is "Running"
const podsTable = page.getByTestId('k8s-pods-table');
const runningTab = podsTable.getByRole('radio', { name: 'Running' });
await expect(runningTab).toBeChecked();

// Filter by namespace
const namespaceFilter = page.getByTestId('namespace-filter-select');
await namespaceFilter.click();
await page.getByRole('option', { name: 'default' }).click();

await page.waitForTimeout(500);

// Verify it switched to "All" tab
const allTab = podsTable.getByRole('radio', { name: 'All' });
await expect(allTab).toBeChecked();
});
});
Loading