Refine private chat header actions

This commit is contained in:
callebtc 2026-07-29 19:40:21 +02:00
parent 9f81a1e40d
commit 70185ae86f
2 changed files with 28 additions and 18 deletions

View File

@ -475,6 +475,19 @@ fun ConversationHeaderAction(
content = content
)
/** A read-only status slot matching the footprint of [ConversationHeaderAction]. */
@Composable
fun ConversationHeaderStatus(
modifier: Modifier = Modifier,
content: @Composable () -> Unit
) {
Box(
modifier = modifier.size(HeaderTapTarget),
contentAlignment = Alignment.Center,
content = { content() }
)
}
@Composable
fun NicknameEditor(
value: String,

View File

@ -2054,8 +2054,21 @@ fun PrivateChatSheet(
)
}
// Encryption state, and the verification badge that qualifies it. Both are
// read-only for Nostr peers, which have no Noise session at all.
if (isVerified) {
ConversationHeaderStatus {
Icon(
imageVector = Icons.Filled.Verified,
contentDescription = stringResource(
R.string.fingerprint_verified_label
),
modifier = Modifier.size(HeaderIconSize),
tint = colorScheme.primary
)
}
}
// Keep the lock nearest the close action: from right to left the security
// cluster reads close, encryption, verification, then favorite.
if (!isNostrPeer && !isNostrReachableFavorite) {
ConversationHeaderAction(
onClick = { viewModel.showSecurityVerificationSheet() },
@ -2070,22 +2083,6 @@ fun PrivateChatSheet(
}
}
if (isVerified) {
Box(
modifier = Modifier.size(HeaderIconSize),
contentAlignment = Alignment.Center
) {
Icon(
imageVector = Icons.Filled.Verified,
contentDescription = stringResource(
R.string.fingerprint_verified_label
),
modifier = Modifier.size(HeaderIconSize),
tint = colorScheme.primary
)
}
}
val dismiss = LocalSheetDismiss.current
CloseButton(onClick = { dismiss?.invoke() ?: onDismiss() })
}