mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
feat: pin icon for Buzz channels, fix Added padding, show "You:" in Messages
- Swap the Buzz community channel favorite from a Star to a PushPin icon (and rename the buzz_star/buzz_unstar strings to buzz_pin/buzz_unpin), since the action only pins a channel to the top of the list — it never publishes anything, unlike Add which imports into the kind-10009 list. - Give the "Added" state in BuzzImportRow trailing padding so its label no longer jams against the row edge when the Add button flips to Added. - Prefix a Messages-list DM preview with "You:" when the newest message was sent by the logged-in user, so a room shows who spoke last. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dtx8Shek4sSAXmHjnNMJF
This commit is contained in:
+8
-3
@@ -146,15 +146,20 @@ private fun BuzzImportRowContent(
|
||||
if (onToggleStar != null) {
|
||||
IconButton(onClick = onToggleStar) {
|
||||
Icon(
|
||||
symbol = if (isStarred) MaterialSymbols.Star else MaterialSymbols.StarBorder,
|
||||
contentDescription = stringRes(if (isStarred) R.string.buzz_unstar else R.string.buzz_star),
|
||||
symbol = MaterialSymbols.PushPin,
|
||||
contentDescription = stringRes(if (isStarred) R.string.buzz_unpin else R.string.buzz_pin),
|
||||
tint = if (isStarred) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(20.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
if (isAdded) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
// Match the OutlinedButton's trailing content padding so the label doesn't jam against
|
||||
// the row edge (and doesn't jump horizontally) when Add flips to Added.
|
||||
Row(
|
||||
modifier = Modifier.padding(end = 12.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Icon(
|
||||
symbol = MaterialSymbols.Check,
|
||||
contentDescription = null,
|
||||
|
||||
+6
-1
@@ -864,7 +864,12 @@ private fun RowScope.LastMessagePreview(
|
||||
|
||||
val text =
|
||||
when (preview) {
|
||||
is ChatPreview.Body -> preview.text
|
||||
is ChatPreview.Body -> {
|
||||
// Mark my own newest message with a "You:" prefix (like other messengers) so a
|
||||
// 1:1 room's preview shows who spoke last instead of reading like the counterpart.
|
||||
val sentByMe = lastMessage.author?.pubkeyHex == accountViewModel.account.signer.pubKey
|
||||
if (sentByMe) stringRes(R.string.chat_preview_you_prefix, preview.text) else preview.text
|
||||
}
|
||||
ChatPreview.Decrypting -> stringRes(R.string.chat_preview_decrypting)
|
||||
ChatPreview.Undecryptable -> stringRes(R.string.could_not_decrypt_the_message)
|
||||
ChatPreview.Missing -> stringRes(R.string.referenced_event_not_found)
|
||||
|
||||
@@ -3154,8 +3154,8 @@
|
||||
<string name="buzz_invite_copy">अनुकृति</string>
|
||||
<string name="buzz_invite_error_title">आमन्त्रण बनाने में असफल</string>
|
||||
<string name="buzz_invite_dismiss">ठीक</string>
|
||||
<string name="buzz_star">प्रणाली ताराचिह्नित करें</string>
|
||||
<string name="buzz_unstar">प्रणाली ताराचिह्न हटाएँ</string>
|
||||
<string name="buzz_pin">चैनल पिन करें</string>
|
||||
<string name="buzz_unpin">चैनल अनपिन करें</string>
|
||||
<string name="buzz_dm_section_empty">कोई संवाद नहीं अब तक</string>
|
||||
<plurals name="buzz_dm_see_all_count">
|
||||
<item quantity="one">देखें %1$d और संवाद</item>
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
<string name="could_not_decrypt_the_message">Could not decrypt the message</string>
|
||||
<!-- Placeholder shown in a chat row while an encrypted message is still being decrypted -->
|
||||
<string name="chat_preview_decrypting">Decrypting…</string>
|
||||
<!-- Prefix on a Messages-list preview when the newest message was sent by the logged-in user. %1$s is the message text -->
|
||||
<string name="chat_preview_you_prefix">You: %1$s</string>
|
||||
<string name="group_picture">Group Picture</string>
|
||||
<string name="explicit_content">Explicit Content</string>
|
||||
<string name="relay_notice">Relay Notice</string>
|
||||
@@ -3486,8 +3488,8 @@
|
||||
<string name="buzz_invite_copy">Copy</string>
|
||||
<string name="buzz_invite_error_title">Couldn\'t create invite</string>
|
||||
<string name="buzz_invite_dismiss">OK</string>
|
||||
<string name="buzz_star">Star channel</string>
|
||||
<string name="buzz_unstar">Unstar channel</string>
|
||||
<string name="buzz_pin">Pin channel</string>
|
||||
<string name="buzz_unpin">Unpin channel</string>
|
||||
<string name="buzz_dm_section_empty">No conversations yet</string>
|
||||
<plurals name="buzz_dm_see_all_count">
|
||||
<item quantity="one">See %1$d more conversation</item>
|
||||
|
||||
Reference in New Issue
Block a user