Fixed Toolbar Visibility Issue

This commit is contained in:
Beingpax 2025-03-20 19:27:06 +05:45
parent d889e3a6c2
commit c6fbb1d6be

View File

@ -52,6 +52,7 @@ struct TranscriptionHistoryView: View {
} }
var body: some View { var body: some View {
ZStack(alignment: .bottom) {
VStack(spacing: 0) { VStack(spacing: 0) {
searchBar searchBar
@ -96,15 +97,21 @@ struct TranscriptionHistoryView: View {
} }
} }
.padding(24) .padding(24)
// Add bottom padding to ensure content is not hidden by the toolbar when visible
.padding(.bottom, !selectedTranscriptions.isEmpty ? 60 : 0)
} }
.padding(.vertical, 16) .padding(.vertical, 16)
} }
if !selectedTranscriptions.isEmpty {
selectionToolbar
}
} }
.background(Color(NSColor.controlBackgroundColor)) .background(Color(NSColor.controlBackgroundColor))
// Selection toolbar as an overlay
if !selectedTranscriptions.isEmpty {
selectionToolbar
.transition(.move(edge: .bottom).combined(with: .opacity))
.animation(.easeInOut(duration: 0.3), value: !selectedTranscriptions.isEmpty)
}
}
.alert("Delete Selected Items?", isPresented: $showDeleteConfirmation) { .alert("Delete Selected Items?", isPresented: $showDeleteConfirmation) {
Button("Delete", role: .destructive) { Button("Delete", role: .destructive) {
deleteSelectedTranscriptions() deleteSelectedTranscriptions()
@ -208,7 +215,11 @@ struct TranscriptionHistoryView: View {
} }
} }
.padding(16) .padding(16)
.background(Color(.windowBackgroundColor)) .frame(maxWidth: .infinity)
.background(
Color(.windowBackgroundColor)
.shadow(color: Color.black.opacity(0.1), radius: 3, y: -2)
)
} }
private func loadInitialContent() async { private func loadInitialContent() async {