From cd5d135032c41b07459439b12140c9a38a2e9599 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 2 May 2023 22:16:58 +0800 Subject: [PATCH 1/9] Set the iOS caret colour based on theme --- .../Sources/App/Views/WebReader/WebReader.swift | 2 ++ apple/OmnivoreKit/Sources/Views/Theme.swift | 15 +++++++++++++++ packages/web/styles/articleInnerStyling.css | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift index b8c42dd4e..f4ad4f2f4 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift @@ -55,6 +55,7 @@ struct WebReader: PlatformViewRepresentable { #if os(iOS) webView.isOpaque = false + webView.tintColor = UIColor(ThemeManager.currentHighlightColor) webView.backgroundColor = UIColor(ThemeManager.currentBgColor) webView.underPageBackgroundColor = UIColor(ThemeManager.currentBgColor) webView.scrollView.backgroundColor = UIColor(ThemeManager.currentBgColor) @@ -116,6 +117,7 @@ struct WebReader: PlatformViewRepresentable { (webView as? OmnivoreWebView)?.updateJustifyText() webView.backgroundColor = UIColor(ThemeManager.currentBgColor) + webView.tintColor = UIColor(ThemeManager.currentHighlightColor) webView.underPageBackgroundColor = UIColor(ThemeManager.currentBgColor) webView.scrollView.backgroundColor = UIColor(ThemeManager.currentBgColor) webView.scrollView.indicatorStyle = ThemeManager.currentTheme.isDark ? diff --git a/apple/OmnivoreKit/Sources/Views/Theme.swift b/apple/OmnivoreKit/Sources/Views/Theme.swift index 38e624585..9b95225c2 100644 --- a/apple/OmnivoreKit/Sources/Views/Theme.swift +++ b/apple/OmnivoreKit/Sources/Views/Theme.swift @@ -31,6 +31,17 @@ public enum Theme: String, CaseIterable { } } + public var keyColor: Color { + switch self { + case .light, .sepia: + return Color(red: 255 / 255.0, green: 210 / 255.0, blue: 52 / 255.0) + case .dark, .apollo: + return Color(red: 134 / 255.0, green: 109 / 255.0, blue: 21 / 255.0) + default: + return bgColor + } + } + public var keyColor: Color { switch self { case .light: @@ -79,4 +90,8 @@ public enum ThemeManager { public static var currentBgColor: Color { currentTheme.bgColor } + + public static var currentHighlightColor: Color { + currentTheme.highlightColor + } } diff --git a/packages/web/styles/articleInnerStyling.css b/packages/web/styles/articleInnerStyling.css index 5d600dd9d..55c1aec04 100644 --- a/packages/web/styles/articleInnerStyling.css +++ b/packages/web/styles/articleInnerStyling.css @@ -3,7 +3,7 @@ } :root { - color-scheme: var(--colorScheme-colorScheme); + color-scheme: light dark; } .speakingSection { From fb863bea26407c615fae5214d84fb9f6c1267b3c Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 2 May 2023 22:18:38 +0800 Subject: [PATCH 2/9] Fix merge typo --- apple/OmnivoreKit/Sources/Views/Theme.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/Views/Theme.swift b/apple/OmnivoreKit/Sources/Views/Theme.swift index 9b95225c2..416819de0 100644 --- a/apple/OmnivoreKit/Sources/Views/Theme.swift +++ b/apple/OmnivoreKit/Sources/Views/Theme.swift @@ -31,7 +31,7 @@ public enum Theme: String, CaseIterable { } } - public var keyColor: Color { + public var highlightColor: Color { switch self { case .light, .sepia: return Color(red: 255 / 255.0, green: 210 / 255.0, blue: 52 / 255.0) From 750bdc7f5c7a119d95f74fdcb632fb51ee45d9f3 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 2 May 2023 22:27:27 +0800 Subject: [PATCH 3/9] Bump iOS version --- apple/Omnivore.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apple/Omnivore.xcodeproj/project.pbxproj b/apple/Omnivore.xcodeproj/project.pbxproj index 2c512da09..1be4154fc 100644 --- a/apple/Omnivore.xcodeproj/project.pbxproj +++ b/apple/Omnivore.xcodeproj/project.pbxproj @@ -1490,7 +1490,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.26.0; + MARKETING_VERSION = 1.27.0; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = Omnivore; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1831,7 +1831,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.26.0; + MARKETING_VERSION = 1.27.0; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = Omnivore; PROVISIONING_PROFILE_SPECIFIER = ""; From ccfbd0c44a95d0296448a3dbd9809b112ecbc714 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 2 May 2023 22:46:39 +0800 Subject: [PATCH 4/9] Handle system colour --- apple/OmnivoreKit/Sources/Views/Theme.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Views/Theme.swift b/apple/OmnivoreKit/Sources/Views/Theme.swift index 416819de0..0351fdd70 100644 --- a/apple/OmnivoreKit/Sources/Views/Theme.swift +++ b/apple/OmnivoreKit/Sources/Views/Theme.swift @@ -37,8 +37,11 @@ public enum Theme: String, CaseIterable { return Color(red: 255 / 255.0, green: 210 / 255.0, blue: 52 / 255.0) case .dark, .apollo: return Color(red: 134 / 255.0, green: 109 / 255.0, blue: 21 / 255.0) - default: - return bgColor + case .system: + if Color.isDarkMode { + return Color(red: 134 / 255.0, green: 109 / 255.0, blue: 21 / 255.0) + } + return Color(red: 255 / 255.0, green: 210 / 255.0, blue: 52 / 255.0) } } From 8e504df6f70269dfb831f1658a708a430ea4b63e Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 4 May 2023 13:56:54 +0800 Subject: [PATCH 5/9] Set description properly when editing the title --- .../App/AppExtensions/Share/Views/ShareExtensionView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift index 248fc9e2c..621dd53dc 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift @@ -371,7 +371,7 @@ public struct ShareExtensionView: View { viewModel.submitTitleEdit(dataService: viewModel.services.dataService, itemID: linkedItem.unwrappedID, title: viewModel.title, - description: linkedItem.description) + description: linkedItem.descriptionText ?? "") } } viewState = .mainView From 4317fcf85323fea32a2164da7f31b25bb4ebad1b Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 4 May 2023 14:09:49 +0800 Subject: [PATCH 6/9] Allow iOS scroll to top --- .../Sources/App/Views/WebReader/WebReaderCoordinator.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift index 88d9d5603..8d8042f57 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift @@ -144,7 +144,7 @@ extension WebReaderCoordinator: WKNavigationDelegate { func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool { scrollView.contentInset.top = readerViewNavBarHeight navBarVisibilityRatio = 1 - return false + return true } } #endif From 20074b4c97b27ccd8b70950a8df8ac852551f9de Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 4 May 2023 14:15:06 +0800 Subject: [PATCH 7/9] Only scroll to top once nav bar visible --- .../Sources/App/Views/WebReader/WebReaderCoordinator.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift index 8d8042f57..09f48d751 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderCoordinator.swift @@ -143,8 +143,9 @@ extension WebReaderCoordinator: WKNavigationDelegate { func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool { scrollView.contentInset.top = readerViewNavBarHeight + let navBarVisible = navBarVisibilityRatio == 1 navBarVisibilityRatio = 1 - return true + return navBarVisible } } #endif From 6bd6c108ab0de60041ba6e011dbd0a42891a6598 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 4 May 2023 14:38:47 +0800 Subject: [PATCH 8/9] Revert inner styling change --- packages/web/styles/articleInnerStyling.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/styles/articleInnerStyling.css b/packages/web/styles/articleInnerStyling.css index 55c1aec04..5d600dd9d 100644 --- a/packages/web/styles/articleInnerStyling.css +++ b/packages/web/styles/articleInnerStyling.css @@ -3,7 +3,7 @@ } :root { - color-scheme: light dark; + color-scheme: var(--colorScheme-colorScheme); } .speakingSection { From 16d402ff6dc226a2aea7a186b3386547a36a85e8 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 4 May 2023 14:49:01 +0800 Subject: [PATCH 9/9] Fix typo in strings file --- .../Sources/Views/Resources/es.lproj/Localizable.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/Views/Resources/es.lproj/Localizable.strings b/apple/OmnivoreKit/Sources/Views/Resources/es.lproj/Localizable.strings index 883eabec9..848d343f5 100644 --- a/apple/OmnivoreKit/Sources/Views/Resources/es.lproj/Localizable.strings +++ b/apple/OmnivoreKit/Sources/Views/Resources/es.lproj/Localizable.strings @@ -124,7 +124,7 @@ "welcomeSignupAgreement" = "Al registrarte, aceptas de Omnivore:\n"; "welcomeTitleTermsOfService" = "Términos del Servicio"; "welcomeTitleAndJoiner" = " y "; -"welcomeTitleEmailContinue" = "Continuar con el correo electrónico; +"welcomeTitleEmailContinue" = "Continuar con el correo electrónico"; // Keyboard Commands "keyboardCommandDecreaseFont" = "Disminuir tamaño de fuente";