2022-12-19 11:28:55 +00:00
|
|
|
import DesignSystem
|
2023-01-17 10:36:01 +00:00
|
|
|
import EmojiText
|
|
|
|
import Env
|
2023-03-19 17:36:57 +00:00
|
|
|
import Foundation
|
2023-01-17 10:36:01 +00:00
|
|
|
import Models
|
2022-12-19 14:51:25 +00:00
|
|
|
import Network
|
2022-12-30 18:31:17 +00:00
|
|
|
import Shimmer
|
2023-01-17 10:36:01 +00:00
|
|
|
import SwiftUI
|
2022-11-21 08:31:32 +00:00
|
|
|
|
2023-09-18 19:03:52 +00:00
|
|
|
@MainActor
|
2022-12-18 19:30:19 +00:00
|
|
|
public struct StatusRowView: View {
|
2023-10-23 17:12:25 +00:00
|
|
|
@Environment(\.openWindow) private var openWindow
|
2023-02-22 17:49:17 +00:00
|
|
|
@Environment(\.isInCaptureMode) private var isInCaptureMode: Bool
|
2022-12-17 12:37:46 +00:00
|
|
|
@Environment(\.redactionReasons) private var reasons
|
2023-02-17 17:17:51 +00:00
|
|
|
@Environment(\.isCompact) private var isCompact: Bool
|
2023-08-10 06:58:43 +00:00
|
|
|
@Environment(\.accessibilityVoiceOverEnabled) private var accessibilityVoiceOverEnabled
|
2023-09-16 13:04:42 +00:00
|
|
|
@Environment(\.isStatusFocused) private var isFocused
|
2023-09-18 05:01:23 +00:00
|
|
|
@Environment(\.isStatusReplyToPrevious) private var isStatusReplyToPrevious
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-09-18 05:01:23 +00:00
|
|
|
@Environment(QuickLook.self) private var quickLook
|
2023-09-18 19:03:52 +00:00
|
|
|
@Environment(Theme.self) private var theme
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-09-18 05:01:23 +00:00
|
|
|
@State private var viewModel: StatusRowViewModel
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-09-18 05:01:23 +00:00
|
|
|
public init(viewModel: StatusRowViewModel) {
|
|
|
|
_viewModel = .init(initialValue: viewModel)
|
2022-12-18 19:30:19 +00:00
|
|
|
}
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-01-27 15:51:45 +00:00
|
|
|
var contextMenu: some View {
|
|
|
|
StatusRowContextMenu(viewModel: viewModel)
|
|
|
|
}
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2022-12-18 19:30:19 +00:00
|
|
|
public var body: some View {
|
2023-09-18 05:01:23 +00:00
|
|
|
HStack(spacing: 0) {
|
|
|
|
if isStatusReplyToPrevious {
|
|
|
|
Rectangle()
|
|
|
|
.fill(theme.tintColor)
|
|
|
|
.frame(width: 2)
|
|
|
|
.accessibilityHidden(true)
|
|
|
|
Spacer(minLength: 8)
|
|
|
|
}
|
|
|
|
VStack(alignment: .leading) {
|
|
|
|
if viewModel.isFiltered, let filter = viewModel.filter {
|
|
|
|
switch filter.filter.filterAction {
|
|
|
|
case .warn:
|
|
|
|
makeFilterView(filter: filter.filter)
|
|
|
|
case .hide:
|
|
|
|
EmptyView()
|
2023-01-03 11:24:15 +00:00
|
|
|
}
|
2023-09-18 05:01:23 +00:00
|
|
|
} else {
|
|
|
|
if !isCompact, theme.avatarPosition == .leading {
|
|
|
|
Group {
|
2023-02-17 12:30:56 +00:00
|
|
|
StatusRowReblogView(viewModel: viewModel)
|
|
|
|
StatusRowReplyView(viewModel: viewModel)
|
|
|
|
}
|
2023-09-18 05:01:23 +00:00
|
|
|
.padding(.leading, AvatarView.Size.status.size.width + .statusColumnsSpacing)
|
|
|
|
}
|
|
|
|
HStack(alignment: .top, spacing: .statusColumnsSpacing) {
|
|
|
|
if !isCompact,
|
|
|
|
theme.avatarPosition == .leading
|
|
|
|
{
|
|
|
|
Button {
|
|
|
|
viewModel.navigateToAccountDetail(account: viewModel.finalStatus.account)
|
|
|
|
} label: {
|
|
|
|
AvatarView(url: viewModel.finalStatus.account.avatar, size: .status)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
VStack(alignment: .leading) {
|
|
|
|
if !isCompact, theme.avatarPosition == .top {
|
|
|
|
StatusRowReblogView(viewModel: viewModel)
|
|
|
|
StatusRowReplyView(viewModel: viewModel)
|
2023-02-17 12:30:56 +00:00
|
|
|
}
|
2023-09-18 05:01:23 +00:00
|
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
|
|
if !isCompact {
|
|
|
|
StatusRowHeaderView(viewModel: viewModel)
|
2023-02-17 12:30:56 +00:00
|
|
|
}
|
2023-09-18 05:01:23 +00:00
|
|
|
StatusRowContentView(viewModel: viewModel)
|
|
|
|
.contentShape(Rectangle())
|
|
|
|
.onTapGesture {
|
|
|
|
guard !isFocused else { return }
|
|
|
|
viewModel.navigateToDetail()
|
|
|
|
}
|
|
|
|
.accessibilityActions {
|
|
|
|
if isFocused, viewModel.showActions {
|
|
|
|
accessibilityActions
|
|
|
|
}
|
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView
Previously, this view did not provide the proper context to indicate that it represented a poll.
Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.
* Add poll description in StatusRowView combinedAccessibilityLabel
This largely duplicates the logic in `StatusPollView`.
* Improve accessibility of media attachments
Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.
Now, they are presented with their attachment type.
* Change accessibilityRepresentation of AppAcountsSelectorView
* Change Notifications tab title view accessibility representation to Menu
Previously it would present as a button
* Hide layout `Rectangle`s from accessibility
* Consolidate `StatusRowDetailView` accessibility representation
* Improve readability of Poll accessibility label
* Ensure poll options don’t present as interactive when the poll is finished
* Improve accessibility of StatusRowCardView
Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.
Now, it presents as a single element with the `.link` trait
* Improve accessibility of StatusRowHeaderView
Previously, it had no traits and no actions except inherited ones.
Now it presents as a button, triggering its primary action.
It also has custom actions corresponding to its context menu
* Avoid applying the StatusRowView custom actions to every view when contained
* Provide context for the application name
* Add pauses to StatusRowView combinedAccessibilityLabel
* Hide `TimelineView.scrollToTopView` from accessibility
* Set appropriate font style on Notification header
After the change the Text needed a `.headline` style to match the prior appearance.
* Fix bug in accessibilityRepresentation of TimelineView nav bar title
Previously, it would not display the proper label for .remoteLocal filter options.
* Ensure that pop-up button nav bar titles are interactive
* Ensure TextView responds to Environment.sizeCategory
This resolves #1309
* Fix button
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 16:48:58 +00:00
|
|
|
}
|
2023-09-18 05:01:23 +00:00
|
|
|
}
|
|
|
|
VStack(alignment: .leading, spacing: 12) {
|
|
|
|
if viewModel.showActions, isFocused || theme.statusActionsDisplay != .none, !isInCaptureMode {
|
|
|
|
StatusRowActionsView(viewModel: viewModel)
|
|
|
|
.padding(.top, 8)
|
|
|
|
.tint(isFocused ? theme.tintColor : .gray)
|
|
|
|
.contentShape(Rectangle())
|
|
|
|
.onTapGesture {
|
|
|
|
guard !isFocused else { return }
|
|
|
|
viewModel.navigateToDetail()
|
|
|
|
}
|
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView
Previously, this view did not provide the proper context to indicate that it represented a poll.
Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.
* Add poll description in StatusRowView combinedAccessibilityLabel
This largely duplicates the logic in `StatusPollView`.
* Improve accessibility of media attachments
Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.
Now, they are presented with their attachment type.
* Change accessibilityRepresentation of AppAcountsSelectorView
* Change Notifications tab title view accessibility representation to Menu
Previously it would present as a button
* Hide layout `Rectangle`s from accessibility
* Consolidate `StatusRowDetailView` accessibility representation
* Improve readability of Poll accessibility label
* Ensure poll options don’t present as interactive when the poll is finished
* Improve accessibility of StatusRowCardView
Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.
Now, it presents as a single element with the `.link` trait
* Improve accessibility of StatusRowHeaderView
Previously, it had no traits and no actions except inherited ones.
Now it presents as a button, triggering its primary action.
It also has custom actions corresponding to its context menu
* Avoid applying the StatusRowView custom actions to every view when contained
* Provide context for the application name
* Add pauses to StatusRowView combinedAccessibilityLabel
* Hide `TimelineView.scrollToTopView` from accessibility
* Set appropriate font style on Notification header
After the change the Text needed a `.headline` style to match the prior appearance.
* Fix bug in accessibilityRepresentation of TimelineView nav bar title
Previously, it would not display the proper label for .remoteLocal filter options.
* Ensure that pop-up button nav bar titles are interactive
* Ensure TextView responds to Environment.sizeCategory
This resolves #1309
* Fix button
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 16:48:58 +00:00
|
|
|
}
|
2023-09-18 19:03:52 +00:00
|
|
|
|
2023-10-16 07:26:49 +00:00
|
|
|
if isFocused, !isCompact {
|
2023-09-18 05:01:23 +00:00
|
|
|
StatusRowDetailView(viewModel: viewModel)
|
2023-01-24 18:07:55 +00:00
|
|
|
}
|
2023-09-18 05:01:23 +00:00
|
|
|
}
|
2023-01-24 18:07:55 +00:00
|
|
|
}
|
2023-01-03 11:24:15 +00:00
|
|
|
}
|
2022-12-31 11:29:19 +00:00
|
|
|
}
|
2022-12-23 16:50:51 +00:00
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
}
|
|
|
|
.onAppear {
|
|
|
|
viewModel.markSeen()
|
|
|
|
if reasons.isEmpty {
|
|
|
|
if !isCompact, viewModel.embeddedStatus == nil {
|
|
|
|
Task {
|
|
|
|
await viewModel.loadEmbeddedStatus()
|
2023-01-22 08:51:43 +00:00
|
|
|
}
|
2023-01-09 19:51:12 +00:00
|
|
|
}
|
2022-12-27 06:51:44 +00:00
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
}
|
|
|
|
.contextMenu {
|
|
|
|
contextMenu
|
2023-07-03 05:40:49 +00:00
|
|
|
.onAppear {
|
|
|
|
Task {
|
|
|
|
await viewModel.loadAuthorRelationship()
|
|
|
|
}
|
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
}
|
|
|
|
.swipeActions(edge: .trailing) {
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
// The actions associated with the swipes are exposed as custom accessibility actions and there is no way to remove them.
|
2023-08-10 06:58:43 +00:00
|
|
|
if !isCompact, accessibilityVoiceOverEnabled == false {
|
2023-03-01 16:34:03 +00:00
|
|
|
StatusRowSwipeView(viewModel: viewModel, mode: .trailing)
|
2023-01-22 05:38:30 +00:00
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
}
|
|
|
|
.swipeActions(edge: .leading) {
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
// The actions associated with the swipes are exposed as custom accessibility actions and there is no way to remove them.
|
2023-08-10 06:58:43 +00:00
|
|
|
if !isCompact, accessibilityVoiceOverEnabled == false {
|
2023-03-01 16:34:03 +00:00
|
|
|
StatusRowSwipeView(viewModel: viewModel, mode: .leading)
|
2023-02-01 20:51:03 +00:00
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
}
|
|
|
|
.listRowBackground(viewModel.highlightRowColor)
|
|
|
|
.listRowInsets(.init(top: 12,
|
|
|
|
leading: .layoutPadding,
|
|
|
|
bottom: 12,
|
|
|
|
trailing: .layoutPadding))
|
2023-09-16 13:04:42 +00:00
|
|
|
.accessibilityElement(children: isFocused ? .contain : .combine)
|
|
|
|
.accessibilityLabel(isFocused == false && accessibilityVoiceOverEnabled
|
2023-07-19 05:46:25 +00:00
|
|
|
? CombinedAccessibilityLabel(viewModel: viewModel).finalLabel() : Text(""))
|
2023-04-04 06:12:25 +00:00
|
|
|
.accessibilityHidden(viewModel.filter?.filter.filterAction == .hide)
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
.accessibilityAction {
|
2023-09-16 13:04:42 +00:00
|
|
|
guard !isFocused else { return }
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
viewModel.navigateToDetail()
|
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
.accessibilityActions {
|
2023-09-16 13:04:42 +00:00
|
|
|
if isFocused == false, viewModel.showActions {
|
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions
Previously, there was no way to interact with links and hashtags.
Now, these are added to the Actions rotor
* Hide `topPaddingView`s from accessibility
* Fix accessible header rendering in non-filterable TimelineViews
Previously, all navigation title views were assumed to be popup buttons.
Now, we only change the representation for timelines that are filterable.
* Combine tagHeaderView text elements
Previously, these were two separate items
* Prefer shorter Quote action label
* Improve accessibility of StatusEmbeddedView
Previously, this element would be three different ones, and include all the actions on the `StatusRowView` proper. Now, it presents as one element with no actions.
* Add haptics to StatusRowView accessibility actions
* Improve accessibility of ConversationsListRow
This commit adds:
- A combined representation of the component views
- “Unread” as the first part of the label (if this is the case)
- All relevant actions as custom actions
- Reply as magic tap
* Remove StatusRowView accessibilityActions if viewModel.showActions is false
* Hide media attachments from accessibility if the view is not focused
* Combine NotificationRowView accessibility elements; add user actions
Previously, there was no real way to interact with these notifications.
Now, the notifications that show the actions row have the appropriate StatusRowView-derived actions, and new followers notifications have more actions that let you see each user’s profile.
* Prefer @Environment’s `accessibilityEnabled` over `isVoiceOverRunning`
This way we can cater for Voice Control, Full Keyboard Access and Switch Control as well.
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 06:52:29 +00:00
|
|
|
accessibilityActions
|
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
}
|
|
|
|
.background {
|
|
|
|
Color.clear
|
|
|
|
.contentShape(Rectangle())
|
|
|
|
.onTapGesture {
|
2023-09-16 13:04:42 +00:00
|
|
|
guard !isFocused else { return }
|
2023-03-01 16:34:03 +00:00
|
|
|
viewModel.navigateToDetail()
|
2023-02-15 18:27:26 +00:00
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
}
|
|
|
|
.overlay {
|
|
|
|
if viewModel.isLoadingRemoteContent {
|
|
|
|
remoteContentLoadingView
|
2023-01-22 05:38:30 +00:00
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
}
|
|
|
|
.alert(isPresented: $viewModel.showDeleteAlert, content: {
|
|
|
|
Alert(
|
|
|
|
title: Text("status.action.delete.confirm.title"),
|
|
|
|
message: Text("status.action.delete.confirm.message"),
|
|
|
|
primaryButton: .destructive(
|
|
|
|
Text("status.action.delete"))
|
|
|
|
{
|
|
|
|
Task {
|
|
|
|
await viewModel.delete()
|
2023-01-12 18:10:40 +00:00
|
|
|
}
|
2023-03-01 16:34:03 +00:00
|
|
|
},
|
|
|
|
secondaryButton: .cancel()
|
2023-02-28 05:58:52 +00:00
|
|
|
)
|
2023-03-01 16:34:03 +00:00
|
|
|
})
|
|
|
|
.alignmentGuide(.listRowSeparatorLeading) { _ in
|
|
|
|
-100
|
2022-12-20 19:33:45 +00:00
|
|
|
}
|
2023-09-18 05:01:23 +00:00
|
|
|
.environment(
|
2023-03-02 19:15:07 +00:00
|
|
|
StatusDataControllerProvider.shared.dataController(for: viewModel.finalStatus,
|
2023-03-02 20:16:03 +00:00
|
|
|
client: viewModel.client)
|
2023-03-01 16:34:03 +00:00
|
|
|
)
|
2023-01-03 11:24:15 +00:00
|
|
|
}
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-02-09 08:12:44 +00:00
|
|
|
@ViewBuilder
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
private var accessibilityActions: some View {
|
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions
Previously, there was no way to interact with links and hashtags.
Now, these are added to the Actions rotor
* Hide `topPaddingView`s from accessibility
* Fix accessible header rendering in non-filterable TimelineViews
Previously, all navigation title views were assumed to be popup buttons.
Now, we only change the representation for timelines that are filterable.
* Combine tagHeaderView text elements
Previously, these were two separate items
* Prefer shorter Quote action label
* Improve accessibility of StatusEmbeddedView
Previously, this element would be three different ones, and include all the actions on the `StatusRowView` proper. Now, it presents as one element with no actions.
* Add haptics to StatusRowView accessibility actions
* Improve accessibility of ConversationsListRow
This commit adds:
- A combined representation of the component views
- “Unread” as the first part of the label (if this is the case)
- All relevant actions as custom actions
- Reply as magic tap
* Remove StatusRowView accessibilityActions if viewModel.showActions is false
* Hide media attachments from accessibility if the view is not focused
* Combine NotificationRowView accessibility elements; add user actions
Previously, there was no real way to interact with these notifications.
Now, the notifications that show the actions row have the appropriate StatusRowView-derived actions, and new followers notifications have more actions that let you see each user’s profile.
* Prefer @Environment’s `accessibilityEnabled` over `isVoiceOverRunning`
This way we can cater for Voice Control, Full Keyboard Access and Switch Control as well.
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 06:52:29 +00:00
|
|
|
// Add reply and quote, which are lost when the swipe actions are removed
|
|
|
|
Button("status.action.reply") {
|
|
|
|
HapticManager.shared.fireHaptic(of: .notification(.success))
|
|
|
|
viewModel.routerPath.presentedSheet = .replyToStatusEditor(status: viewModel.status)
|
|
|
|
}
|
|
|
|
|
|
|
|
Button("settings.swipeactions.status.action.quote") {
|
|
|
|
HapticManager.shared.fireHaptic(of: .notification(.success))
|
|
|
|
viewModel.routerPath.presentedSheet = .quoteStatusEditor(status: viewModel.status)
|
2023-02-09 08:12:44 +00:00
|
|
|
}
|
2023-08-10 06:58:43 +00:00
|
|
|
.disabled(viewModel.status.visibility == .direct || viewModel.status.visibility == .priv)
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-04-04 06:12:25 +00:00
|
|
|
if viewModel.finalStatus.mediaAttachments.isEmpty == false {
|
|
|
|
Button("accessibility.status.media-viewer-action.label") {
|
|
|
|
HapticManager.shared.fireHaptic(of: .notification(.success))
|
2023-10-16 17:08:59 +00:00
|
|
|
let attachments = viewModel.finalStatus.mediaAttachments
|
2023-10-23 17:12:25 +00:00
|
|
|
if ProcessInfo.processInfo.isMacCatalystApp {
|
|
|
|
openWindow(value: WindowDestination.mediaViewer(attachments: attachments,
|
|
|
|
selectedAttachment: attachments[0]))
|
|
|
|
} else {
|
|
|
|
quickLook.prepareFor(selectedMediaAttachment: attachments[0], mediaAttachments: attachments)
|
|
|
|
}
|
2023-04-04 06:12:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-09 08:12:44 +00:00
|
|
|
Button(viewModel.displaySpoiler ? "status.show-more" : "status.show-less") {
|
|
|
|
withAnimation {
|
|
|
|
viewModel.displaySpoiler.toggle()
|
|
|
|
}
|
|
|
|
}
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-02-09 08:12:44 +00:00
|
|
|
Button("@\(viewModel.status.account.username)") {
|
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions
Previously, there was no way to interact with links and hashtags.
Now, these are added to the Actions rotor
* Hide `topPaddingView`s from accessibility
* Fix accessible header rendering in non-filterable TimelineViews
Previously, all navigation title views were assumed to be popup buttons.
Now, we only change the representation for timelines that are filterable.
* Combine tagHeaderView text elements
Previously, these were two separate items
* Prefer shorter Quote action label
* Improve accessibility of StatusEmbeddedView
Previously, this element would be three different ones, and include all the actions on the `StatusRowView` proper. Now, it presents as one element with no actions.
* Add haptics to StatusRowView accessibility actions
* Improve accessibility of ConversationsListRow
This commit adds:
- A combined representation of the component views
- “Unread” as the first part of the label (if this is the case)
- All relevant actions as custom actions
- Reply as magic tap
* Remove StatusRowView accessibilityActions if viewModel.showActions is false
* Hide media attachments from accessibility if the view is not focused
* Combine NotificationRowView accessibility elements; add user actions
Previously, there was no real way to interact with these notifications.
Now, the notifications that show the actions row have the appropriate StatusRowView-derived actions, and new followers notifications have more actions that let you see each user’s profile.
* Prefer @Environment’s `accessibilityEnabled` over `isVoiceOverRunning`
This way we can cater for Voice Control, Full Keyboard Access and Switch Control as well.
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 06:52:29 +00:00
|
|
|
HapticManager.shared.fireHaptic(of: .notification(.success))
|
2023-02-15 07:46:14 +00:00
|
|
|
viewModel.routerPath.navigate(to: .accountDetail(id: viewModel.status.account.id))
|
2023-02-09 08:12:44 +00:00
|
|
|
}
|
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions
Previously, there was no way to interact with links and hashtags.
Now, these are added to the Actions rotor
* Hide `topPaddingView`s from accessibility
* Fix accessible header rendering in non-filterable TimelineViews
Previously, all navigation title views were assumed to be popup buttons.
Now, we only change the representation for timelines that are filterable.
* Combine tagHeaderView text elements
Previously, these were two separate items
* Prefer shorter Quote action label
* Improve accessibility of StatusEmbeddedView
Previously, this element would be three different ones, and include all the actions on the `StatusRowView` proper. Now, it presents as one element with no actions.
* Add haptics to StatusRowView accessibility actions
* Improve accessibility of ConversationsListRow
This commit adds:
- A combined representation of the component views
- “Unread” as the first part of the label (if this is the case)
- All relevant actions as custom actions
- Reply as magic tap
* Remove StatusRowView accessibilityActions if viewModel.showActions is false
* Hide media attachments from accessibility if the view is not focused
* Combine NotificationRowView accessibility elements; add user actions
Previously, there was no real way to interact with these notifications.
Now, the notifications that show the actions row have the appropriate StatusRowView-derived actions, and new followers notifications have more actions that let you see each user’s profile.
* Prefer @Environment’s `accessibilityEnabled` over `isVoiceOverRunning`
This way we can cater for Voice Control, Full Keyboard Access and Switch Control as well.
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 06:52:29 +00:00
|
|
|
|
|
|
|
// Add a reference to the post creator
|
|
|
|
if viewModel.status.account != viewModel.finalStatus.account {
|
|
|
|
Button("@\(viewModel.finalStatus.account.username)") {
|
|
|
|
HapticManager.shared.fireHaptic(of: .notification(.success))
|
|
|
|
viewModel.routerPath.navigate(to: .accountDetail(id: viewModel.finalStatus.account.id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add in each detected link in the content
|
|
|
|
ForEach(viewModel.finalStatus.content.links) { link in
|
|
|
|
switch link.type {
|
2023-07-19 05:46:25 +00:00
|
|
|
case .url:
|
|
|
|
if UIApplication.shared.canOpenURL(link.url) {
|
|
|
|
Button("accessibility.tabs.timeline.content-link-\(link.title)") {
|
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions
Previously, there was no way to interact with links and hashtags.
Now, these are added to the Actions rotor
* Hide `topPaddingView`s from accessibility
* Fix accessible header rendering in non-filterable TimelineViews
Previously, all navigation title views were assumed to be popup buttons.
Now, we only change the representation for timelines that are filterable.
* Combine tagHeaderView text elements
Previously, these were two separate items
* Prefer shorter Quote action label
* Improve accessibility of StatusEmbeddedView
Previously, this element would be three different ones, and include all the actions on the `StatusRowView` proper. Now, it presents as one element with no actions.
* Add haptics to StatusRowView accessibility actions
* Improve accessibility of ConversationsListRow
This commit adds:
- A combined representation of the component views
- “Unread” as the first part of the label (if this is the case)
- All relevant actions as custom actions
- Reply as magic tap
* Remove StatusRowView accessibilityActions if viewModel.showActions is false
* Hide media attachments from accessibility if the view is not focused
* Combine NotificationRowView accessibility elements; add user actions
Previously, there was no real way to interact with these notifications.
Now, the notifications that show the actions row have the appropriate StatusRowView-derived actions, and new followers notifications have more actions that let you see each user’s profile.
* Prefer @Environment’s `accessibilityEnabled` over `isVoiceOverRunning`
This way we can cater for Voice Control, Full Keyboard Access and Switch Control as well.
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 06:52:29 +00:00
|
|
|
HapticManager.shared.fireHaptic(of: .notification(.success))
|
|
|
|
_ = viewModel.routerPath.handle(url: link.url)
|
|
|
|
}
|
2023-07-19 05:46:25 +00:00
|
|
|
}
|
|
|
|
case .hashtag:
|
|
|
|
Button("accessibility.tabs.timeline.content-hashtag-\(link.title)") {
|
|
|
|
HapticManager.shared.fireHaptic(of: .notification(.success))
|
|
|
|
_ = viewModel.routerPath.handle(url: link.url)
|
|
|
|
}
|
|
|
|
case .mention:
|
|
|
|
Button("\(link.title)") {
|
|
|
|
HapticManager.shared.fireHaptic(of: .notification(.success))
|
|
|
|
_ = viewModel.routerPath.handle(url: link.url)
|
|
|
|
}
|
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions
Previously, there was no way to interact with links and hashtags.
Now, these are added to the Actions rotor
* Hide `topPaddingView`s from accessibility
* Fix accessible header rendering in non-filterable TimelineViews
Previously, all navigation title views were assumed to be popup buttons.
Now, we only change the representation for timelines that are filterable.
* Combine tagHeaderView text elements
Previously, these were two separate items
* Prefer shorter Quote action label
* Improve accessibility of StatusEmbeddedView
Previously, this element would be three different ones, and include all the actions on the `StatusRowView` proper. Now, it presents as one element with no actions.
* Add haptics to StatusRowView accessibility actions
* Improve accessibility of ConversationsListRow
This commit adds:
- A combined representation of the component views
- “Unread” as the first part of the label (if this is the case)
- All relevant actions as custom actions
- Reply as magic tap
* Remove StatusRowView accessibilityActions if viewModel.showActions is false
* Hide media attachments from accessibility if the view is not focused
* Combine NotificationRowView accessibility elements; add user actions
Previously, there was no real way to interact with these notifications.
Now, the notifications that show the actions row have the appropriate StatusRowView-derived actions, and new followers notifications have more actions that let you see each user’s profile.
* Prefer @Environment’s `accessibilityEnabled` over `isVoiceOverRunning`
This way we can cater for Voice Control, Full Keyboard Access and Switch Control as well.
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 06:52:29 +00:00
|
|
|
}
|
|
|
|
}
|
2023-02-09 08:12:44 +00:00
|
|
|
}
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-01-03 11:24:15 +00:00
|
|
|
private func makeFilterView(filter: Filter) -> some View {
|
|
|
|
HStack {
|
2023-01-19 17:14:08 +00:00
|
|
|
Text("status.filter.filtered-by-\(filter.title)")
|
2023-01-03 11:24:15 +00:00
|
|
|
Button {
|
|
|
|
withAnimation {
|
|
|
|
viewModel.isFiltered = false
|
|
|
|
}
|
|
|
|
} label: {
|
2023-01-19 17:14:08 +00:00
|
|
|
Text("status.filter.show-anyway")
|
2023-01-03 11:24:15 +00:00
|
|
|
}
|
2022-12-27 08:11:12 +00:00
|
|
|
}
|
2023-04-04 06:12:25 +00:00
|
|
|
.accessibilityAction {
|
|
|
|
viewModel.isFiltered = false
|
|
|
|
}
|
2022-12-16 12:16:48 +00:00
|
|
|
}
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-01-29 10:17:43 +00:00
|
|
|
private var remoteContentLoadingView: some View {
|
|
|
|
ZStack(alignment: .center) {
|
|
|
|
VStack {
|
|
|
|
Spacer()
|
|
|
|
HStack {
|
|
|
|
Spacer()
|
|
|
|
ProgressView()
|
|
|
|
Spacer()
|
|
|
|
}
|
|
|
|
Spacer()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.background(Color.black.opacity(0.40))
|
|
|
|
.transition(.opacity)
|
|
|
|
}
|
2022-11-21 08:31:32 +00:00
|
|
|
}
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
|
2023-03-19 17:36:57 +00:00
|
|
|
/// A utility that creates a suitable combined accessibility label for a `StatusRowView` that is not focused.
|
2023-03-19 16:04:35 +00:00
|
|
|
@MainActor
|
2023-03-19 17:36:57 +00:00
|
|
|
private struct CombinedAccessibilityLabel {
|
2023-03-19 16:04:35 +00:00
|
|
|
let viewModel: StatusRowViewModel
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
|
|
|
|
var hasSpoiler: Bool {
|
|
|
|
viewModel.displaySpoiler && viewModel.finalStatus.spoilerText.asRawText.isEmpty == false
|
|
|
|
}
|
|
|
|
|
|
|
|
var isReply: Bool {
|
|
|
|
if let accountId = viewModel.status.inReplyToAccountId, viewModel.status.mentions.contains(where: { $0.id == accountId }) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
var isBoost: Bool {
|
|
|
|
viewModel.status.reblog != nil
|
|
|
|
}
|
|
|
|
|
2023-04-04 06:12:25 +00:00
|
|
|
var filter: Filter? {
|
|
|
|
guard viewModel.isFiltered else {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return viewModel.filter?.filter
|
|
|
|
}
|
|
|
|
|
2023-03-19 17:36:57 +00:00
|
|
|
func finalLabel() -> Text {
|
2023-04-04 06:12:25 +00:00
|
|
|
if let filter {
|
|
|
|
switch filter.filterAction {
|
2023-07-19 05:46:25 +00:00
|
|
|
case .warn:
|
2023-09-16 12:15:03 +00:00
|
|
|
Text("status.filter.filtered-by-\(filter.title)")
|
2023-07-19 05:46:25 +00:00
|
|
|
case .hide:
|
2023-09-16 12:15:03 +00:00
|
|
|
Text("")
|
2023-04-04 06:12:25 +00:00
|
|
|
}
|
|
|
|
} else {
|
2023-09-16 12:15:03 +00:00
|
|
|
userNamePreamble() +
|
2023-07-19 05:46:25 +00:00
|
|
|
Text(hasSpoiler
|
|
|
|
? viewModel.finalStatus.spoilerText.asRawText
|
|
|
|
: viewModel.finalStatus.content.asRawText
|
|
|
|
) +
|
|
|
|
Text(hasSpoiler
|
|
|
|
? "status.editor.spoiler"
|
|
|
|
: ""
|
|
|
|
) + Text(", ") +
|
|
|
|
pollText() +
|
|
|
|
imageAltText() +
|
|
|
|
Text(viewModel.finalStatus.createdAt.relativeFormatted) + Text(", ") +
|
|
|
|
Text("status.summary.n-replies \(viewModel.finalStatus.repliesCount)") + Text(", ") +
|
|
|
|
Text("status.summary.n-boosts \(viewModel.finalStatus.reblogsCount)") + Text(", ") +
|
|
|
|
Text("status.summary.n-favorites \(viewModel.finalStatus.favouritesCount)")
|
2023-04-04 06:12:25 +00:00
|
|
|
}
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func userNamePreamble() -> Text {
|
|
|
|
switch (isReply, isBoost) {
|
2023-03-19 15:28:06 +00:00
|
|
|
case (true, false):
|
2023-09-16 12:15:03 +00:00
|
|
|
Text("accessibility.status.a-replied-to-\(finalUserDisplayName())") + Text(" ")
|
2023-03-19 15:28:06 +00:00
|
|
|
case (_, true):
|
2023-09-16 12:15:03 +00:00
|
|
|
Text("accessibility.status.a-boosted-b-\(userDisplayName())-\(finalUserDisplayName())") + Text(", ")
|
2023-03-19 15:28:06 +00:00
|
|
|
default:
|
2023-09-16 12:15:03 +00:00
|
|
|
Text(userDisplayName()) + Text(", ")
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func userDisplayName() -> String {
|
|
|
|
viewModel.status.account.displayNameWithoutEmojis.count < 4
|
|
|
|
? viewModel.status.account.safeDisplayName
|
|
|
|
: viewModel.status.account.displayNameWithoutEmojis
|
|
|
|
}
|
|
|
|
|
|
|
|
func finalUserDisplayName() -> String {
|
|
|
|
viewModel.finalStatus.account.displayNameWithoutEmojis.count < 4
|
|
|
|
? viewModel.finalStatus.account.safeDisplayName
|
|
|
|
: viewModel.finalStatus.account.displayNameWithoutEmojis
|
|
|
|
}
|
|
|
|
|
|
|
|
func imageAltText() -> Text {
|
|
|
|
let descriptions = viewModel.finalStatus.mediaAttachments
|
|
|
|
.compactMap(\.description)
|
|
|
|
|
|
|
|
if descriptions.count == 1 {
|
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView
Previously, this view did not provide the proper context to indicate that it represented a poll.
Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.
* Add poll description in StatusRowView combinedAccessibilityLabel
This largely duplicates the logic in `StatusPollView`.
* Improve accessibility of media attachments
Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.
Now, they are presented with their attachment type.
* Change accessibilityRepresentation of AppAcountsSelectorView
* Change Notifications tab title view accessibility representation to Menu
Previously it would present as a button
* Hide layout `Rectangle`s from accessibility
* Consolidate `StatusRowDetailView` accessibility representation
* Improve readability of Poll accessibility label
* Ensure poll options don’t present as interactive when the poll is finished
* Improve accessibility of StatusRowCardView
Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.
Now, it presents as a single element with the `.link` trait
* Improve accessibility of StatusRowHeaderView
Previously, it had no traits and no actions except inherited ones.
Now it presents as a button, triggering its primary action.
It also has custom actions corresponding to its context menu
* Avoid applying the StatusRowView custom actions to every view when contained
* Provide context for the application name
* Add pauses to StatusRowView combinedAccessibilityLabel
* Hide `TimelineView.scrollToTopView` from accessibility
* Set appropriate font style on Notification header
After the change the Text needed a `.headline` style to match the prior appearance.
* Fix bug in accessibilityRepresentation of TimelineView nav bar title
Previously, it would not display the proper label for .remoteLocal filter options.
* Ensure that pop-up button nav bar titles are interactive
* Ensure TextView responds to Environment.sizeCategory
This resolves #1309
* Fix button
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 16:48:58 +00:00
|
|
|
return Text("accessibility.image.alt-text-\(descriptions[0])") + Text(", ")
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
} else if descriptions.count > 1 {
|
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView
Previously, this view did not provide the proper context to indicate that it represented a poll.
Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.
* Add poll description in StatusRowView combinedAccessibilityLabel
This largely duplicates the logic in `StatusPollView`.
* Improve accessibility of media attachments
Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.
Now, they are presented with their attachment type.
* Change accessibilityRepresentation of AppAcountsSelectorView
* Change Notifications tab title view accessibility representation to Menu
Previously it would present as a button
* Hide layout `Rectangle`s from accessibility
* Consolidate `StatusRowDetailView` accessibility representation
* Improve readability of Poll accessibility label
* Ensure poll options don’t present as interactive when the poll is finished
* Improve accessibility of StatusRowCardView
Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.
Now, it presents as a single element with the `.link` trait
* Improve accessibility of StatusRowHeaderView
Previously, it had no traits and no actions except inherited ones.
Now it presents as a button, triggering its primary action.
It also has custom actions corresponding to its context menu
* Avoid applying the StatusRowView custom actions to every view when contained
* Provide context for the application name
* Add pauses to StatusRowView combinedAccessibilityLabel
* Hide `TimelineView.scrollToTopView` from accessibility
* Set appropriate font style on Notification header
After the change the Text needed a `.headline` style to match the prior appearance.
* Fix bug in accessibilityRepresentation of TimelineView nav bar title
Previously, it would not display the proper label for .remoteLocal filter options.
* Ensure that pop-up button nav bar titles are interactive
* Ensure TextView responds to Environment.sizeCategory
This resolves #1309
* Fix button
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 16:48:58 +00:00
|
|
|
return Text("accessibility.image.alt-text-\(descriptions[0])") + Text(", ") + Text("accessibility.image.alt-text-more.label") + Text(", ")
|
|
|
|
} else if viewModel.finalStatus.mediaAttachments.isEmpty == false {
|
|
|
|
let differentTypes = Set(viewModel.finalStatus.mediaAttachments.compactMap(\.localizedTypeDescription)).sorted()
|
|
|
|
return Text("accessibility.status.contains-media.label-\(ListFormatter.localizedString(byJoining: differentTypes))") + Text(", ")
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
} else {
|
|
|
|
return Text("")
|
|
|
|
}
|
|
|
|
}
|
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView
Previously, this view did not provide the proper context to indicate that it represented a poll.
Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.
* Add poll description in StatusRowView combinedAccessibilityLabel
This largely duplicates the logic in `StatusPollView`.
* Improve accessibility of media attachments
Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.
Now, they are presented with their attachment type.
* Change accessibilityRepresentation of AppAcountsSelectorView
* Change Notifications tab title view accessibility representation to Menu
Previously it would present as a button
* Hide layout `Rectangle`s from accessibility
* Consolidate `StatusRowDetailView` accessibility representation
* Improve readability of Poll accessibility label
* Ensure poll options don’t present as interactive when the poll is finished
* Improve accessibility of StatusRowCardView
Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.
Now, it presents as a single element with the `.link` trait
* Improve accessibility of StatusRowHeaderView
Previously, it had no traits and no actions except inherited ones.
Now it presents as a button, triggering its primary action.
It also has custom actions corresponding to its context menu
* Avoid applying the StatusRowView custom actions to every view when contained
* Provide context for the application name
* Add pauses to StatusRowView combinedAccessibilityLabel
* Hide `TimelineView.scrollToTopView` from accessibility
* Set appropriate font style on Notification header
After the change the Text needed a `.headline` style to match the prior appearance.
* Fix bug in accessibilityRepresentation of TimelineView nav bar title
Previously, it would not display the proper label for .remoteLocal filter options.
* Ensure that pop-up button nav bar titles are interactive
* Ensure TextView responds to Environment.sizeCategory
This resolves #1309
* Fix button
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 16:48:58 +00:00
|
|
|
|
|
|
|
func pollText() -> Text {
|
|
|
|
if let poll = viewModel.finalStatus.poll {
|
|
|
|
let showPercentage = poll.expired || poll.voted ?? false
|
|
|
|
let title: LocalizedStringKey = poll.expired
|
|
|
|
? "accessibility.status.poll.finished.label"
|
|
|
|
: "accessibility.status.poll.active.label"
|
|
|
|
|
|
|
|
return poll.options.enumerated().reduce(into: Text(title)) { text, pair in
|
|
|
|
let (index, option) = pair
|
|
|
|
let selected = poll.ownVotes?.contains(index) ?? false
|
2023-04-04 06:03:33 +00:00
|
|
|
let percentage = poll.safeVotersCount > 0 && option.votesCount != nil
|
|
|
|
? Int(round(Double(option.votesCount!) / Double(poll.safeVotersCount) * 100))
|
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView
Previously, this view did not provide the proper context to indicate that it represented a poll.
Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.
* Add poll description in StatusRowView combinedAccessibilityLabel
This largely duplicates the logic in `StatusPollView`.
* Improve accessibility of media attachments
Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.
Now, they are presented with their attachment type.
* Change accessibilityRepresentation of AppAcountsSelectorView
* Change Notifications tab title view accessibility representation to Menu
Previously it would present as a button
* Hide layout `Rectangle`s from accessibility
* Consolidate `StatusRowDetailView` accessibility representation
* Improve readability of Poll accessibility label
* Ensure poll options don’t present as interactive when the poll is finished
* Improve accessibility of StatusRowCardView
Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.
Now, it presents as a single element with the `.link` trait
* Improve accessibility of StatusRowHeaderView
Previously, it had no traits and no actions except inherited ones.
Now it presents as a button, triggering its primary action.
It also has custom actions corresponding to its context menu
* Avoid applying the StatusRowView custom actions to every view when contained
* Provide context for the application name
* Add pauses to StatusRowView combinedAccessibilityLabel
* Hide `TimelineView.scrollToTopView` from accessibility
* Set appropriate font style on Notification header
After the change the Text needed a `.headline` style to match the prior appearance.
* Fix bug in accessibilityRepresentation of TimelineView nav bar title
Previously, it would not display the proper label for .remoteLocal filter options.
* Ensure that pop-up button nav bar titles are interactive
* Ensure TextView responds to Environment.sizeCategory
This resolves #1309
* Fix button
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 16:48:58 +00:00
|
|
|
: 0
|
|
|
|
|
|
|
|
text = text +
|
2023-07-19 05:46:25 +00:00
|
|
|
Text(selected ? "accessibility.status.poll.selected.label" : "") +
|
|
|
|
Text(", ") +
|
|
|
|
Text("accessibility.status.poll.option-prefix-\(index + 1)-of-\(poll.options.count)") +
|
|
|
|
Text(", ") +
|
|
|
|
Text(option.title) +
|
|
|
|
Text(showPercentage ? ", \(percentage)%. " : ". ")
|
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView
Previously, this view did not provide the proper context to indicate that it represented a poll.
Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.
* Add poll description in StatusRowView combinedAccessibilityLabel
This largely duplicates the logic in `StatusPollView`.
* Improve accessibility of media attachments
Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.
Now, they are presented with their attachment type.
* Change accessibilityRepresentation of AppAcountsSelectorView
* Change Notifications tab title view accessibility representation to Menu
Previously it would present as a button
* Hide layout `Rectangle`s from accessibility
* Consolidate `StatusRowDetailView` accessibility representation
* Improve readability of Poll accessibility label
* Ensure poll options don’t present as interactive when the poll is finished
* Improve accessibility of StatusRowCardView
Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.
Now, it presents as a single element with the `.link` trait
* Improve accessibility of StatusRowHeaderView
Previously, it had no traits and no actions except inherited ones.
Now it presents as a button, triggering its primary action.
It also has custom actions corresponding to its context menu
* Avoid applying the StatusRowView custom actions to every view when contained
* Provide context for the application name
* Add pauses to StatusRowView combinedAccessibilityLabel
* Hide `TimelineView.scrollToTopView` from accessibility
* Set appropriate font style on Notification header
After the change the Text needed a `.headline` style to match the prior appearance.
* Fix bug in accessibilityRepresentation of TimelineView nav bar title
Previously, it would not display the proper label for .remoteLocal filter options.
* Ensure that pop-up button nav bar titles are interactive
* Ensure TextView responds to Environment.sizeCategory
This resolves #1309
* Fix button
---------
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 16:48:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return Text("")
|
|
|
|
}
|
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element
Previously, the calendar image was visible with a nonsensical label.
We use the `.combine` operator here to maintain the proper string formatting of the date.
* Improve the accessibility of the AccountDetailHeaderView
Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.
This commit also handles the checkmark for supporter users
* Tweak accessibility of Profile CustomInfoLabels
This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions
* Make Profile tab header image into a Button
This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.
Without the action it would have been considered decorative and should be hidden.
* Change accessibilityLabel of Profile tab nav bar item to ‘Options’
“More” is considered overly generic.
This commit also adds two additional user input label options
* Add accessibility labels for the Profile tab `Picker`
Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense
* Remove StatusRowView swipe actions if VoiceOver is running
These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.
* Fix typo in StatusRowView.accessibilityActions
* Add accessibilityLabels to all StatusRowActionsView actions
* Provide explicit combined accessibility label for unfocused StatusRowView
Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.
Now, we create an explicit combined label when the post isn’t being viewed by itself.
* Improve accessibility of StatusRow(Reblog|Reply)View
They are now combined elements and don’t vend the icon as its own element.
* Add missing punctuation to accessibility hints
* Remove interaction from Profile tab @username and profile note elements
These elements open the profile photo url, which is already provided explicitly through the profile photo
* Prefer spoiler warning for StatusRowView accessibility label
…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.
Additionally, if VoiceOver is running, an action to expand the warning is also available.
* Represent `FollowButton` elements as Toggles to accessibility
Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”
* Remove errant comment
* Add “Verified” accessibilityValue to profile fields
* Fix bug StatusRowView default action bug affecting VoiceOver users
Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.
Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.
* Add header trait to Profile tab display name and familiar followers
These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.
* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link
* Add accessibility container that contextualises the user-defined fields
When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.
* Improve StatusRowView combined accessibility label
It will now start with:
“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.
* Change familiar follows thumbnail to a Button; add display name as accessibility label
Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.
* Revert changes from ZStack with tap gesture to Button
Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.
* Add image alt text to StatusRowView and StatusRowMediaPreviewView
Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.
Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.
* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts
Previously, the icon did not have any accessible representation (an empty text string).
* Add header trait to Profile “pinned post”
* Use the Account.Field.name for the user input label
* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 15:27:18 +00:00
|
|
|
}
|