diff --git a/components/revert-video-modal.html b/components/revert-video-modal.html index cedd0daa..151d7bfd 100644 --- a/components/revert-video-modal.html +++ b/components/revert-video-modal.html @@ -62,7 +62,7 @@

Versions are grouped by their d tag or shared videoRootId. This ensures legacy - clients see consistent history when multiple edits were published. + clients see consistent history when multiple edits were published, and keeps audience flags (NSFW / for kids) aligned with the Upload modal.

@@ -117,6 +117,22 @@ +
+

+ Audience flags +

+
+
+
NSFW flag
+
Awaiting selection
+
+
+
For kids flag
+
Awaiting selection
+
+
+
+

NIP-71 event metadata diff --git a/js/ui/components/RevertModal.js b/js/ui/components/RevertModal.js index 5e287b69..3d9dee6b 100644 --- a/js/ui/components/RevertModal.js +++ b/js/ui/components/RevertModal.js @@ -571,6 +571,9 @@ export class RevertModal { } const chips = []; + const nsfwFlag = version.isNsfw === true; + const forKidsFlag = version.isForKids === true; + const conflictingAudienceFlags = nsfwFlag && forKidsFlag; if (version.deleted) { chips.push( 'Marked deleted' @@ -581,6 +584,22 @@ export class RevertModal { 'Private' ); } + if (conflictingAudienceFlags) { + chips.push( + 'NSFW + For kids conflict' + ); + } else { + if (nsfwFlag) { + chips.push( + 'Marked NSFW' + ); + } + if (forKidsFlag) { + chips.push( + 'For kids' + ); + } + } if (version.version !== undefined) { chips.push( `Schema v${escape( @@ -589,6 +608,35 @@ export class RevertModal { ); } + const renderFlagStatus = (value, { + yesLabel = "Yes", + noLabel = "No", + unspecifiedLabel = "Not specified", + } = {}) => { + if (value === true) { + return `${escape(yesLabel)}`; + } + if (value === false) { + return `${escape(noLabel)}`; + } + return this.renderPlaceholder(unspecifiedLabel); + }; + + const nsfwStatusHtml = renderFlagStatus(version.isNsfw, { + yesLabel: "Yes — marked NSFW", + noLabel: "No — not flagged as NSFW", + unspecifiedLabel: "Not specified", + }); + const kidsStatusHtml = renderFlagStatus(version.isForKids, { + yesLabel: "Yes — marked for kids", + noLabel: "No — not marked for kids", + unspecifiedLabel: "Not specified", + }); + + const audienceConflictNotice = conflictingAudienceFlags + ? '

Conflicting flags detected — this revision is marked both NSFW and for kids. Review before reverting.

' + : ""; + const descriptionHtml = description ? `

${escape(description)}

` : '

No description provided.

'; @@ -718,6 +766,11 @@ export class RevertModal { definition("Alt text", altHtml, { span: 2 }), ].join(""); + const audienceRows = [ + definition("NSFW flag", nsfwStatusHtml), + definition("For kids flag", kidsStatusHtml), + ].join(""); + this.details.innerHTML = `
@@ -759,6 +812,14 @@ export class RevertModal { ${descriptionHtml}

+
+

Audience flags

+
+ ${audienceRows} +
+ ${audienceConflictNotice} +
+

NIP-71 event metadata