2022-12-19 11:28:55 +00:00
|
|
|
import DesignSystem
|
2023-01-12 05:58:04 +00:00
|
|
|
import EmojiText
|
2023-01-17 10:36:01 +00:00
|
|
|
import Env
|
|
|
|
import Models
|
2023-02-18 06:26:48 +00:00
|
|
|
import Network
|
2024-01-06 18:27:26 +00:00
|
|
|
import StatusKit
|
2023-01-17 10:36:01 +00:00
|
|
|
import SwiftUI
|
2022-12-19 11:28:55 +00:00
|
|
|
|
2023-09-18 19:03:52 +00:00
|
|
|
@MainActor
|
2022-12-19 11:28:55 +00:00
|
|
|
struct NotificationRowView: View {
|
2023-09-18 19:03:52 +00:00
|
|
|
@Environment(Theme.self) private var theme
|
2022-12-19 11:28:55 +00:00
|
|
|
@Environment(\.redactionReasons) private var reasons
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2023-01-27 15:58:04 +00:00
|
|
|
let notification: ConsolidatedNotification
|
2023-02-15 08:04:35 +00:00
|
|
|
let client: Client
|
|
|
|
let routerPath: RouterPath
|
2023-02-17 17:17:51 +00:00
|
|
|
let followRequests: [Account]
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-19 11:28:55 +00:00
|
|
|
var body: some View {
|
2023-01-27 15:58:04 +00:00
|
|
|
HStack(alignment: .top, spacing: 8) {
|
|
|
|
if notification.accounts.count == 1 {
|
|
|
|
makeAvatarView(type: notification.type)
|
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
|
|
|
.accessibilityHidden(true)
|
2023-01-27 15:58:04 +00:00
|
|
|
} else {
|
|
|
|
makeNotificationIconView(type: notification.type)
|
2023-11-20 09:59:49 +00:00
|
|
|
.frame(width: AvatarView.FrameConfig.status.width,
|
|
|
|
height: AvatarView.FrameConfig.status.height)
|
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
|
|
|
.accessibilityHidden(true)
|
2023-01-27 15:58:04 +00:00
|
|
|
}
|
2024-01-22 08:05:22 +00:00
|
|
|
VStack(alignment: .leading, spacing: 0) {
|
2023-01-27 15:58:04 +00:00
|
|
|
makeMainLabel(type: notification.type)
|
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
|
|
|
// The main label is redundant for mentions
|
|
|
|
.accessibilityHidden(notification.type == .mention)
|
2023-01-27 15:58:04 +00:00
|
|
|
makeContent(type: notification.type)
|
|
|
|
if notification.type == .follow_request,
|
2023-02-18 06:26:48 +00:00
|
|
|
followRequests.map(\.id).contains(notification.accounts[0].id)
|
|
|
|
{
|
2023-01-27 15:58:04 +00:00
|
|
|
FollowRequestButtons(account: notification.accounts[0])
|
2022-12-19 11:28:55 +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
|
|
|
.accessibilityElement(children: .combine)
|
|
|
|
.accessibilityActions {
|
|
|
|
if notification.type == .follow {
|
|
|
|
accessibilityUserActions
|
|
|
|
}
|
|
|
|
}
|
2023-01-30 06:27:06 +00:00
|
|
|
.alignmentGuide(.listRowSeparatorLeading) { _ in
|
|
|
|
-100
|
2023-01-29 15:06:46 +00:00
|
|
|
}
|
2022-12-19 11:28:55 +00:00
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-24 09:14:47 +00:00
|
|
|
private func makeAvatarView(type: Models.Notification.NotificationType) -> some View {
|
|
|
|
ZStack(alignment: .topLeading) {
|
2023-11-27 08:00:52 +00:00
|
|
|
AvatarView(notification.accounts[0].avatar)
|
2023-01-27 15:58:04 +00:00
|
|
|
makeNotificationIconView(type: type)
|
|
|
|
.offset(x: -8, y: -8)
|
2022-12-24 09:14:47 +00:00
|
|
|
}
|
2022-12-26 07:47:41 +00:00
|
|
|
.contentShape(Rectangle())
|
|
|
|
.onTapGesture {
|
2023-01-27 15:58:04 +00:00
|
|
|
routerPath.navigate(to: .accountDetailWithAccount(account: notification.accounts[0]))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private func makeNotificationIconView(type: Models.Notification.NotificationType) -> some View {
|
|
|
|
ZStack(alignment: .center) {
|
|
|
|
Circle()
|
|
|
|
.strokeBorder(Color.white, lineWidth: 1)
|
2023-02-25 18:54:46 +00:00
|
|
|
.background(Circle().foregroundColor(type.tintColor(isPrivate: notification.status?.visibility == .direct)))
|
2023-01-27 15:58:04 +00:00
|
|
|
.frame(width: 24, height: 24)
|
|
|
|
|
2023-02-28 17:48:22 +00:00
|
|
|
type.icon(isPrivate: notification.status?.visibility == .direct)
|
2023-01-27 15:58:04 +00:00
|
|
|
.resizable()
|
2023-02-25 17:12:31 +00:00
|
|
|
.scaledToFit()
|
2023-01-27 15:58:04 +00:00
|
|
|
.frame(width: 12, height: 12)
|
|
|
|
.foregroundColor(.white)
|
2022-12-26 07:47:41 +00:00
|
|
|
}
|
2022-12-24 09:14:47 +00:00
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-24 09:14:47 +00:00
|
|
|
private func makeMainLabel(type: Models.Notification.NotificationType) -> some View {
|
2023-01-27 15:58:04 +00:00
|
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
|
|
if notification.accounts.count > 1 {
|
|
|
|
ScrollView(.horizontal, showsIndicators: false) {
|
|
|
|
LazyHStack(spacing: 8) {
|
|
|
|
ForEach(notification.accounts) { account in
|
2023-11-27 08:00:52 +00:00
|
|
|
AvatarView(account.avatar)
|
2023-01-27 15:58:04 +00:00
|
|
|
.contentShape(Rectangle())
|
|
|
|
.onTapGesture {
|
|
|
|
routerPath.navigate(to: .accountDetailWithAccount(account: account))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.padding(.leading, 1)
|
2023-11-20 09:59:49 +00:00
|
|
|
.frame(height: AvatarView.FrameConfig.status.size.height + 2)
|
2023-01-27 15:58:04 +00:00
|
|
|
}.offset(y: -1)
|
|
|
|
}
|
2023-12-27 16:12:48 +00:00
|
|
|
if !reasons.contains(.placeholder) {
|
2023-12-27 15:07:16 +00:00
|
|
|
HStack(spacing: 0) {
|
|
|
|
EmojiTextApp(.init(stringValue: notification.accounts[0].safeDisplayName),
|
|
|
|
emojis: notification.accounts[0].emojis,
|
|
|
|
append: {
|
|
|
|
(notification.accounts.count > 1
|
|
|
|
? Text("notifications-others-count \(notification.accounts.count - 1)")
|
|
|
|
.font(.scaledSubheadline)
|
|
|
|
.fontWeight(.regular)
|
|
|
|
: Text(" ")) +
|
|
|
|
Text(type.label(count: notification.accounts.count))
|
|
|
|
.font(.scaledSubheadline)
|
|
|
|
.fontWeight(.regular) +
|
|
|
|
Text(" ⸱ ")
|
|
|
|
.font(.scaledFootnote)
|
|
|
|
.fontWeight(.regular)
|
|
|
|
.foregroundStyle(.secondary) +
|
|
|
|
Text(notification.createdAt.relativeFormatted)
|
|
|
|
.font(.scaledFootnote)
|
|
|
|
.fontWeight(.regular)
|
|
|
|
.foregroundStyle(.secondary)
|
|
|
|
})
|
|
|
|
.font(.scaledSubheadline)
|
2024-02-05 07:55:24 +00:00
|
|
|
.emojiText.size(Font.scaledSubheadlineFont.emojiSize)
|
|
|
|
.emojiText.baselineOffset(Font.scaledSubheadlineFont.emojiBaselineOffset)
|
2023-12-27 15:07:16 +00:00
|
|
|
.fontWeight(.semibold)
|
|
|
|
.lineLimit(3)
|
|
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
|
|
if let status = notification.status, notification.type == .mention {
|
|
|
|
Group {
|
|
|
|
Text(" ⸱ ")
|
|
|
|
Text(Image(systemName: status.visibility.iconName))
|
|
|
|
}
|
|
|
|
.accessibilityHidden(true)
|
|
|
|
.font(.scaledFootnote)
|
|
|
|
.fontWeight(.regular)
|
|
|
|
.foregroundStyle(.secondary)
|
2023-01-21 14:16:52 +00:00
|
|
|
}
|
2023-12-27 15:07:16 +00:00
|
|
|
Spacer()
|
2023-01-21 14:16:52 +00:00
|
|
|
}
|
2023-12-27 15:07:16 +00:00
|
|
|
} else {
|
|
|
|
Text(" ")
|
|
|
|
.font(.scaledSubheadline)
|
|
|
|
.fontWeight(.semibold)
|
2022-12-24 09:14:47 +00:00
|
|
|
}
|
|
|
|
}
|
2022-12-26 07:47:41 +00:00
|
|
|
.contentShape(Rectangle())
|
|
|
|
.onTapGesture {
|
2023-02-13 06:00:42 +00:00
|
|
|
if notification.accounts.count == 1 {
|
|
|
|
routerPath.navigate(to: .accountDetailWithAccount(account: notification.accounts[0]))
|
|
|
|
} else {
|
|
|
|
routerPath.navigate(to: .accountsList(accounts: notification.accounts))
|
|
|
|
}
|
2022-12-26 07:47:41 +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
|
|
|
.accessibilityElement(children: .combine)
|
2022-12-24 09:14:47 +00:00
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-24 09:14:47 +00:00
|
|
|
@ViewBuilder
|
|
|
|
private func makeContent(type: Models.Notification.NotificationType) -> some View {
|
|
|
|
if let status = notification.status {
|
2022-12-29 16:22:07 +00:00
|
|
|
HStack {
|
2023-01-17 06:54:59 +00:00
|
|
|
if type == .mention {
|
2023-09-18 05:01:23 +00:00
|
|
|
StatusRowView(viewModel: .init(status: status,
|
|
|
|
client: client,
|
|
|
|
routerPath: routerPath,
|
|
|
|
showActions: true))
|
2024-02-14 11:48:14 +00:00
|
|
|
.environment(\.isMediaCompact, false)
|
2023-01-17 06:54:59 +00:00
|
|
|
} else {
|
2023-09-18 05:01:23 +00:00
|
|
|
StatusRowView(viewModel: .init(status: status,
|
|
|
|
client: client,
|
|
|
|
routerPath: routerPath,
|
|
|
|
showActions: false,
|
|
|
|
textDisabled: true))
|
2023-01-21 14:16:52 +00:00
|
|
|
.lineLimit(4)
|
2024-01-21 18:46:29 +00:00
|
|
|
.environment(\.isMediaCompact, true)
|
2023-01-17 06:54:59 +00:00
|
|
|
}
|
2022-12-29 16:22:07 +00:00
|
|
|
Spacer()
|
|
|
|
}
|
2023-02-17 17:17:51 +00:00
|
|
|
.environment(\.isCompact, true)
|
2022-12-24 09:14:47 +00:00
|
|
|
} else {
|
2022-12-26 07:47:41 +00:00
|
|
|
Group {
|
2023-01-27 15:58:04 +00:00
|
|
|
Text("@\(notification.accounts[0].acct)")
|
2023-01-17 18:41:46 +00:00
|
|
|
.font(.scaledCallout)
|
2023-12-04 14:49:44 +00:00
|
|
|
.foregroundStyle(.secondary)
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-26 07:47:41 +00:00
|
|
|
if type == .follow {
|
2023-01-27 15:58:04 +00:00
|
|
|
EmojiTextApp(notification.accounts[0].note,
|
|
|
|
emojis: notification.accounts[0].emojis)
|
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
|
|
|
.accessibilityLabel(notification.accounts[0].note.asRawText)
|
2022-12-26 07:47:41 +00:00
|
|
|
.lineLimit(3)
|
2023-01-17 18:41:46 +00:00
|
|
|
.font(.scaledCallout)
|
2024-02-05 07:55:24 +00:00
|
|
|
.emojiText.size(Font.scaledCalloutFont.emojiSize)
|
|
|
|
.emojiText.baselineOffset(Font.scaledCalloutFont.emojiBaselineOffset)
|
2023-12-04 14:49:44 +00:00
|
|
|
.foregroundStyle(.secondary)
|
2022-12-26 07:47:41 +00:00
|
|
|
.environment(\.openURL, OpenURLAction { url in
|
2023-01-17 14:14:50 +00:00
|
|
|
routerPath.handle(url: url)
|
2022-12-26 07:47:41 +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
|
|
|
.accessibilityAddTraits(.isButton)
|
2022-12-26 07:47:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
.contentShape(Rectangle())
|
|
|
|
.onTapGesture {
|
2023-02-13 06:00:42 +00:00
|
|
|
if notification.accounts.count == 1 {
|
|
|
|
routerPath.navigate(to: .accountDetailWithAccount(account: notification.accounts[0]))
|
|
|
|
} else {
|
|
|
|
routerPath.navigate(to: .accountsList(accounts: notification.accounts))
|
|
|
|
}
|
2022-12-24 09:14:47 +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
|
|
|
|
|
|
|
// MARK: - Accessibility actions
|
|
|
|
|
|
|
|
@ViewBuilder
|
|
|
|
private var accessibilityUserActions: some View {
|
|
|
|
ForEach(notification.accounts) { account in
|
|
|
|
Button("@\(account.username)") {
|
2023-11-07 10:22:36 +00:00
|
|
|
HapticManager.shared.fireHaptic(.notification(.success))
|
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
|
|
|
routerPath.navigate(to: .accountDetail(id: account.id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-12-19 11:28:55 +00:00
|
|
|
}
|