diff --git a/apple/Omnivore.xcodeproj/project.pbxproj b/apple/Omnivore.xcodeproj/project.pbxproj index d943ee073..4e0f6563b 100644 --- a/apple/Omnivore.xcodeproj/project.pbxproj +++ b/apple/Omnivore.xcodeproj/project.pbxproj @@ -1389,7 +1389,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.0; - MARKETING_VERSION = 1.44.0; + MARKETING_VERSION = 1.45.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; @@ -1424,7 +1424,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.0; - MARKETING_VERSION = 1.44.0; + MARKETING_VERSION = 1.45.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1479,7 +1479,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.44.0; + MARKETING_VERSION = 1.45.0; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = Omnivore; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1820,7 +1820,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.44.0; + MARKETING_VERSION = 1.45.0; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = Omnivore; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index c581f6646..92438d1ac 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -530,8 +530,13 @@ struct AnimatingCellHeight: AnimatableModifier { ) } else { HomeFeedGridView( + listTitle: $listTitle, + isListScrolled: $isListScrolled, + prefersListLayout: $prefersListLayout, + isEditMode: $isEditMode, + selection: $selection, viewModel: viewModel, - isListScrolled: $isListScrolled + showFeatureCards: showFeatureCards ) } }.sheet(isPresented: $viewModel.showLabelsSheet) { @@ -574,10 +579,6 @@ struct AnimatingCellHeight: AnimatableModifier { .dynamicTypeSize(.small ... .accessibility1) } - func menuItems(for item: Models.LibraryItem) -> some View { - libraryItemMenu(dataService: dataService, viewModel: viewModel, item: item) - } - var featureCard: some View { VStack(spacing: 0) { if Color.isDarkMode { @@ -745,7 +746,7 @@ struct AnimatingCellHeight: AnimatableModifier { .listRowSeparatorTint(Color.thBorderColor) .listRowInsets(.init(top: 0, leading: horizontalInset, bottom: 10, trailing: horizontalInset)) .contextMenu { - menuItems(for: item) + libraryItemMenu(dataService: dataService, viewModel: viewModel, item: item) } .swipeActions(edge: .leading, allowsFullSwipe: true) { if let listConfig = viewModel.currentListConfig { @@ -938,11 +939,20 @@ struct AnimatingCellHeight: AnimatableModifier { @EnvironmentObject var dataService: DataService @EnvironmentObject var audioController: AudioController - @State var isContextMenuOpen = false + @Binding var listTitle: String + @Binding var isListScrolled: Bool + @Binding var prefersListLayout: Bool + @Binding var isEditMode: EditMode + @State private var showHideFeatureAlert = false + @Binding var selection: Set @ObservedObject var viewModel: HomeFeedViewModel - @Binding var isListScrolled: Bool + let showFeatureCards: Bool + + @State var shouldScrollToTop = false + @State var topItem: Models.LibraryItem? + @ObservedObject var networkMonitor = NetworkMonitor() func contextMenuActionHandler(item: Models.LibraryItem, action: GridCardAction) { switch action { @@ -972,10 +982,6 @@ struct AnimatingCellHeight: AnimatableModifier { .dynamicTypeSize(.small ... .accessibility1) } - func menuItems(for item: Models.LibraryItem) -> some View { - libraryItemMenu(dataService: dataService, viewModel: viewModel, item: item) - } - var body: some View { VStack(alignment: .leading) { Color.systemBackground.frame(height: 1) @@ -1018,7 +1024,7 @@ struct AnimatingCellHeight: AnimatableModifier { viewModel: viewModel ) .contextMenu { - menuItems(for: item) + libraryItemMenu(dataService: dataService, viewModel: viewModel, item: item) } .onAppear { if idx >= viewModel.fetcher.items.count - 5 { diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift index ceec00508..af5d6d68c 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift @@ -13,7 +13,7 @@ enum LoadingBarStyle { @MainActor final class HomeFeedViewModel: NSObject, ObservableObject { let filterKey: String - @Published var fetcher: LibraryItemFetcher + @ObservedObject var fetcher: LibraryItemFetcher let folderConfigs: [String: LibraryListConfig] @Published var isLoading = false diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/LibraryItemMenu.swift b/apple/OmnivoreKit/Sources/App/Views/Home/LibraryItemMenu.swift index 2b68877bf..76b369d08 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/LibraryItemMenu.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/LibraryItemMenu.swift @@ -13,6 +13,19 @@ import Views action: { viewModel.itemUnderTitleEdit = item }, label: { Label("Edit Info", systemImage: "info.circle") } ) + Button( + action: { viewModel.setLinkArchived(dataService: dataService, objectID: item.objectID, archived: !item.isArchived) }, + label: { + Label( + item.isArchived ? "Unarchive" : "Archive", + systemImage: item.isArchived ? "tray.and.arrow.down.fill" : "archivebox" + ) + } + ) + Button( + action: { viewModel.removeLibraryItem(dataService: dataService, objectID: item.objectID) }, + label: { Label("Remove", systemImage: "trash") } + ) Button( action: { viewModel.itemUnderLabelEdit = item }, label: { Label(item.labels?.count == 0 ? "Add Labels" : "Edit Labels", systemImage: "tag") } diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index b922c8298..639bb7c90 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -432,7 +432,7 @@ struct WebReaderContainerView: View { }, label: { Text(LocalText.readerSave) }) } #if os(iOS) - .sheet(item: $safariWebLink) { + .fullScreenCover(item: $safariWebLink) { SafariView(url: $0.url) .ignoresSafeArea(.all, edges: .bottom) }