feat: allow users to add a description to the sensitive content warning

- Add contentWarningReason() helper to TagArrayExt and EventExt for reading the reason from existing events
- Add contentWarningDescription state to ShortNotePostViewModel, wired into event building and draft load/save/reset
- Update ContentSensitivityExplainer to accept description state and render an OutlinedTextField for user input
- Pass description state from ShortNotePostScreen to ContentSensitivityExplainer
- Add "Reason (optional)" placeholder string resource

https://claude.ai/code/session_01P2nkYdNiWXiAcfMPTRTVEW
This commit is contained in:
Claude
2026-03-11 16:51:37 +00:00
parent 2312bea10d
commit 2b0518a675
6 changed files with 33 additions and 3 deletions
@@ -25,3 +25,5 @@ import com.vitorpamplona.quartz.nip01Core.core.Event
fun Event.isSensitive() = tags.isSensitive()
fun Event.isSensitiveOrNSFW() = tags.isSensitiveOrNSFW()
fun Event.contentWarningReason() = tags.contentWarningReason()
@@ -28,3 +28,5 @@ val nsfwTags = setOf("nsfw", "nude", "NSFW", "NUDE", "Nsfw", "Nude")
fun TagArray.isSensitive() = this.any(ContentWarningTag::isTag)
fun TagArray.isSensitiveOrNSFW() = this.any { ContentWarningTag.isTag(it) || HashtagTag.isAnyTagged(it, nsfwTags) }
fun TagArray.contentWarningReason() = this.firstOrNull(ContentWarningTag::isTag)?.getOrNull(1)