feat(app): undo on toasts for marking a title and leaving Continue watching

A toast can carry a button. Marking a whole title watched or unwatched
from its tile menu, and taking it off Continue watching, both lose
state the viewer may have wanted; each now says what it did with an
Undo that puts every changed watch state back as it was.
This commit is contained in:
nvrl committed 2026-10-02 20:16:27 +02:00
1 parent a432a93cf9
commit 79c3f6885d
3 files changed
+184 -46

No files matched your search

+5 -13
View File
@@ -441,16 +441,10 @@ fn tile_menu(
})
.clicked()
{
for episode in title.episodes() {
if episode.is_watched() == all_watched {
actions.push(Action::SetWatched {
share_id: episode.node.share_id.clone(),
link_id: episode.node.link_id.clone(),
watched: !all_watched,
duration: episode.watch.and_then(|watch| watch.duration_secs),
});
}
}
actions.push(Action::SetTitleWatched {
key: title.key.clone(),
watched: !all_watched,
});
}
if continuing
&& let Some(episode) = title.resume()
@@ -459,11 +453,9 @@ fn tile_menu(
.on_hover_text("Forget where you stopped in it")
.clicked()
{
actions.push(Action::SetWatched {
actions.push(Action::ForgetPosition {
share_id: episode.node.share_id.clone(),
link_id: episode.node.link_id.clone(),
watched: false,
duration: episode.watch.and_then(|watch| watch.duration_secs),
});
}