From 477f0ffa08fa6f6613316319abf1c2be1dfd68e1 Mon Sep 17 00:00:00 2001 From: Emily <92288602+burtonemily@users.noreply.github.com> Date: Fri, 6 Jan 2023 10:38:34 +1100 Subject: [PATCH 01/11] Adding accessibility ids to attachments button, camera button, gif button and documents button, also adding text input id for captions on images --- Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme | 2 +- Session/Conversations/ConversationVC+Interaction.swift | 7 ++++++- .../Input View/ExpandingAttachmentsButton.swift | 8 ++++---- Session/Conversations/Input View/InputView.swift | 5 +++++ .../Message Cells/Content Views/DeletedMessageView.swift | 3 ++- .../Content Views/MediaPlaceholderView.swift | 3 ++- .../Conversations/Message Cells/VisibleMessageCell.swift | 1 + .../Conversations/Settings/ThreadSettingsViewModel.swift | 4 ++-- SessionUIKit/Components/ConfirmationModal.swift | 8 ++++---- .../Attachment Approval/AttachmentTextToolbar.swift | 4 ++++ .../ModalActivityIndicatorViewController.swift | 2 ++ 11 files changed, 33 insertions(+), 14 deletions(-) diff --git a/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme b/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme index ea85c66b2..ca157a055 100644 --- a/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme +++ b/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme @@ -157,7 +157,7 @@ Date: Tue, 10 Jan 2023 16:33:49 +1100 Subject: [PATCH 02/11] adding new accessibility ids to message types test --- .../Input View/ExpandingAttachmentsButton.swift | 5 ++++- .../Message Cells/Content Views/VoiceMessageView.swift | 3 ++- Session/Media Viewing & Editing/GIFs/GifPickerCell.swift | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/Input View/ExpandingAttachmentsButton.swift b/Session/Conversations/Input View/ExpandingAttachmentsButton.swift index a69c823bc..85757803b 100644 --- a/Session/Conversations/Input View/ExpandingAttachmentsButton.swift +++ b/Session/Conversations/Input View/ExpandingAttachmentsButton.swift @@ -27,13 +27,14 @@ final class ExpandingAttachmentsButton: UIView, InputViewButtonDelegate { lazy var gifButton: InputViewButton = { let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_gif_black"), delegate: self, hasOpaqueBackground: true) result.accessibilityIdentifier = "GIF button" - + result.isAccessibilityElement = true return result }() lazy var gifButtonContainer = container(for: gifButton) lazy var documentButton: InputViewButton = { let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_document_black"), delegate: self, hasOpaqueBackground: true) result.accessibilityIdentifier = "Documents folder" + result.isAccessibilityElement = true return result }() @@ -41,6 +42,7 @@ final class ExpandingAttachmentsButton: UIView, InputViewButtonDelegate { lazy var libraryButton: InputViewButton = { let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_camera_roll_black"), delegate: self, hasOpaqueBackground: true) result.accessibilityIdentifier = "Images folder" + result.isAccessibilityElement = true return result }() @@ -48,6 +50,7 @@ final class ExpandingAttachmentsButton: UIView, InputViewButtonDelegate { lazy var cameraButton: InputViewButton = { let result = InputViewButton(icon: #imageLiteral(resourceName: "actionsheet_camera_black"), delegate: self, hasOpaqueBackground: true) result.accessibilityIdentifier = "Select camera button" + result.isAccessibilityElement = true return result }() diff --git a/Session/Conversations/Message Cells/Content Views/VoiceMessageView.swift b/Session/Conversations/Message Cells/Content Views/VoiceMessageView.swift index cdae7fa07..af2f386f8 100644 --- a/Session/Conversations/Message Cells/Content Views/VoiceMessageView.swift +++ b/Session/Conversations/Message Cells/Content Views/VoiceMessageView.swift @@ -98,7 +98,8 @@ public final class VoiceMessageView: UIView { init() { super.init(frame: CGRect.zero) - + self.accessibilityIdentifier = "Voice message" + self.isAccessibilityElement = true setUpViewHierarchy() } diff --git a/Session/Media Viewing & Editing/GIFs/GifPickerCell.swift b/Session/Media Viewing & Editing/GIFs/GifPickerCell.swift index 6bf633e81..37b0b2e15 100644 --- a/Session/Media Viewing & Editing/GIFs/GifPickerCell.swift +++ b/Session/Media Viewing & Editing/GIFs/GifPickerCell.swift @@ -218,6 +218,7 @@ class GifPickerCell: UICollectionViewCell { return } imageView.image = image + imageView.accessibilityIdentifier = "gif cell" self.themeBackgroundColor = nil if self.isCellSelected { From 379f5c82ee69aa39fce40bf6200f507dcd3edc31 Mon Sep 17 00:00:00 2001 From: Emily <92288602+burtonemily@users.noreply.github.com> Date: Thu, 2 Feb 2023 11:41:09 +1100 Subject: [PATCH 03/11] Adding ids to photo library and editing media page --- Scripts/LintLocalizableStrings.swift | 3 ++- Session.xcodeproj/project.pbxproj | 2 +- Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme | 5 +++++ Session/Onboarding/RegisterVC.swift | 2 +- Session/Shared/Views/SessionAvatarCell.swift | 1 + 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Scripts/LintLocalizableStrings.swift b/Scripts/LintLocalizableStrings.swift index 3f0860735..ef2289f0b 100755 --- a/Scripts/LintLocalizableStrings.swift +++ b/Scripts/LintLocalizableStrings.swift @@ -58,7 +58,8 @@ var executableFiles: [String] = { func contents(atPath path: String) -> String { print("Path: \(path)") guard let data = fileManager.contents(atPath: path), let content = String(data: data, encoding: .utf8) else { - fatalError("Could not read from path: \(path)") +// fatalError("Could not read from path: \(path)") + return "" } return content diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 16253cb68..1770cceb3 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5087,7 +5087,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Scripts/LintLocalizableStrings.swift\"\n"; + shellScript = "#\"${SRCROOT}/Scripts/LintLocalizableStrings.swift\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme b/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme index ca157a055..70f466439 100644 --- a/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme +++ b/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme @@ -184,6 +184,11 @@ value = "disable" isEnabled = "YES"> + + Date: Fri, 3 Feb 2023 13:28:51 +1100 Subject: [PATCH 04/11] Adding ids for the new read status --- Session/Conversations/Message Cells/VisibleMessageCell.swift | 2 ++ Session/Shared/Views/SessionAvatarCell.swift | 1 + 2 files changed, 3 insertions(+) diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index 952319d9e..8e419b5dc 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -150,6 +150,7 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { internal lazy var messageStatusLabel: UILabel = { let result = UILabel() + result.accessibilityIdentifier = "Message sent status" result.accessibilityLabel = "Message sent status" result.font = .systemFont(ofSize: Values.verySmallFontSize) result.themeTextColor = .messageBubble_deliveryStatus @@ -159,6 +160,7 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { internal lazy var messageStatusImageView: UIImageView = { let result = UIImageView() + result.accessibilityIdentifier = "Message sent status tick" result.accessibilityLabel = "Message sent status tick" result.contentMode = .scaleAspectFit result.themeTintColor = .messageBubble_deliveryStatus diff --git a/Session/Shared/Views/SessionAvatarCell.swift b/Session/Shared/Views/SessionAvatarCell.swift index 8a95d8fda..b7f827946 100644 --- a/Session/Shared/Views/SessionAvatarCell.swift +++ b/Session/Shared/Views/SessionAvatarCell.swift @@ -267,6 +267,7 @@ class SessionAvatarCell: UITableViewCell { } let completion: (Bool) -> Void = { [weak self] complete in self?.displayNameTextField.text = self?.originalInputValue + self?.displayNameContainer.accessibilityLabel = self?.displayNameLabel.text } if animated { From b22e303d40838fdb0603a9b229f0b72f1d859472 Mon Sep 17 00:00:00 2001 From: Emily <92288602+burtonemily@users.noreply.github.com> Date: Wed, 8 Feb 2023 16:16:20 +1100 Subject: [PATCH 05/11] Adding in accessibility id for the new read/sent/sending status --- Session/Conversations/Message Cells/VisibleMessageCell.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index 8e419b5dc..9ccb6f916 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -153,7 +153,7 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { result.accessibilityIdentifier = "Message sent status" result.accessibilityLabel = "Message sent status" result.font = .systemFont(ofSize: Values.verySmallFontSize) - result.themeTextColor = .messageBubble_deliveryStatus + result.themeTextColor = .messageBubble_deliveryStatus return result }() @@ -422,6 +422,7 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { messageStatusLabel.text = statusText messageStatusLabel.themeTextColor = tintColor messageStatusImageView.image = image + messageStatusImageView.accessibilityIdentifier = "Message sent status: \(statusText)" messageStatusImageView.themeTintColor = tintColor messageStatusContainerView.isHidden = ( cellViewModel.variant != .standardOutgoing || From 361fa407d58bb576d5e907e6ccbe590bcca3b4fe Mon Sep 17 00:00:00 2001 From: Emily <92288602+burtonemily@users.noreply.github.com> Date: Mon, 13 Feb 2023 15:23:30 +1100 Subject: [PATCH 06/11] Updating read status accessibility ids --- .../Context Menu/ContextMenuVC+Action.swift | 16 ++++++++++----- .../Message Cells/VisibleMessageCell.swift | 20 +++++++++---------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Session/Conversations/Context Menu/ContextMenuVC+Action.swift b/Session/Conversations/Context Menu/ContextMenuVC+Action.swift index b8f19816b..fbce5ed60 100644 --- a/Session/Conversations/Context Menu/ContextMenuVC+Action.swift +++ b/Session/Conversations/Context Menu/ContextMenuVC+Action.swift @@ -46,14 +46,17 @@ extension ContextMenuVC { static func copy(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( icon: UIImage(named: "ic_copy"), - title: "copy".localized() + title: "copy".localized(), + accessibilityLabel: "Copy text" ) { delegate?.copy(cellViewModel) } } static func copySessionID(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( icon: UIImage(named: "ic_copy"), - title: "vc_conversation_settings_copy_session_id_button_title".localized() + title: "vc_conversation_settings_copy_session_id_button_title".localized(), + accessibilityLabel: "Copy Session ID" + ) { delegate?.copySessionID(cellViewModel) } } @@ -76,14 +79,16 @@ extension ContextMenuVC { static func ban(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( icon: UIImage(named: "ic_block"), - title: "context_menu_ban_user".localized() + title: "context_menu_ban_user".localized(), + accessibilityLabel: "Ban user" ) { delegate?.ban(cellViewModel) } } static func banAndDeleteAllMessages(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( icon: UIImage(named: "ic_block"), - title: "context_menu_ban_and_delete_all".localized() + title: "context_menu_ban_and_delete_all".localized(), + accessibilityLabel: "Ban user and delete" ) { delegate?.banAndDeleteAllMessages(cellViewModel) } } @@ -96,7 +101,8 @@ extension ContextMenuVC { static func emojiPlusButton(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( - isEmojiPlus: true + isEmojiPlus: true, + accessibilityLabel: "Add emoji" ) { delegate?.showFullEmojiKeyboard(cellViewModel) } } diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index 9ccb6f916..23c328844 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -422,7 +422,7 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { messageStatusLabel.text = statusText messageStatusLabel.themeTextColor = tintColor messageStatusImageView.image = image - messageStatusImageView.accessibilityIdentifier = "Message sent status: \(statusText)" + messageStatusLabel.accessibilityIdentifier = "Message sent status: \(statusText ?? "invalid")" messageStatusImageView.themeTintColor = tintColor messageStatusContainerView.isHidden = ( cellViewModel.variant != .standardOutgoing || @@ -765,15 +765,15 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { // MARK: - Interaction - override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { - if let bodyTappableLabel = bodyTappableLabel { - let btIngetBodyTappableLabelCoordinates = convert(point, to: bodyTappableLabel) - if bodyTappableLabel.bounds.contains(btIngetBodyTappableLabelCoordinates) { - return bodyTappableLabel - } - } - return super.hitTest(point, with: event) - } +// override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { +// if let bodyTappableLabel = bodyTappableLabel { +// let btIngetBodyTappableLabelCoordinates = convert(point, to: bodyTappableLabel) +// if bodyTappableLabel.bounds.contains(btIngetBodyTappableLabelCoordinates) { +// return bodyTappableLabel +// } +// } +// return super.hitTest(point, with: event) +// } override func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { return true // Needed for the pan gesture recognizer to work with the table view's pan gesture recognizer From 5e041ddb41db075344c2aaf58398c9c9afb62a77 Mon Sep 17 00:00:00 2001 From: RyanZhao Date: Mon, 27 Feb 2023 11:34:39 +1100 Subject: [PATCH 07/11] Update LintLocalizableStrings.swift --- Scripts/LintLocalizableStrings.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/LintLocalizableStrings.swift b/Scripts/LintLocalizableStrings.swift index ef2289f0b..fa1c3fb87 100755 --- a/Scripts/LintLocalizableStrings.swift +++ b/Scripts/LintLocalizableStrings.swift @@ -58,7 +58,7 @@ var executableFiles: [String] = { func contents(atPath path: String) -> String { print("Path: \(path)") guard let data = fileManager.contents(atPath: path), let content = String(data: data, encoding: .utf8) else { -// fatalError("Could not read from path: \(path)") + fatalError("Could not read from path: \(path)") return "" } From 04ac3375396cdd56935458eaea2046a5b4047f9a Mon Sep 17 00:00:00 2001 From: RyanZhao Date: Mon, 27 Feb 2023 11:35:41 +1100 Subject: [PATCH 08/11] Update project.pbxproj --- Session.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 9161108bf..3f59874b7 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5093,7 +5093,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#\"${SRCROOT}/Scripts/LintLocalizableStrings.swift\"\n"; + shellScript = "\"${SRCROOT}/Scripts/LintLocalizableStrings.swift\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ From 2abc4f380d74e07bb2a10821d7a869af60aae335 Mon Sep 17 00:00:00 2001 From: RyanZhao Date: Mon, 27 Feb 2023 11:36:06 +1100 Subject: [PATCH 09/11] Update LintLocalizableStrings.swift --- Scripts/LintLocalizableStrings.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/LintLocalizableStrings.swift b/Scripts/LintLocalizableStrings.swift index fa1c3fb87..3f0860735 100755 --- a/Scripts/LintLocalizableStrings.swift +++ b/Scripts/LintLocalizableStrings.swift @@ -59,7 +59,6 @@ func contents(atPath path: String) -> String { print("Path: \(path)") guard let data = fileManager.contents(atPath: path), let content = String(data: data, encoding: .utf8) else { fatalError("Could not read from path: \(path)") - return "" } return content From 750dd41bea2219712cb36620450738af038bd467 Mon Sep 17 00:00:00 2001 From: RyanZhao Date: Mon, 27 Feb 2023 11:36:43 +1100 Subject: [PATCH 10/11] Update Session.xcscheme --- Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme b/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme index 70f466439..ea85c66b2 100644 --- a/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme +++ b/Session.xcodeproj/xcshareddata/xcschemes/Session.xcscheme @@ -157,7 +157,7 @@ - - Date: Mon, 27 Feb 2023 11:38:01 +1100 Subject: [PATCH 11/11] update build number --- Session.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 3f59874b7..d8fbdb833 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -6040,7 +6040,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 393; + CURRENT_PROJECT_VERSION = 394; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6113,7 +6113,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 393; + CURRENT_PROJECT_VERSION = 394; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6179,7 +6179,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 393; + CURRENT_PROJECT_VERSION = 394; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6253,7 +6253,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 393; + CURRENT_PROJECT_VERSION = 394; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -7181,7 +7181,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 393; + CURRENT_PROJECT_VERSION = 394; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -7253,7 +7253,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 393; + CURRENT_PROJECT_VERSION = 394; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)",