fix: let mantine-datatable manage row expansion state internally

This commit is contained in:
Thomas Camlong committed 2026-07-21 16:05:59 +02:00
1 parent 9edf6ca99b
commit d53de7c641
2 files changed
+15 -2

No files matched your search

@@ -25,6 +25,21 @@ import { downloadsWidget } from '.';
This widget displays a list of torrents or usenet-articles that are currently being downloaded, along with their progress and other relevant information. It supports 7 download client integrations and provides a rich, responsive table interface.
### Screenshots
import downloadsCard from './img/screenshot.png';
import contextMenuImg from './img/context-menu.png';
<div>
<img src={downloadsCard} alt="Downloads widget showing torrent and usenet items" width={128 * 4} />
</div>
#### Right-click context menu
<div>
<img src={contextMenuImg} alt="Downloads widget context menu with pause, delete, and copy actions" width={128 * 4} />
</div>
### Features
- **Responsive table** — columns automatically adapt to widget width, hiding less important columns at smaller sizes
@@ -111,7 +111,6 @@ export default function DownloadClientsWidget({
const [clientFilter, setClientFilter] = useState<string[]>([]);
const [statusFilter, setStatusFilter] = useState<string[]>([]);
const [expandedIds, setExpandedIds] = useState<string[]>([]);
const [contextMenu, setContextMenu] = useState<ContextMenuState | null>(null);
const utils = clientApi.useUtils();
@@ -454,7 +453,6 @@ export default function DownloadClientsWidget({
onRowContextMenu={isEditMode ? undefined : handleContextMenu}
rowExpansion={{
allowMultiple: true,
expanded: { recordIds: expandedIds, onRecordIdsChange: setExpandedIds },
content: ({ record }) => <ExpandedRow item={record} />,
}}
/>