Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loading indicator to WebViewContainer #355

Merged
merged 3 commits into from
Feb 5, 2025
Merged

Conversation

Itaybre
Copy link
Collaborator

@Itaybre Itaybre commented Feb 5, 2025

Implements a very basic loading indicator

Fixes: #349

Copy link

emerge-tools bot commented Feb 5, 2025

3 builds increased size

Name Version Download Change Install Change Approval
HackerNews
com.emergetools.hackernews.snapshots
3.6 (1) 4.6 MB ⬆️ 24.7 kB (0.54%) 11.0 MB ⬆️ 105.8 kB (0.99%) N/A
HackerNews
com.emergetools.hackernews.adhoc
3.6 (1) 3.7 MB ⬆️ 6.4 kB (0.17%) 6.5 MB ⬆️ 18.8 kB (0.3%) N/A
HackerNews
com.emergetools.hackernews
3.6 (1) 3.7 MB ⬆️ 6.5 kB (0.18%) 6.1 MB ⬆️ 14.6 kB (0.25%) N/A

HackerNews 3.6 (1)
com.emergetools.hackernews.snapshots

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 105.8 kB (0.99%)
Total download size change: ⬆️ 24.7 kB (0.54%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 38.7 kB
📝 HackerNews.LoadingView.body ⬆️ 6.0 kB
SwiftUI.ModifiedContent ⬆️ 3.0 kB
Code Signature ⬆️ 2.8 kB
Swift._unimplementedInitializer(className,initName,file,line,colu... ⬆️ 2.3 kB
View Treemap

Image of diff

HackerNews 3.6 (1)
com.emergetools.hackernews.adhoc

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 18.8 kB (0.3%)
Total download size change: ⬆️ 6.4 kB (0.17%)

Largest size changes

Item Install Size Change
📝 HackerNews.LoadingView.body ⬆️ 4.3 kB
📝 WKNavigationDelegate.Objc Metadata ⬆️ 2.0 kB
DYLD.Fixups ⬆️ 1.2 kB
DYLD.String Table ⬆️ 1.0 kB
📝 HackerNews.WebViewModel.WebViewModel ⬆️ 756 B
View Treemap

Image of diff

HackerNews 3.6 (1)
com.emergetools.hackernews

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 14.6 kB (0.25%)
Total download size change: ⬆️ 6.5 kB (0.18%)

Largest size changes

Item Install Size Change
📝 HackerNews.LoadingView.body ⬆️ 4.3 kB
📝 WKNavigationDelegate.Objc Metadata ⬆️ 2.0 kB
DYLD.Fixups ⬆️ 1.2 kB
📝 HackerNews.WebViewModel.WebViewModel ⬆️ 756 B
SwiftUI.View.View ⬆️ 612 B
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

Copy link

emerge-tools bot commented Feb 5, 2025

📸 Snapshot Test

1 added, 88 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
HackerNews
com.emergetools.hackernews.snapshots
1 0 0 0 70 0 ⏳ Needs approval
HackerNews
com.emergetools.hackernews.adhoc
0 0 0 0 0 0 N/A
HackerNews
com.emergetools.hackernews
0 0 0 0 0 0 N/A
HackerNews Swift-Snapshot-Testing
com.emerge.hn.Hacker-News.swiftsnapshottesting
0 0 0 0 18 0 N/A

🛸 Powered by Emerge Tools

@@ -10,23 +10,40 @@ import SwiftUI
import UIKit
import WebKit

final class WebViewModel: ObservableObject {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using @Observable everywhere we can, I don't see a need for this to be ObservableObject

struct WebViewContainer: View {
@Environment(\.openURL) var openURL

@StateObject var model: WebViewModel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same we should not use @StateObject

@@ -39,18 +56,34 @@ struct WebViewContainer: View {
}

struct WebView: UIViewRepresentable {
let url: URL
@ObservedObject var viewModel: WebViewModel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same think this should be @Binding

@Itaybre Itaybre merged commit d72a17f into main Feb 5, 2025
5 of 6 checks passed
@Itaybre Itaybre deleted the feature/loading_indicator branch February 5, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add activity indicator for WebView
2 participants