Add Spoiler Flag with veil, AP content-warning encoding, and full-stack plumbing

Authors can flag a review's comment as containing spoilers; the comment is
blurred behind a reveal control for every viewer except the author, omitted
from RSS, and federates as containsSpoilers plus an AP summary content
warning (ADR-0011) so Mastodon-class clients also collapse it. Flag follows
the general-edit path (ADR-0001) across domain, both DB backends, REST,
HTML templates, SPA (shadcn), TUI fixtures, and exports.
This commit is contained in:
2026-10-17 21:12:56 +02:00
parent 9dd9df1f73
commit bb2001b9cc
66 changed files with 513 additions and 167 deletions

View File

@@ -12,6 +12,7 @@ fn make_review(watch_medium: Option<WatchMedium>) -> Review {
Some(Comment::new("great film".into()).unwrap()),
NaiveDateTime::parse_from_str("2024-06-15 20:00:00", "%Y-%m-%d %H:%M:%S").unwrap(),
watch_medium,
false,
)
.unwrap()
}
@@ -71,6 +72,23 @@ fn apply_edit_clears_watch_medium() {
assert_eq!(edited.watch_medium(), None);
}
#[test]
fn apply_edit_toggles_spoilers() {
let original = make_review(None);
let flag_on = original.apply_edit(ReviewEdit {
spoilers: Some(true),
..Default::default()
});
assert!(flag_on.spoilers());
let flag_off = flag_on.apply_edit(ReviewEdit {
spoilers: Some(false),
..Default::default()
});
assert!(!flag_off.spoilers());
let untouched = original.apply_edit(ReviewEdit::default());
assert!(!untouched.spoilers());
}
#[test]
fn apply_edit_no_changes_preserves_all() {
let original = make_review(Some(WatchMedium::TV));