feat(notifications): unify the two rail indicators into one inbox
Fold the client-side transient bell into the inbox page so there's a single notification indicator. The inbox now has two groups — "System" (durable, server-backed) and "Activity" (client-side events with their Unhide/Unwatch/ Find-in-feed actions) — and the nav badge sums both unread counts. The separate rail bell (NotificationCenter) is removed. Activity items get a per-item clear (X) alongside the global Clear all. Unhiding or unwatching a video from anywhere — a card, the toast's Undo, or the inbox — now quietly resolves the original "Hidden/Watched X" entry (no duplicate "Unhidden X" toast, no stale entry with a dead action), via a new resolveVideo store helper.
This commit is contained in:
parent
dd83718304
commit
d3c6ce659c
8 changed files with 246 additions and 41 deletions
|
|
@ -4,7 +4,7 @@ import { useInfiniteQuery, useQuery, useQueryClient } from "@tanstack/react-quer
|
|||
import { ArrowDown, ArrowUp, RefreshCw } from "lucide-react";
|
||||
import { api, type FeedFilters, type Video } from "../lib/api";
|
||||
import i18n from "../i18n";
|
||||
import { notify } from "../lib/notifications";
|
||||
import { notify, resolveVideo } from "../lib/notifications";
|
||||
import VideoCard from "./VideoCard";
|
||||
import PlayerModal from "./PlayerModal";
|
||||
|
||||
|
|
@ -180,6 +180,10 @@ export default function Feed({
|
|||
action: { label: i18n.t("feed.unwatch"), onClick: () => onState(id, "new") },
|
||||
meta: { kind: "video-watched", videoId: id, title: v?.title ?? "this video" },
|
||||
});
|
||||
} else if (status === "new") {
|
||||
// Unhide / unwatch (from a card, the toast's Undo, or the center): quietly resolve any
|
||||
// stale hide/watch notice for this video so it doesn't linger with a dead action.
|
||||
resolveVideo(id);
|
||||
}
|
||||
},
|
||||
[qc]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue