increas hit area for the media preview upload warning, and hide accessibility for the avatar in the mention suggestions view

This commit is contained in:
Mauro Romito
2025-07-21 12:51:19 +02:00
committed by Mauro
parent a547782e94
commit 5905bc1e76
2 changed files with 18 additions and 8 deletions
@@ -82,6 +82,9 @@ struct MediaUploadPreviewScreen: View {
context.isPresentingMediaCaptionWarning = true
} label: {
CompoundIcon(\.infoSolid, size: .xSmall, relativeTo: .compound.bodyLG)
// Increase hit area
.padding(.leading, 5)
.padding(.vertical, 2)
}
.tint(.compound.iconCriticalPrimary)
.popover(isPresented: $context.isPresentingMediaCaptionWarning, arrowEdge: .bottom) {
@@ -13,14 +13,8 @@ struct MentionSuggestionItemView: View {
var body: some View {
HStack(alignment: .center, spacing: 16) {
switch item.suggestionType {
case .user(let user):
LoadableAvatarImage(url: user.avatarURL, name: user.displayName, contentID: user.id, avatarSize: .user(on: .completionSuggestions), mediaProvider: mediaProvider)
case .allUsers(let avatar):
RoomAvatarImage(avatar: avatar, avatarSize: .room(on: .completionSuggestions), mediaProvider: mediaProvider)
case .room(let room):
RoomAvatarImage(avatar: room.avatar, avatarSize: .room(on: .completionSuggestions), mediaProvider: mediaProvider)
}
avatar
.accessibilityHidden(true)
VStack(alignment: .leading, spacing: 0) {
Text(item.displayName)
.font(.compound.bodyLG)
@@ -34,6 +28,19 @@ struct MentionSuggestionItemView: View {
}
}
}
.accessibilityElement(children: .combine)
}
@ViewBuilder
private var avatar: some View {
switch item.suggestionType {
case .user(let user):
LoadableAvatarImage(url: user.avatarURL, name: user.displayName, contentID: user.id, avatarSize: .user(on: .completionSuggestions), mediaProvider: mediaProvider)
case .allUsers(let avatar):
RoomAvatarImage(avatar: avatar, avatarSize: .room(on: .completionSuggestions), mediaProvider: mediaProvider)
case .room(let room):
RoomAvatarImage(avatar: room.avatar, avatarSize: .room(on: .completionSuggestions), mediaProvider: mediaProvider)
}
}
}