fix: resolve iOS 26 deprecation warnings
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s

- Text '+' concatenation → HStack (MealSectionView)
- UIScreen.main → UIWindowScene.screen (EntryListView, ArticleWebView)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-04 07:39:41 -05:00
parent 640d816690
commit 1205ac38d0
3 changed files with 14 additions and 10 deletions

View File

@@ -47,12 +47,14 @@ struct MealSectionView: View {
Spacer()
HStack(spacing: 2) {
Text("\(Int(totalCalories))")
.font(.title3.weight(.bold))
.foregroundStyle(Color.mealColor(for: mealType.rawValue))
+ Text(" kcal")
Text("kcal")
.font(.caption.weight(.medium))
.foregroundStyle(Color.textSecondary)
}
Image(systemName: "chevron.right")
.font(.caption.weight(.medium))

View File

@@ -16,7 +16,8 @@ final class ArticleRenderer {
// Create at screen size so WebKit initializes the GPU compositor
// during warmup, not on first article open.
webView = WKWebView(frame: UIScreen.main.bounds, configuration: config)
let screenBounds = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen.bounds ?? CGRect(x: 0, y: 0, width: 393, height: 852)
webView = WKWebView(frame: screenBounds, configuration: config)
webView.isOpaque = false
webView.backgroundColor = .clear
webView.scrollView.isScrollEnabled = true

View File

@@ -14,9 +14,10 @@ struct EntryListView: View {
@State private var cumulativeUp: CGFloat = 0
@State private var markedByScroll: Set<Int> = []
// Viewport height measured once from screen bounds.
// Safe because this view only appears on iPhone in portrait/landscape.
private var viewportHeight: CGFloat { UIScreen.main.bounds.height }
// Viewport height use the first connected scene's screen.
private var viewportHeight: CGFloat {
(UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen.bounds.height ?? 800
}
// Fixed threshold per-entry deltas are small (~1-2pt each),
// so 100pt accumulates after scrolling roughly one screenful.