diff --git a/ios/Platform/Platform/Features/Reader/Views/ArticleWebView.swift b/ios/Platform/Platform/Features/Reader/Views/ArticleWebView.swift index 977ffaf..900a508 100644 --- a/ios/Platform/Platform/Features/Reader/Views/ArticleWebView.swift +++ b/ios/Platform/Platform/Features/Reader/Views/ArticleWebView.swift @@ -18,8 +18,28 @@ final class ArticleRenderer { webView.backgroundColor = .clear webView.scrollView.isScrollEnabled = true - // Pre-warm: spin up WebContent process at app launch - webView.loadHTMLString("
", baseURL: nil) + // Pre-warm with realistic content. An empty + // only warms the WebContent process. Loading the real CSS template with + // sample text forces WebKit to also parse CSS, load/measure system fonts, + // initialize the layout engine, and spin up the compositing pipeline. + // This shifts the ~3s first-render cost to app launch (background) so the + // first article open doesn't stall. + webView.loadHTMLString(ArticleHTMLBuilder.build( + title: "Warming up", + url: nil, + feedName: "Reader", + author: "System", + timeAgo: "now", + readingTime: "1 min", + body: """ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. \ + Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
+Quoted text for blockquote styling.+
code { display: block; }
+ """
+ ), baseURL: nil)
}
}