diff --git a/apple/Omnivore.xcodeproj/project.pbxproj b/apple/Omnivore.xcodeproj/project.pbxproj index 1bd97059d..e44edd0fb 100644 --- a/apple/Omnivore.xcodeproj/project.pbxproj +++ b/apple/Omnivore.xcodeproj/project.pbxproj @@ -1388,7 +1388,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.0; - MARKETING_VERSION = 1.42.0; + MARKETING_VERSION = 1.43.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; @@ -1423,7 +1423,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.0; - MARKETING_VERSION = 1.42.0; + MARKETING_VERSION = 1.43.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1478,7 +1478,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.42.0; + MARKETING_VERSION = 1.43.0; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = Omnivore; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1819,7 +1819,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.42.0; + MARKETING_VERSION = 1.43.0; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = Omnivore; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift index 248665c95..55e577811 100644 --- a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift +++ b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift @@ -44,6 +44,7 @@ import Utils @State private var errorMessage: String? @State private var showNotebookView = false + @State private var showLabelsModal = false @State private var hasPerformedHighlightMutations = false @State private var errorAlertMessage: String? @State private var showErrorAlertMessage = false @@ -131,6 +132,12 @@ import Utils style: .plain, target: coordinator, action: #selector(PDFViewCoordinator.toggleNotebookView) + ), + UIBarButtonItem( + image: UIImage(named: "label", in: Bundle(url: ViewsPackage.bundleURL), with: nil), + style: .plain, + target: coordinator, + action: #selector(PDFViewCoordinator.toggleLabelsView) ) ] @@ -228,14 +235,14 @@ import Utils } .navigationViewStyle(StackNavigationViewStyle()) } - .fullScreenCover(isPresented: $readerView, content: { + .sheet(isPresented: $readerView, content: { PDFReaderViewController(document: document) }) .accentColor(Color(red: 255 / 255.0, green: 234 / 255.0, blue: 159 / 255.0)) .sheet(item: $shareLink) { ShareSheet(activityItems: [$0.url]) } - .fullScreenCover(isPresented: $showNotebookView, onDismiss: onNotebookViewDismissal) { + .sheet(isPresented: $showNotebookView, onDismiss: onNotebookViewDismissal) { NotebookView( viewModel: NotebookViewModel(item: viewModel.pdfItem.item), hasHighlightMutations: $hasPerformedHighlightMutations, @@ -244,6 +251,11 @@ import Utils } ) } + .sheet(isPresented: $showLabelsModal) { + ApplyLabelsView(mode: .item(viewModel.pdfItem.item), onSave: { _ in + showLabelsModal = false + }) + } } else if let errorMessage = errorMessage { Text(errorMessage) } else { @@ -483,6 +495,12 @@ import Utils } } + @objc public func toggleLabelsView() { + if let viewer = self.viewer { + viewer.showLabelsModal = !viewer.showLabelsModal + } + } + func shortHighlightIds(_ annotations: [HighlightAnnotation]) -> [String] { annotations.compactMap { ($0.customData?["omnivoreHighlight"] as? [String: String])?["shortId"] } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index 939bf0502..873c39d6a 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -295,7 +295,7 @@ struct AnimatingCellHeight: AnimatableModifier { LibraryAddLinkView() } } - .fullScreenCover(isPresented: $showExpandedAudioPlayer) { + .sheet(isPresented: $showExpandedAudioPlayer) { ExpandedAudioPlayer( delete: { showExpandedAudioPlayer = false @@ -330,7 +330,7 @@ struct AnimatingCellHeight: AnimatableModifier { viewModel.selectedItem = linkedItem viewModel.linkIsActive = true } - .fullScreenCover(isPresented: $searchPresented) { + .sheet(isPresented: $searchPresented) { LibrarySearchView(homeFeedViewModel: self.viewModel) } .task { diff --git a/apple/OmnivoreKit/Sources/App/Views/LibraryTabView.swift b/apple/OmnivoreKit/Sources/App/Views/LibraryTabView.swift index 078a326f0..71b7d0729 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LibraryTabView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LibraryTabView.swift @@ -108,7 +108,7 @@ struct LibraryTabView: View { .padding(0) } } - .fullScreenCover(isPresented: $showExpandedAudioPlayer) { + .sheet(isPresented: $showExpandedAudioPlayer) { ExpandedAudioPlayer( delete: { showExpandedAudioPlayer = false diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift index db8b0f8c5..b394dc0f7 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift @@ -162,6 +162,15 @@ struct ProfileView: View { ) #endif + Button( + action: { + if let url = URL(string: "https://discord.gg/h2z5rppzz9") { + openURL(url) + } + }, + label: { Text("Join community on Discord") } + ) + Button( action: { if let url = URL(string: "https://omnivore.app/privacy") { diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index 52af57555..6c51e3ac4 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -340,28 +340,6 @@ struct WebReaderContainerView: View { .frame(maxWidth: .infinity) .foregroundColor(ThemeManager.currentTheme.toolbarColor) .background(ThemeManager.currentBgColor) - .sheet(isPresented: $showLabelsModal) { - ApplyLabelsView(mode: .item(item), onSave: { labels in - showLabelsModal = false - item.labels = NSSet(array: labels) - readerSettingsChangedTransactionID = UUID() - }) - } - .sheet(isPresented: $showTitleEdit) { - LinkedItemMetadataEditView(item: item, onSave: { title, _ in - item.title = title - // We dont need to update description because its never rendered in this view - readerSettingsChangedTransactionID = UUID() - }) - } - #if os(iOS) - .sheet(isPresented: $showNotebookView, onDismiss: onNotebookViewDismissal) { - NotebookView( - viewModel: NotebookViewModel(item: item), - hasHighlightMutations: $hasPerformedHighlightMutations - ) - } - #endif #if os(macOS) .buttonStyle(PlainButtonStyle()) #endif @@ -450,11 +428,11 @@ struct WebReaderContainerView: View { }, label: { Text(LocalText.readerSave) }) } #if os(iOS) - .fullScreenCover(item: $safariWebLink) { + .sheet(item: $safariWebLink) { SafariView(url: $0.url) .ignoresSafeArea(.all, edges: .bottom) } - .fullScreenCover(isPresented: $showExpandedAudioPlayer) { + .sheet(isPresented: $showExpandedAudioPlayer) { ExpandedAudioPlayer(delete: { _ in showExpandedAudioPlayer = false audioController.stop() @@ -519,6 +497,28 @@ struct WebReaderContainerView: View { } } } + .sheet(isPresented: $showLabelsModal) { + ApplyLabelsView(mode: .item(item), onSave: { labels in + showLabelsModal = false + item.labels = NSSet(array: labels) + readerSettingsChangedTransactionID = UUID() + }) + } + .sheet(isPresented: $showTitleEdit) { + LinkedItemMetadataEditView(item: item, onSave: { title, _ in + item.title = title + // We dont need to update description because its never rendered in this view + readerSettingsChangedTransactionID = UUID() + }) + } + #if os(iOS) + .sheet(isPresented: $showNotebookView, onDismiss: onNotebookViewDismissal) { + NotebookView( + viewModel: NotebookViewModel(item: item), + hasHighlightMutations: $hasPerformedHighlightMutations + ) + } + #endif } else if let errorMessage = viewModel.errorMessage { VStack { if viewModel.allowRetry, viewModel.hasOriginalUrl(item) {