From 665549a703b4d1d196a7ece52a922cb990d99ce5 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 15 Mar 2025 06:00:36 -0700 Subject: feat: Development commit --- Localizable.xcstrings | 6 +++++ Sora/Views/Post/Grid/PostGridView.swift | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/Localizable.xcstrings b/Localizable.xcstrings index 49d84af..8d52372 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -160,6 +160,9 @@ }, "Manually Load Next Page" : { + }, + "Next Search" : { + }, "No Bookmarks" : { "localizations" : { @@ -225,6 +228,9 @@ }, "Preloaded Images: %lld" : { + }, + "Previous Search" : { + }, "Provider" : { "localizations" : { diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift index 9a4be18..b359e07 100644 --- a/Sora/Views/Post/Grid/PostGridView.swift +++ b/Sora/Views/Post/Grid/PostGridView.swift @@ -106,6 +106,46 @@ struct PostGridView: View { ToolbarItem(placement: .bottomBar) { PostGridBookmarkButtonView() } #endif } + + if manager.historyIndex > 0 { + #if os(macOS) + ToolbarItem { + Button(action: { + manager.goBackInHistory() + }) { + Label("Previous Search", systemImage: "chevron.left") + } + } + #else + ToolbarItem(placement: .bottomBar) { + Button(action: { + manager.goBackInHistory() + }) { + Label("Previous Search", systemImage: "chevron.left") + } + } + #endif + } + + if manager.historyIndex < manager.searchHistory.count - 1 { + #if os(macOS) + ToolbarItem { + Button(action: { + manager.goForwardInHistory() + }) { + Label("Next Search", systemImage: "chevron.right") + } + } + #else + ToolbarItem(placement: .bottomBar) { + Button(action: { + manager.goForwardInHistory() + }) { + Label("Next Search", systemImage: "chevron.right") + } + } + #endif + } } .navigationTitle("Posts") .refreshable { -- cgit v1.2.3