summaryrefslogtreecommitdiff
path: root/Sora/Views/Post/Grid
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-03-02 04:59:00 -0800
committerFuwn <[email protected]>2025-03-02 04:59:00 -0800
commitec6f6e766b878ec7f11f4f404570768c37486ad5 (patch)
tree45cbf47f3f7b9ee48f50fd1649ea46b09bebda6b /Sora/Views/Post/Grid
parentfeat: Development commit (diff)
downloadsora-testing-ec6f6e766b878ec7f11f4f404570768c37486ad5.tar.xz
sora-testing-ec6f6e766b878ec7f11f4f404570768c37486ad5.zip
feat: Development commit
Diffstat (limited to 'Sora/Views/Post/Grid')
-rw-r--r--Sora/Views/Post/Grid/PostGridSearchHistoryView.swift21
1 files changed, 18 insertions, 3 deletions
diff --git a/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
index e306839..30f7808 100644
--- a/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
+++ b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
@@ -6,6 +6,7 @@ struct PostGridSearchHistoryView: View {
@State private var searchText: String = ""
@Binding var selectedTab: Int
@Binding var isPresented: Bool
+ @State private var isShowingRemoveAllConfirmation = false
var filteredHistory: [BooruSearchQuery] {
guard !searchText.isEmpty else {
@@ -64,14 +65,28 @@ struct PostGridSearchHistoryView: View {
}
.onDelete(perform: settings.removeSearchHistoryEntry)
}
- #if os(macOS)
- .listStyle(.plain)
- #endif
}
}
}
.navigationTitle("Search History")
.searchable(text: $searchText)
+ .toolbar {
+ ToolbarItem {
+ Button(action: {
+ isShowingRemoveAllConfirmation = true
+ }) {
+ Label("Remove All Search History", systemImage: "trash")
+ }
+ }
+ }
+ .confirmationDialog(
+ "Are you sure you want to remove all searches? This action cannot be undone.",
+ isPresented: $isShowingRemoveAllConfirmation
+ ) {
+ Button("Remove All Searches") {
+ settings.bookmarks.removeAll()
+ }
+ }
}
}