Skip to content

Commit

Permalink
fix: Correctly open actions panel multiple selection iPadOS (#1579)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann authored Oct 14, 2024
2 parents bd1fb18 + baae817 commit e74227d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
27 changes: 10 additions & 17 deletions Mail/Views/Thread List/ThreadListModifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import InfomaniakDI
import MailCore
import MailCoreUI
import MailResources
import SwiftModalPresentation
import SwiftUI

extension View {
Expand Down Expand Up @@ -59,7 +60,6 @@ struct ThreadListToolbar: ViewModifier {
@EnvironmentObject private var actionsManager: ActionsManager

@State private var multipleSelectedMessages: [Message]?
@State private var messagesToMove: [Message]?

@Binding var flushAlert: FlushAlertState?

Expand Down Expand Up @@ -133,7 +133,7 @@ struct ThreadListToolbar: ViewModifier {
origin: .multipleSelection(
originFolder: originFolder,
nearestFlushAlert: $flushAlert,
nearestMessagesToMoveSheet: $messagesToMove
nearestMessagesToMoveSheet: nil
)
)
}
Expand All @@ -150,21 +150,14 @@ struct ThreadListToolbar: ViewModifier {
}
.accessibilityLabel(MailResourcesStrings.Localizable.buttonMore)
.accessibilityAddTraits(.isButton)
}
.actionsPanel(
messages: $multipleSelectedMessages,
originFolder: viewModel.frozenFolder,
panelSource: .threadList
) { _ in
multipleSelectionViewModel.disable()
}
.sheet(item: $messagesToMove) { messages in
MoveEmailView(
mailboxManager: viewModel.mailboxManager,
movedMessages: messages,
originFolder: viewModel.frozenFolder
)
.sheetViewStyle()
.actionsPanel(
messages: $multipleSelectedMessages,
originFolder: viewModel.frozenFolder,
panelSource: .threadList
) { action in
guard action != .openMovePanel else { return }
multipleSelectionViewModel.disable()
}
}
.navigationTitle(
multipleSelectionViewModel.isEnabled
Expand Down
3 changes: 2 additions & 1 deletion MailCoreUI/Components/BottomBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public struct BottomBar<Items: View>: ViewModifier {
public func body(content: Content) -> some View {
VStack(spacing: 0) {
content
Spacer(minLength: 0)
.frame(maxHeight: .infinity, alignment: .top)

if isVisible {
BottomBarView(items: items)
}
Expand Down

0 comments on commit e74227d

Please sign in to comment.