From 98aa4f275c65d555869e9dfe095093b8c1061303 Mon Sep 17 00:00:00 2001 From: Alan Peixinho Date: Wed, 22 Jul 2026 14:25:57 -0300 Subject: [PATCH 1/2] feat: show default platform sort on hardware listing * Make the hardware table start sorted by platform and keep that column active via enableSortingRemoval. * Use TanStack's toggle handler in TableHeader so sorting options are respected, and drop redundant page-level sorts. Closes #2004 Signed-off-by: Alan Peixinho --- .../src/components/Table/TableHeader.tsx | 16 +------- .../TreeListingPage/TreeListingPage.tsx | 41 ++++--------------- .../TreeListingPage/treeTableUtils.tsx | 2 +- .../pages/Hardware/HardwareListingPage.tsx | 3 +- .../src/pages/Hardware/HardwareTable.tsx | 11 +++-- 5 files changed, 17 insertions(+), 56 deletions(-) diff --git a/dashboard/src/components/Table/TableHeader.tsx b/dashboard/src/components/Table/TableHeader.tsx index 359486e99..ffe3d8913 100644 --- a/dashboard/src/components/Table/TableHeader.tsx +++ b/dashboard/src/components/Table/TableHeader.tsx @@ -6,7 +6,7 @@ import { ArrowDown, ArrowUp, ArrowUpDown } from 'lucide-react'; import { z } from 'zod'; -import { useCallback, type JSX } from 'react'; +import type { JSX } from 'react'; import type { MessagesKey } from '@/locales/messages'; @@ -39,24 +39,12 @@ export const TableHeader = ({ intlKey, tooltipId, }: ITableHeader): JSX.Element => { - const headerSort = useCallback(() => { - if (sortable) { - if (column.getIsSorted() === 'asc') { - column.toggleSorting(true); - } else if (column.getIsSorted() === 'desc') { - column.clearSorting(); - } else { - column.toggleSorting(false); - } - } - }, [column, sortable]); - return (