From 707e956517c2d1fe2f2513213a58c9c6a42b5a67 Mon Sep 17 00:00:00 2001 From: vanities Date: Sat, 7 Jun 2025 09:13:28 -0500 Subject: [PATCH 1/3] Add random board navigation --- .../Services/AccessibilityIdentifiers.swift | 1 + swiftchan/Views/Boards/BoardsView.swift | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/swiftchan/Services/AccessibilityIdentifiers.swift b/swiftchan/Services/AccessibilityIdentifiers.swift index 57a272c..0df855f 100644 --- a/swiftchan/Services/AccessibilityIdentifiers.swift +++ b/swiftchan/Services/AccessibilityIdentifiers.swift @@ -27,5 +27,6 @@ class AccessibilityIdentifiers { static let saveToFilesButton: String = "Save to Files Button" static let copyToPasteboardButton: String = "Copy to Pasteboard Button" static let successToastText: String = "Success Toast Text" + static let randomBoardButton: String = "Random Board Button" } diff --git a/swiftchan/Views/Boards/BoardsView.swift b/swiftchan/Views/Boards/BoardsView.swift index c0d2456..26b08c4 100644 --- a/swiftchan/Views/Boards/BoardsView.swift +++ b/swiftchan/Views/Boards/BoardsView.swift @@ -48,6 +48,14 @@ struct BoardsView: View { .searchable(text: $searchText) } .buttonStyle(.plain) + .toolbar { + ToolbarItem(placement: .navigationBarTrailing) { + Button(action: openRandomBoard) { + Image(systemName: Constants.diceIcon) + } + .accessibilityIdentifier(AccessibilityIdentifiers.randomBoardButton) + } + } .navigationBarTitle(Constants.title) .navigationDestination(for: String.self) { value in CatalogView(boardName: value) @@ -80,11 +88,19 @@ struct BoardsView: View { } } + private func openRandomBoard() { + let availableBoards = boardsViewModel.boards.filter { showNSFWBoards || !$0.isNSFW } + if let randomBoard = availableBoards.randomElement() { + presentedNavigation.append(randomBoard.board) + } + } + struct Constants { static let favoritesText = "favorites" static let allText = "all" static let title = "4chan" static let refreshIcon = "arrow.clockwise" + static let diceIcon = "shuffle" static let gridSpacing: CGFloat = 1 } } From fd56c0638557a76924638cfbe03bf89f0f641f1d Mon Sep 17 00:00:00 2001 From: Adam Mischke Date: Sat, 7 Jun 2025 09:21:12 -0500 Subject: [PATCH 2/3] fixed error, remove rando --- swiftchan.xcodeproj/project.pbxproj | 8 ++++++++ swiftchan.xcworkspace/contents.xcworkspacedata | 3 +++ .../Services/AccessibilityIdentifiers.swift | 2 -- swiftchan/Views/Boards/BoardsView.swift | 16 ---------------- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/swiftchan.xcodeproj/project.pbxproj b/swiftchan.xcodeproj/project.pbxproj index a9739cd..2a3d1c8 100644 --- a/swiftchan.xcodeproj/project.pbxproj +++ b/swiftchan.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 950846FC2751E3DA0098DF73 /* DeepLinker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950846FB2751E3DA0098DF73 /* DeepLinker.swift */; }; 950846FE2752CA260098DF73 /* BoardSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950846FD2752CA260098DF73 /* BoardSection.swift */; }; + 950CC7582DF481DD00C2704B /* ThreadDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950CC7572DF481DD00C2704B /* ThreadDestination.swift */; }; 950E3940255CDA3B00A00A74 /* MediaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950E393F255CDA3B00A00A74 /* MediaView.swift */; }; 95105369256600C9002E4051 /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95105368256600C9002E4051 /* Post.swift */; }; 951053712566018D002E4051 /* Board.swift in Sources */ = {isa = PBXBuildFile; fileRef = 951053702566018D002E4051 /* Board.swift */; }; @@ -126,6 +127,7 @@ 76EE6EC133F7354F9C641B0D /* libPods-swiftchan.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-swiftchan.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 950846FB2751E3DA0098DF73 /* DeepLinker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeepLinker.swift; sourceTree = ""; }; 950846FD2752CA260098DF73 /* BoardSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardSection.swift; sourceTree = ""; }; + 950CC7572DF481DD00C2704B /* ThreadDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadDestination.swift; sourceTree = ""; }; 950E393F255CDA3B00A00A74 /* MediaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaView.swift; sourceTree = ""; }; 95105368256600C9002E4051 /* Post.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Post.swift; sourceTree = ""; }; 951053702566018D002E4051 /* Board.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Board.swift; sourceTree = ""; }; @@ -271,6 +273,7 @@ 9510536725660071002E4051 /* Models */ = { isa = PBXGroup; children = ( + 950CC7572DF481DD00C2704B /* ThreadDestination.swift */, 95978F112CA795E000C520EF /* Tabs.swift */, 95105368256600C9002E4051 /* Post.swift */, 951053702566018D002E4051 /* Board.swift */, @@ -661,10 +664,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-swiftchan/Pods-swiftchan-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-swiftchan/Pods-swiftchan-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-swiftchan/Pods-swiftchan-frameworks.sh\"\n"; @@ -755,6 +762,7 @@ 95CFC2FA2734B66E0053D62A /* Media.swift in Sources */, 95C01FE727382AD5000D64B1 /* VLCMediaListPlayerUIView.swift in Sources */, 95A94EFC2554F8D1001D155E /* GalleryView.swift in Sources */, + 950CC7582DF481DD00C2704B /* ThreadDestination.swift in Sources */, 9574CE07255E34E8000C99B6 /* CatalogViewModel.swift in Sources */, 958D2C99254D2DF200E54C41 /* ContentView.swift in Sources */, 95B7BE51256CBC4A00F75BC9 /* FavoriteStar.swift in Sources */, diff --git a/swiftchan.xcworkspace/contents.xcworkspacedata b/swiftchan.xcworkspace/contents.xcworkspacedata index eddfc2e..eec99e9 100644 --- a/swiftchan.xcworkspace/contents.xcworkspacedata +++ b/swiftchan.xcworkspace/contents.xcworkspacedata @@ -7,4 +7,7 @@ + + diff --git a/swiftchan/Services/AccessibilityIdentifiers.swift b/swiftchan/Services/AccessibilityIdentifiers.swift index 0df855f..3e85e26 100644 --- a/swiftchan/Services/AccessibilityIdentifiers.swift +++ b/swiftchan/Services/AccessibilityIdentifiers.swift @@ -27,6 +27,4 @@ class AccessibilityIdentifiers { static let saveToFilesButton: String = "Save to Files Button" static let copyToPasteboardButton: String = "Copy to Pasteboard Button" static let successToastText: String = "Success Toast Text" - static let randomBoardButton: String = "Random Board Button" - } diff --git a/swiftchan/Views/Boards/BoardsView.swift b/swiftchan/Views/Boards/BoardsView.swift index 26b08c4..c0d2456 100644 --- a/swiftchan/Views/Boards/BoardsView.swift +++ b/swiftchan/Views/Boards/BoardsView.swift @@ -48,14 +48,6 @@ struct BoardsView: View { .searchable(text: $searchText) } .buttonStyle(.plain) - .toolbar { - ToolbarItem(placement: .navigationBarTrailing) { - Button(action: openRandomBoard) { - Image(systemName: Constants.diceIcon) - } - .accessibilityIdentifier(AccessibilityIdentifiers.randomBoardButton) - } - } .navigationBarTitle(Constants.title) .navigationDestination(for: String.self) { value in CatalogView(boardName: value) @@ -88,19 +80,11 @@ struct BoardsView: View { } } - private func openRandomBoard() { - let availableBoards = boardsViewModel.boards.filter { showNSFWBoards || !$0.isNSFW } - if let randomBoard = availableBoards.randomElement() { - presentedNavigation.append(randomBoard.board) - } - } - struct Constants { static let favoritesText = "favorites" static let allText = "all" static let title = "4chan" static let refreshIcon = "arrow.clockwise" - static let diceIcon = "shuffle" static let gridSpacing: CGFloat = 1 } } From d6d6dcae790243c58e3dd75ac3d19adc77ca3ca0 Mon Sep 17 00:00:00 2001 From: Adam Mischke Date: Sat, 7 Jun 2025 09:23:34 -0500 Subject: [PATCH 3/3] fixed error, remove rando --- .github/workflows/build_and_test.yml | 2 +- .../xcshareddata/swiftpm/Package.resolved | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6c89e91..b8d93fd 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -56,7 +56,7 @@ jobs: - name: Archive Failed Tests artifacts if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: FailureDiff path: .build/Logs/Test/ diff --git a/swiftchan.xcworkspace/xcshareddata/swiftpm/Package.resolved b/swiftchan.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7a49c4a..ebf775c 100644 --- a/swiftchan.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/swiftchan.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -7,7 +7,7 @@ "location" : "https://github.com/simibac/ConfettiSwiftUI.git", "state" : { "branch" : "master", - "revision" : "469de4e43949815dc92570cc786922d8d1385b06" + "revision" : "79666d42b882bf7921b1941fa7c636d681d77980" } }, { @@ -33,17 +33,17 @@ "kind" : "remoteSourceControl", "location" : "git@github.com:onevcat/Kingfisher.git", "state" : { - "revision" : "5b92f029fab2cce44386d28588098b5be0824ef5", - "version" : "7.11.0" + "revision" : "2ef543ee21d63734e1c004ad6c870255e8716c50", + "version" : "7.12.0" } }, { "identity" : "swiftui-introspect", "kind" : "remoteSourceControl", - "location" : "git@github.com:siteline/SwiftUI-Introspect.git", + "location" : "git@github.com:siteline/swiftui-introspect.git", "state" : { - "revision" : "0cd2a5a5895306bc21d54a2254302d24a9a571e4", - "version" : "1.1.3" + "revision" : "807f73ce09a9b9723f12385e592b4e0aaebd3336", + "version" : "1.3.0" } }, {