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 1bdde051c1
commit d5dab5377f
3 changed files with 32 additions and 7 deletions

View file

@ -12,13 +12,19 @@ export interface NotifAction {
// Structured payload that lets the Notification Center offer in-app actions even
// after a reload (when live `action` callbacks are gone).
export type NotifMeta = {
export type VideoHiddenMeta = {
kind: "video-hidden";
videoId: string;
title: string;
channelId: string;
channelName: string;
};
export type VideoWatchedMeta = {
kind: "video-watched";
videoId: string;
title: string;
};
export type NotifMeta = VideoHiddenMeta | VideoWatchedMeta;
export interface Notification {
id: number;