feat(notifications): notify on 'watched' with an Unwatch action

Mirror the hide flow for watched: marking a video watched (card, modal toggle,
or auto-watch) raises a toast and a bell-history entry with an Unwatch action —
no Find-in-feed, just revert. NotifMeta becomes a discriminated union
(video-hidden | video-watched); unhide/unwatch share one revert-to-new helper.
This commit is contained in:
npeter83 2026-06-12 17:39:28 +02:00
parent 47d0799407
commit 119286db63
3 changed files with 32 additions and 7 deletions

View file

@ -87,6 +87,13 @@ export default function Feed({
channelName: v?.channel_title ?? "",
},
});
} else if (status === "watched") {
const v = (query.data?.pages ?? []).flatMap((p) => p.items).find((x) => x.id === id);
notify({
message: v?.title ? `Marked watched “${v.title}` : "Marked watched",
action: { label: "Unwatch", onClick: () => onState(id, "new") },
meta: { kind: "video-watched", videoId: id, title: v?.title ?? "this video" },
});
}
}