Only show a badge in the composer if the room is unencrypted. (#3866)

* Partially revert the message composer encryption badges and only show it for unencrypted rooms.

* Update preview test snapshots.

* Update UI test snapshots.
This commit is contained in:
Stefan Ceriu 2025-03-04 14:58:15 +02:00 committed by GitHub
parent 3ecf9a20cd
commit 56d8af1d2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
79 changed files with 156 additions and 159 deletions

View File

@ -355,6 +355,7 @@
"rich_text_editor_code_block" = "Toggle code block";
"rich_text_editor_composer_encrypted_placeholder" = "Encrypted message…";
"rich_text_editor_composer_placeholder" = "Message…";
"rich_text_editor_composer_unencrypted_placeholder" = "Unencrypted message…";
"rich_text_editor_create_link" = "Create a link";
"rich_text_editor_edit_link" = "Edit link";
"rich_text_editor_format_bold" = "Apply bold format";
@ -936,7 +937,6 @@
"screen_roomlist_main_space_title" = "Chats";
"screen_roomlist_mark_as_read" = "Mark as read";
"screen_roomlist_mark_as_unread" = "Mark as unread";
"screen_roomlist_room_directory_button_title" = "Browse all rooms";
"screen_server_confirmation_message_login_element_dot_io" = "A private server for Element employees.";
"screen_server_confirmation_message_login_matrix_dot_org" = "Matrix is an open network for secure, decentralized communication.";
"screen_server_confirmation_message_register" = "This is where your conversations will live — just like you would use an email provider to keep your emails.";

View File

@ -355,6 +355,7 @@
"rich_text_editor_code_block" = "Toggle code block";
"rich_text_editor_composer_encrypted_placeholder" = "Encrypted message…";
"rich_text_editor_composer_placeholder" = "Message…";
"rich_text_editor_composer_unencrypted_placeholder" = "Unencrypted message…";
"rich_text_editor_create_link" = "Create a link";
"rich_text_editor_edit_link" = "Edit link";
"rich_text_editor_format_bold" = "Apply bold format";
@ -936,7 +937,6 @@
"screen_roomlist_main_space_title" = "Chats";
"screen_roomlist_mark_as_read" = "Mark as read";
"screen_roomlist_mark_as_unread" = "Mark as unread";
"screen_roomlist_room_directory_button_title" = "Browse all rooms";
"screen_server_confirmation_message_login_element_dot_io" = "A private server for Element employees.";
"screen_server_confirmation_message_login_matrix_dot_org" = "Matrix is an open network for secure, decentralised communication.";
"screen_server_confirmation_message_register" = "This is where your conversations will live — just like you would use an email provider to keep your emails.";

View File

@ -850,6 +850,8 @@ internal enum L10n {
internal static var richTextEditorComposerEncryptedPlaceholder: String { return L10n.tr("Localizable", "rich_text_editor_composer_encrypted_placeholder") }
/// Message
internal static var richTextEditorComposerPlaceholder: String { return L10n.tr("Localizable", "rich_text_editor_composer_placeholder") }
/// Unencrypted message
internal static var richTextEditorComposerUnencryptedPlaceholder: String { return L10n.tr("Localizable", "rich_text_editor_composer_unencrypted_placeholder") }
/// Create a link
internal static var richTextEditorCreateLink: String { return L10n.tr("Localizable", "rich_text_editor_create_link") }
/// Edit link
@ -2242,8 +2244,6 @@ internal enum L10n {
internal static var screenRoomlistMarkAsRead: String { return L10n.tr("Localizable", "screen_roomlist_mark_as_read") }
/// Mark as unread
internal static var screenRoomlistMarkAsUnread: String { return L10n.tr("Localizable", "screen_roomlist_mark_as_unread") }
/// Browse all rooms
internal static var screenRoomlistRoomDirectoryButtonTitle: String { return L10n.tr("Localizable", "screen_roomlist_room_directory_button_title") }
/// Add room address
internal static var screenSecurityAndPrivacyAddRoomAddressAction: String { return L10n.tr("Localizable", "screen_security_and_privacy_add_room_address_action") }
/// Anyone can ask to join the room but an administrator or moderator will have to accept the request.

View File

@ -232,9 +232,9 @@ struct ComposerToolbar: View {
private var composerPlaceholder: String {
if context.viewState.isRoomEncrypted {
return L10n.richTextEditorComposerEncryptedPlaceholder
} else {
return L10n.richTextEditorComposerPlaceholder
} else {
return L10n.richTextEditorComposerUnencryptedPlaceholder
}
}

View File

@ -238,12 +238,9 @@ private struct MessageComposerStyleModifier<Header: View>: ViewModifier {
@ViewBuilder
private var icon: some View {
if isEncrypted {
CompoundIcon(\.lockSolid, size: .xSmall, relativeTo: .compound.bodyMD)
.foregroundStyle(.compound.iconSuccessPrimary)
} else {
if !isEncrypted {
CompoundIcon(\.lockOff, size: .xSmall, relativeTo: .compound.bodyMD)
.foregroundStyle(.compound.iconTertiary)
.foregroundStyle(.compound.iconInfoPrimary)
}
}
}