fix(channels): drop a stale column filter when sent to "without full history"

A focus-channel deep-link sets (and persists) the channel-name column filter
via the DataTable's externalFilter. That persisted value then survived into
unrelated visits: clicking the header's "N without full history" link landed
on the right tab with the right status chip, but a leftover name filter (e.g.
a channel focused in a past session) hid every row — "No channels".

Add a resetFiltersToken to DataTable that clears its column filters when it
advances, and bump it from the header intent. The token's ref starts at 0 so
the clear fires even when the table remounts on navigation, while a plain
reload (token still 0) keeps the user's persisted filters.
This commit is contained in:
npeter83 2026-06-19 03:55:55 +02:00
parent 1bedfca666
commit 7aab0dd047
3 changed files with 26 additions and 0 deletions

View file

@ -52,6 +52,7 @@ export default function Channels({
setStatusFilter,
view,
setView,
filtersResetToken,
onOpenWizard,
}: {
canWrite: boolean;
@ -66,6 +67,8 @@ export default function Channels({
// (the header's "without full history" link, focus-channel) can force it back here.
view: ChannelsView;
setView: (v: ChannelsView) => void;
// Bumped by the header's "without full history" intent to clear a stale column filter.
filtersResetToken: number;
onOpenWizard: () => void;
}) {
const { t } = useTranslation();
@ -510,6 +513,7 @@ export default function Channels({
controlsPosition="top"
controlsLeading={statusChips}
externalFilter={focusChannelName ? { key: "channel", value: focusChannelName } : null}
resetFiltersToken={filtersResetToken}
rowClassName={(c) => (c.hidden ? "opacity-60" : "")}
emptyText={t("channels.empty")}
/>