From 815f93ca946f7325b139ba475fa66da620b15e5a Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 2 Jun 2023 12:13:23 +0800 Subject: [PATCH 1/4] Remove unused tap handler --- .../Sources/Views/FeedItem/LibraryItemCard.swift | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift index ec52d5415..ef2fdcae0 100644 --- a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift +++ b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift @@ -17,13 +17,11 @@ public extension View { public struct LibraryItemCard: View { let viewer: Viewer? - let tapHandler: () -> Void @ObservedObject var item: LinkedItem - public init(item: LinkedItem, viewer: Viewer?, tapHandler: @escaping () -> Void = {}) { + public init(item: LinkedItem, viewer: Viewer?) { self.item = item self.viewer = viewer - self.tapHandler = tapHandler } public var body: some View { @@ -204,10 +202,5 @@ public struct LibraryItemCard: View { var labels: some View { LabelsFlowLayout(labels: item.sortedLabels) .padding(.top, 0) - #if os(macOS) - .onTapGesture { - tapHandler() - } - #endif } } From abeff164b97a798f9840fbf6d26c7902fd8112c7 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 5 Jun 2023 12:06:27 +0800 Subject: [PATCH 2/4] Some tweaks to Mac UI --- .../xcshareddata/swiftpm/Package.resolved | 9 --------- apple/OmnivoreKit/Package.swift | 4 ++-- .../Sources/App/Views/Home/HomeFeedViewMac.swift | 7 +++---- .../Sources/App/Views/WebReader/WebReaderContent.swift | 2 +- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved index 810d327ba..6dbd2dfbb 100644 --- a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -153,15 +153,6 @@ "version" : "2.1.0" } }, - { - "identity" : "pspdfkit-sp", - "kind" : "remoteSourceControl", - "location" : "https://github.com/PSPDFKit/PSPDFKit-SP", - "state" : { - "revision" : "f4ba9790488b8f11c29cff35943e430efcdb8003", - "version" : "12.0.1" - } - }, { "identity" : "sovran-swift", "kind" : "remoteSourceControl", diff --git a/apple/OmnivoreKit/Package.swift b/apple/OmnivoreKit/Package.swift index 061a20464..317a42079 100644 --- a/apple/OmnivoreKit/Package.swift +++ b/apple/OmnivoreKit/Package.swift @@ -57,7 +57,7 @@ let package = Package( var appPackageDependencies: [Target.Dependency] { var deps: [Target.Dependency] = ["Views", "Services", "Models", "Utils"] // Comment out following line for macOS build - deps.append(.product(name: "PSPDFKit", package: "PSPDFKit-SP")) + // deps.append(.product(name: "PSPDFKit", package: "PSPDFKit-SP")) return deps } @@ -71,6 +71,6 @@ var dependencies: [Package.Dependency] { .package(url: "https://github.com/gonzalezreal/swift-markdown-ui", from: "2.0.0") ] // Comment out following line for macOS build - deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", from: "12.0.1")) + // deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", from: "12.0.1")) return deps } diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift index fa14d1faf..1352f0f11 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift @@ -45,6 +45,7 @@ import Views item: item, viewModel: viewModel ) + .listRowInsets(EdgeInsets()) .contextMenu { Button( action: { viewModel.itemUnderTitleEdit = item }, @@ -91,11 +92,11 @@ import Views LoadingSection() } } - // .listStyle(PlainListStyle()) + .listStyle(InsetListStyle()) .navigationTitle("Home") .searchable( text: $viewModel.searchTerm, - placement: .sidebar + placement: .toolbar ) { if viewModel.searchTerm.isEmpty { Text(LocalText.inboxGeneric).searchCompletion("in:inbox ") @@ -105,8 +106,6 @@ import Views } } .onChange(of: viewModel.searchTerm) { _ in - // Maybe we should debounce this, but - // it feels like it works ok without loadItems(isRefresh: true) } .onSubmit(of: .search) { diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift index 232ecd896..6cb9956f0 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift @@ -81,7 +81,7 @@ struct WebReaderContent { title: `\(articleContent.title.replacingOccurrences(of: "`", with: "\\`"))`, content: document.getElementById('_omnivore-htmlContent').innerHTML, originalArticleUrl: "\(item.unwrappedPageURLString)", - contentReader: "WEB", + contentReader: "\(item.contentReader ?? "WEB")", readingProgressPercent: \(item.readingProgress), readingProgressAnchorIndex: \(item.readingProgressAnchor), labels: \(item.labelsJSONString), From 5b00a15eb7c1b8594a9582dc60f02e28039e6aa2 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 5 Jun 2023 12:47:27 +0800 Subject: [PATCH 3/4] Adjust spacing on labels --- .../_labelBackground.colorset/Contents.json | 6 +++--- .../Sources/Views/FeedItem/LabelsFlowLayout.swift | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Views/Colors/ThemeColors.xcassets/_labelBackground.colorset/Contents.json b/apple/OmnivoreKit/Sources/Views/Colors/ThemeColors.xcassets/_labelBackground.colorset/Contents.json index 30506bb70..61575f6d4 100644 --- a/apple/OmnivoreKit/Sources/Views/Colors/ThemeColors.xcassets/_labelBackground.colorset/Contents.json +++ b/apple/OmnivoreKit/Sources/Views/Colors/ThemeColors.xcassets/_labelBackground.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0xF5", - "green" : "0xF5", - "red" : "0xF5" + "blue" : "0xF9", + "green" : "0xF9", + "red" : "0xF9" } }, "idiom" : "universal" diff --git a/apple/OmnivoreKit/Sources/Views/FeedItem/LabelsFlowLayout.swift b/apple/OmnivoreKit/Sources/Views/FeedItem/LabelsFlowLayout.swift index 89b03a172..06425da27 100644 --- a/apple/OmnivoreKit/Sources/Views/FeedItem/LabelsFlowLayout.swift +++ b/apple/OmnivoreKit/Sources/Views/FeedItem/LabelsFlowLayout.swift @@ -31,8 +31,8 @@ struct LabelsFlowLayout: View { return ZStack(alignment: .topLeading) { ForEach(self.labelItems, id: \.self) { label in self.item(for: label) - .padding(.horizontal, 2) - .padding(.vertical, 2) + .padding(.horizontal, 3) + .padding(.vertical, 5) .alignmentGuide(.leading, computeValue: { dim in if abs(width - dim.width) > geom.size.width { width = 0 From 850576da68eb5ef93d124643c30045c2566b9b75 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 5 Jun 2023 16:04:05 +0800 Subject: [PATCH 4/4] Revert package changes --- .../xcshareddata/swiftpm/Package.resolved | 9 +++++++++ apple/OmnivoreKit/Package.swift | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6dbd2dfbb..810d327ba 100644 --- a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -153,6 +153,15 @@ "version" : "2.1.0" } }, + { + "identity" : "pspdfkit-sp", + "kind" : "remoteSourceControl", + "location" : "https://github.com/PSPDFKit/PSPDFKit-SP", + "state" : { + "revision" : "f4ba9790488b8f11c29cff35943e430efcdb8003", + "version" : "12.0.1" + } + }, { "identity" : "sovran-swift", "kind" : "remoteSourceControl", diff --git a/apple/OmnivoreKit/Package.swift b/apple/OmnivoreKit/Package.swift index 317a42079..061a20464 100644 --- a/apple/OmnivoreKit/Package.swift +++ b/apple/OmnivoreKit/Package.swift @@ -57,7 +57,7 @@ let package = Package( var appPackageDependencies: [Target.Dependency] { var deps: [Target.Dependency] = ["Views", "Services", "Models", "Utils"] // Comment out following line for macOS build - // deps.append(.product(name: "PSPDFKit", package: "PSPDFKit-SP")) + deps.append(.product(name: "PSPDFKit", package: "PSPDFKit-SP")) return deps } @@ -71,6 +71,6 @@ var dependencies: [Package.Dependency] { .package(url: "https://github.com/gonzalezreal/swift-markdown-ui", from: "2.0.0") ] // Comment out following line for macOS build - // deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", from: "12.0.1")) + deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", from: "12.0.1")) return deps }