Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add accessibility to the maximise/minimise composer button #7787

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2603,6 +2603,8 @@ To enable access, tap Settings> Location and select Always";


// MARK: - WYSIWYG Composer
"wysiwyg_composer_action_minimise_action" = "Shrink composer";
"wysiwyg_composer_action_maximise_action" = "Expand composer";

// Send Media Actions
"wysiwyg_composer_start_action_media_picker" = "Photo Library";
Expand Down
8 changes: 8 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9567,6 +9567,14 @@ public class VectorL10n: NSObject {
public static var widgetStickerPickerNoStickerpacksAlertAddNow: String {
return VectorL10n.tr("Vector", "widget_sticker_picker_no_stickerpacks_alert_add_now")
}
/// Expand composer
public static var wysiwygComposerActionMaximiseAction: String {
return VectorL10n.tr("Vector", "wysiwyg_composer_action_maximise_action")
}
/// Shrink composer
public static var wysiwygComposerActionMinimiseAction: String {
return VectorL10n.tr("Vector", "wysiwyg_composer_action_minimise_action")
}
/// Apply bold format
public static var wysiwygComposerFormatActionBold: String {
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_bold")
Expand Down
5 changes: 5 additions & 0 deletions RiotSwiftUI/Modules/Room/Composer/View/Composer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ struct Composer: View {
wysiwygViewModel.maximised ? "minimiseButton" : "maximiseButton"
}

private var toggleButtonAccessibilityLabel: String {
wysiwygViewModel.maximised ? VectorL10n.wysiwygComposerActionMinimiseAction : VectorL10n.wysiwygComposerActionMaximiseAction
}

private var toggleButtonImageName: String {
wysiwygViewModel.maximised ? Asset.Images.minimiseComposer.name : Asset.Images.maximiseComposer.name
}
Expand Down Expand Up @@ -171,6 +175,7 @@ struct Composer: View {
.frame(width: 16, height: 16)
}
.accessibilityIdentifier(toggleButtonAcccessibilityIdentifier)
.accessibilityLabel(toggleButtonAccessibilityLabel)
.padding(.leading, 12)
.padding(.trailing, 4)
}
Expand Down
Loading