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:
parent
1bedfca666
commit
7aab0dd047
3 changed files with 26 additions and 0 deletions
|
|
@ -148,6 +148,9 @@ export default function App() {
|
|||
setChannelsViewState(v);
|
||||
localStorage.setItem(CHANNELS_VIEW_KEY, v);
|
||||
};
|
||||
// Bumped to tell the channel manager to drop a stale column filter when we send the user
|
||||
// there to see a specific set (the header's "without full history" link).
|
||||
const [channelsFilterReset, setChannelsFilterReset] = useState(0);
|
||||
// "Focus this channel in the manager": jump to the Channels page and seed its name filter
|
||||
// so the channel is isolated. Cleared when leaving the page so it doesn't re-apply later.
|
||||
const [focusChannelName, setFocusChannelName] = useState<string | null>(null);
|
||||
|
|
@ -423,6 +426,7 @@ export default function App() {
|
|||
onGoToFullHistory={() => {
|
||||
setChannelFilter("needs_full");
|
||||
setChannelsView("subscribed"); // the status filter applies to the subscriptions tab
|
||||
setChannelsFilterReset((n) => n + 1); // drop any stale column filter hiding the rows
|
||||
setPage("channels");
|
||||
}}
|
||||
/>
|
||||
|
|
@ -449,6 +453,7 @@ export default function App() {
|
|||
setStatusFilter={setChannelFilter}
|
||||
view={channelsView}
|
||||
setView={setChannelsView}
|
||||
filtersResetToken={channelsFilterReset}
|
||||
onOpenWizard={() => setWizardOpen(true)}
|
||||
onViewChannel={(id, name) => {
|
||||
setFilters({ ...filters, channelId: id, channelName: name, show: "all" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue