Add filter to show unassociated streams in Streams table

Adds a filter button with 'Only Unassociated' toggle option to the Streams table, allowing users to quickly identify streams from providers that are not associated with any channel. The filter button follows the existing UI pattern from ChannelTableHeader, positioned on the right side of the toolbar. Leverages existing backend support for the unassigned query parameter.

Resolves #667
This commit is contained in:
Jeffrey C 2026-01-12 10:59:52 -06:00
parent a772f5c353
commit 6a8a94101a
No known key found for this signature in database
GPG key ID: A68C7782CDAC89E3

View file

@ -20,6 +20,9 @@ import {
ArrowUpNarrowWide,
ArrowDownWideNarrow,
Search,
Filter,
Square,
SquareCheck,
} from 'lucide-react';
import {
TextInput,
@ -48,7 +51,6 @@ import {
Modal,
NumberInput,
Radio,
Checkbox,
} from '@mantine/core';
import { useNavigate } from 'react-router-dom';
import useSettingsStore from '../../store/settings';
@ -232,6 +234,7 @@ const StreamsTable = ({ onReady }) => {
name: '',
channel_group: '',
m3u_account: '',
unassigned: '',
});
const [columnSizing, setColumnSizing] = useLocalStorage(
'streams-table-column-sizing',
@ -382,6 +385,13 @@ const StreamsTable = ({ onReady }) => {
}));
};
const toggleUnassignedOnly = () => {
setFilters((prev) => ({
...prev,
unassigned: prev.unassigned === '1' ? '' : '1',
}));
};
const fetchData = useCallback(async () => {
setIsLoading(true);
@ -1057,6 +1067,29 @@ const StreamsTable = ({ onReady }) => {
</Flex>
<Flex gap={6} wrap="nowrap" style={{ flexShrink: 0 }}>
<Menu shadow="md" width={200}>
<Menu.Target>
<Button size="xs" variant="default">
<Filter size={18} />
</Button>
</Menu.Target>
<Menu.Dropdown>
<Menu.Item
onClick={toggleUnassignedOnly}
leftSection={
filters.unassigned === '1' ? (
<SquareCheck size={18} />
) : (
<Square size={18} />
)
}
>
<Text size="xs">Only Unassociated</Text>
</Menu.Item>
</Menu.Dropdown>
</Menu>
<Button
leftSection={<SquarePlus size={18} />}
variant="light"