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

@@ -369,6 +369,7 @@ pub fn parse_csv(content: &str) -> Vec<ParsedRow> {
},
watched_at,
watch_medium: None,
spoilers: false,
}),
});
}
@@ -829,6 +830,7 @@ pub fn update(app: &mut App, action: Action) -> Vec<Command> {
comment,
watched_at,
watch_medium: None,
spoilers: false,
};
app.loading = true;
return vec![Command::CreateReview(req)];

View File

@@ -55,6 +55,7 @@ fn diary_entry() -> DiaryEntryDto {
comment: None,
watched_at: "1999-03-31T00:00:00".into(),
watch_medium: None,
spoilers: false,
},
}
}
@@ -383,6 +384,7 @@ fn bulk_import_all_with_valid_rows_returns_import_next_command() {
comment: None,
watched_at: "1999-03-31T00:00:00".into(),
watch_medium: None,
spoilers: false,
}),
}];
}
@@ -406,6 +408,7 @@ fn bulk_item_done_advances_stage_and_returns_next_command() {
comment: None,
watched_at: "2024-01-01T00:00:00".into(),
watch_medium: None,
spoilers: false,
},
LogReviewRequest {
external_metadata_id: None,
@@ -416,6 +419,7 @@ fn bulk_item_done_advances_stage_and_returns_next_command() {
comment: None,
watched_at: "2024-01-02T00:00:00".into(),
watch_medium: None,
spoilers: false,
},
];
m.bulk_import.results = vec![None, None];
@@ -445,6 +449,7 @@ fn bulk_item_done_last_item_transitions_to_done() {
comment: None,
watched_at: "2024-01-01T00:00:00".into(),
watch_medium: None,
spoilers: false,
}];
m.bulk_import.results = vec![None];
}

View File

@@ -24,6 +24,7 @@ fn log_review_request_skips_none_fields() {
comment: None,
watched_at: "2024-01-15T20:00:00".into(),
watch_medium: None,
spoilers: false,
};
let json = serde_json::to_string(&req).unwrap();
assert!(!json.contains("external_metadata_id"));
@@ -44,6 +45,7 @@ fn log_review_request_includes_director_when_set() {
comment: None,
watched_at: "2024-01-15T20:00:00".into(),
watch_medium: None,
spoilers: false,
};
let json = serde_json::to_string(&req).unwrap();
assert!(json.contains("\"manual_director\":\"Denis Villeneuve\""));