Skip to content

Commit

Permalink
[GOVUKAPP-1024] Update edit actions voice over text (#223)
Browse files Browse the repository at this point in the history
* Updates VO accessibility text for edit actions

Following accessibility audit.

* Disable file_length RecentActivityListViewController

Also moves RecentActivitySection to own file.
  • Loading branch information
1pretz1 authored Jan 14, 2025
1 parent 048faa0 commit 96c99e9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
4 changes: 4 additions & 0 deletions GovUK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
16D0D0432CC6819C00944D79 /* TopicTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D0D0422CC6818D00944D79 /* TopicTableViewCell.swift */; };
16D17D422CC01C7600E99794 /* TopicRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D17D412CC01C6A00E99794 /* TopicRowView.swift */; };
16E5AD432C6D5719000B8B3A /* SearchWidgetStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16E5AD422C6D5719000B8B3A /* SearchWidgetStackView.swift */; };
16E8794C2D2D875D00BCC0FC /* RecentActivitySection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16E8794B2D2D875C00BCC0FC /* RecentActivitySection.swift */; };
16EE1A412C6F8968005E820F /* SearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16EE1A402C6F8968005E820F /* SearchViewController.swift */; };
16EE1A432C6F89D9005E820F /* SearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16EE1A422C6F89D9005E820F /* SearchViewModel.swift */; };
16EE1A452C6F8ED3005E820F /* SearchCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16EE1A442C6F8ED3005E820F /* SearchCoordinator.swift */; };
Expand Down Expand Up @@ -283,6 +284,7 @@
16D0D0422CC6818D00944D79 /* TopicTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopicTableViewCell.swift; sourceTree = "<group>"; };
16D17D412CC01C6A00E99794 /* TopicRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopicRowView.swift; sourceTree = "<group>"; };
16E5AD422C6D5719000B8B3A /* SearchWidgetStackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchWidgetStackView.swift; sourceTree = "<group>"; };
16E8794B2D2D875C00BCC0FC /* RecentActivitySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentActivitySection.swift; sourceTree = "<group>"; };
16EE1A402C6F8968005E820F /* SearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewController.swift; sourceTree = "<group>"; };
16EE1A422C6F89D9005E820F /* SearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewModel.swift; sourceTree = "<group>"; };
16EE1A442C6F8ED3005E820F /* SearchCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchCoordinator.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -715,6 +717,7 @@
5DE2834D2CAC48DC00E95800 /* ActivityItemCreateParams.swift */,
5DCDA0FE2CA20C2C00A6DF90 /* MonthGroupKey.swift */,
4E94E8D82C8B18ED00906803 /* RecentActivitiesViewStructure.swift */,
16E8794B2D2D875C00BCC0FC /* RecentActivitySection.swift */,
);
path = RecentActivity;
sourceTree = "<group>";
Expand Down Expand Up @@ -1595,6 +1598,7 @@
5DCDA0FF2CA20C2C00A6DF90 /* MonthGroupKey.swift in Sources */,
5DE970572C297CFE009D66C4 /* AppEvent+Convenience.swift in Sources */,
5D0A81292CEDCD0300446F63 /* UserProperty.swift in Sources */,
16E8794C2D2D875D00BCC0FC /* RecentActivitySection.swift in Sources */,
160A02682C208B9800FE01EB /* AnalyticsService.swift in Sources */,
5D02783C2C29D9BB00F2A4EB /* LaunchViewModel.swift in Sources */,
5DC069ED2C3BFD6400A81AAE /* AccessibilityManager.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Foundation

struct RecentActivitySection: Hashable {
let title: String
let items: [ActivityItem]
}
22 changes: 22 additions & 0 deletions Production/govuk_ios/Resources/Strings/RecentActivity.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,28 @@
}
}
},
"doneButtonAccessibilityTitle" : {
"extractionState" : "manual",
"localizations" : {
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "Finish editing pages you've visited"
}
}
}
},
"editButtonAccessibilityTitle" : {
"extractionState" : "manual",
"localizations" : {
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "Edit pages you’ve visited"
}
}
}
},
"recentActivitiesTodaysListTitle" : {
"extractionState" : "manual",
"localizations" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// swiftlint:disable file_length
import Foundation
import UIKit

Expand Down Expand Up @@ -141,6 +142,7 @@ class RecentActivityListViewController: BaseViewController {
informationScrollView.addSubview(informationView)
removeBarButtonItem.isEnabled = false
configureToolbarItems()
setEditButtonAccessibilityLabel()
}

private func configureConstraints() {
Expand Down Expand Up @@ -234,6 +236,12 @@ class RecentActivityListViewController: BaseViewController {
])
}

private func setEditButtonAccessibilityLabel() {
editButtonItem.accessibilityLabel = String.recentActivity.localized(
"editButtonAccessibilityTitle"
)
}

override func setEditing(_ editing: Bool, animated: Bool) {
// Needs to be before super to get correct values
trackEditingEvent()
Expand All @@ -242,8 +250,16 @@ class RecentActivityListViewController: BaseViewController {
configureToolbarItems(animated: false)
self.tabBarController?.tabBar.isHidden = editing
editingToolbar.isHidden = !editing

if !editing {
editButtonItem.accessibilityLabel = String.recentActivity.localized(
"editButtonAccessibilityTitle"
)
viewModel.endEditing()
} else {
editButtonItem.accessibilityLabel = String.recentActivity.localized(
"doneButtonAccessibilityTitle"
)
}
}

Expand Down Expand Up @@ -390,8 +406,4 @@ extension RecentActivityListViewController: TrackableScreen {
viewModel.pageTitle
}
}

struct RecentActivitySection: Hashable {
let title: String
let items: [ActivityItem]
}
// swiftlint:enable file_length

0 comments on commit 96c99e9

Please sign in to comment.