expo-dev-launcher 58.0.19 → 58.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/android/build.gradle +2 -2
- package/android/src/debug/java/expo/modules/devlauncher/compose/models/ProfileViewModel.kt +1 -1
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/AppHeader.kt +1 -1
- package/android/src/debug/java/expo/modules/devlauncher/services/GraphQLService.kt +15 -7
- package/ios/DevLauncherNetworkInterceptor.swift +1 -1
- package/ios/SwiftUI/AccountSheet.swift +37 -41
- package/ios/SwiftUI/CrashReportView.swift +11 -11
- package/ios/SwiftUI/Data.swift +4 -9
- package/ios/SwiftUI/DevLauncherViewController.swift +38 -4
- package/ios/SwiftUI/DevLauncherViewModel.swift +22 -8
- package/ios/SwiftUI/DevLauncherViews.swift +20 -35
- package/ios/SwiftUI/DevServerFiltersView.swift +4 -4
- package/ios/SwiftUI/DevServerInfoModal.swift +2 -2
- package/ios/SwiftUI/DevServersView.swift +20 -20
- package/ios/SwiftUI/ErrorView.swift +11 -11
- package/ios/SwiftUI/GraphQL/Models.swift +10 -3
- package/ios/SwiftUI/GraphQL/Queries.swift +4 -3
- package/ios/SwiftUI/HomeTabView.swift +110 -47
- package/ios/SwiftUI/LocalNetworkPermissionView.swift +13 -13
- package/ios/SwiftUI/Navigation/DevLauncherTab.swift +50 -0
- package/ios/SwiftUI/Navigation/DevLauncherToolbar.swift +114 -0
- package/ios/SwiftUI/Navigation/Navigation.swift +0 -134
- package/ios/SwiftUI/SettingsTabView.swift +23 -35
- package/ios/SwiftUI/StackFrameView.swift +2 -2
- package/ios/SwiftUI/UpdatesTab/NotSignedInView.swift +4 -4
- package/ios/SwiftUI/UpdatesTab/NotUsingUpdatesView.swift +18 -22
- package/ios/SwiftUI/UpdatesTab/UpdateRow.swift +1 -1
- package/ios/SwiftUI/UpdatesTab/UpdatesListView.swift +21 -13
- package/ios/SwiftUI/UpdatesTab/UpdatesTabView.swift +5 -4
- package/ios/SwiftUI/Utils/Utils.swift +12 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 58.0.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Stop using the deprecated `profilePhoto` and `Update.runtimeVersion` GraphQL fields. ([#53410](https://github.com/expo/expo/pull/53410) by [@tchayen](https://github.com/tchayen))
|
|
8
|
+
- [iOS] Connect to the development server's `/message` socket and network inspector on port 443 when the bundle URL is `https` with no port, such as an `expo start --tunnel` URL. ([#53466](https://github.com/expo/expo/pull/53466) by [@vonovak](https://github.com/vonovak))
|
|
9
|
+
|
|
10
|
+
## 58.0.20
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [iOS] Open the account sheet at half height when signed in. ([#52530](https://github.com/expo/expo/pull/52530) by [@alanjhughes](https://github.com/alanjhughes))
|
|
15
|
+
- [iOS] Fix the launcher losing its safe area and layout margins because its view controller was not in the view controller hierarchy. ([#52536](https://github.com/expo/expo/pull/52536) by [@alanjhughes](https://github.com/alanjhughes))
|
|
16
|
+
- [iOS] Show the app icon and "Development Build" in the Home tab navigation bar. ([#52600](https://github.com/expo/expo/pull/52600) by [@alanjhughes](https://github.com/alanjhughes))
|
|
17
|
+
- [iOS] Limit the launcher tab content to a centered 600 pt column on wide displays. ([#52532](https://github.com/expo/expo/pull/52532) by [@alanjhughes](https://github.com/alanjhughes))
|
|
18
|
+
- [iOS] Fix filled buttons blending into the background in dark mode. ([#52534](https://github.com/expo/expo/pull/52534) by [@alanjhughes](https://github.com/alanjhughes))
|
|
19
|
+
- [iOS] Stop the launcher from re-rendering on every dev server discovery refresh when the server list did not change. ([#52533](https://github.com/expo/expo/pull/52533) by [@alanjhughes](https://github.com/alanjhughes))
|
|
20
|
+
- [iOS] Fix the EAS Update not configured message not showing on the Updates tab. ([#52534](https://github.com/expo/expo/pull/52534) by [@alanjhughes](https://github.com/alanjhughes))
|
|
21
|
+
- [iOS] Show the loading spinner only on the dev server row that is loading. ([#52534](https://github.com/expo/expo/pull/52534) by [@alanjhughes](https://github.com/alanjhughes))
|
|
22
|
+
- [iOS] Show a large navigation title on each launcher tab. ([#52530](https://github.com/expo/expo/pull/52530) by [@alanjhughes](https://github.com/alanjhughes))
|
|
23
|
+
- [iOS] Move the account button and the account sheet close button into the navigation toolbar. ([#52531](https://github.com/expo/expo/pull/52531) by [@alanjhughes](https://github.com/alanjhughes))
|
|
24
|
+
- [iOS] Fix the Updates tab sort order and the Default Page Size setting so the list shows that many of the newest updates. ([#52534](https://github.com/expo/expo/pull/52534) by [@alanjhughes](https://github.com/alanjhughes))
|
|
25
|
+
|
|
3
26
|
## 58.0.19
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/android/build.gradle
CHANGED
|
@@ -24,13 +24,13 @@ expoModule {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
group = "host.exp.exponent"
|
|
27
|
-
version = "58.0.
|
|
27
|
+
version = "58.0.21"
|
|
28
28
|
|
|
29
29
|
android {
|
|
30
30
|
namespace "expo.modules.devlauncher"
|
|
31
31
|
defaultConfig {
|
|
32
32
|
versionCode 9
|
|
33
|
-
versionName "58.0.
|
|
33
|
+
versionName "58.0.21"
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
buildTypes {
|
|
@@ -53,7 +53,7 @@ class ProfileViewModel : ViewModel() {
|
|
|
53
53
|
Account(
|
|
54
54
|
id = account.id,
|
|
55
55
|
name = account.name,
|
|
56
|
-
avatar = account.ownerUserActor?.
|
|
56
|
+
avatar = account.ownerUserActor?.primaryAccountProfileImageUrl,
|
|
57
57
|
isSelected = account.id == newUserState.selectedAccount?.id
|
|
58
58
|
)
|
|
59
59
|
} ?: emptyList()
|
|
@@ -100,7 +100,7 @@ fun AppHeader(
|
|
|
100
100
|
modifier = Modifier.size(44.dp),
|
|
101
101
|
contentAlignment = Alignment.Center
|
|
102
102
|
) {
|
|
103
|
-
val profilePhoto = currentAccount?.ownerUserActor?.
|
|
103
|
+
val profilePhoto = currentAccount?.ownerUserActor?.primaryAccountProfileImageUrl
|
|
104
104
|
|
|
105
105
|
if (profilePhoto != null) {
|
|
106
106
|
AsyncImage(
|
|
@@ -16,7 +16,6 @@ query Me {
|
|
|
16
16
|
meUserActor {
|
|
17
17
|
id
|
|
18
18
|
appCount
|
|
19
|
-
profilePhoto
|
|
20
19
|
username
|
|
21
20
|
isExpoAdmin
|
|
22
21
|
accounts {
|
|
@@ -25,7 +24,7 @@ query Me {
|
|
|
25
24
|
ownerUserActor {
|
|
26
25
|
username
|
|
27
26
|
fullName
|
|
28
|
-
|
|
27
|
+
primaryAccountProfileImageUrl
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -53,7 +52,9 @@ query getBranchesWithCompatibleUpdate(
|
|
|
53
52
|
) {
|
|
54
53
|
id
|
|
55
54
|
message
|
|
56
|
-
|
|
55
|
+
runtime {
|
|
56
|
+
version
|
|
57
|
+
}
|
|
57
58
|
createdAt
|
|
58
59
|
manifestPermalink
|
|
59
60
|
}
|
|
@@ -95,7 +96,9 @@ query getUpdatesWithFilters(
|
|
|
95
96
|
updates(offset: ${'$'}offset, limit: ${'$'}limit, filter: { platform: ${'$'}platform }) {
|
|
96
97
|
id
|
|
97
98
|
message
|
|
98
|
-
|
|
99
|
+
runtime {
|
|
100
|
+
version
|
|
101
|
+
}
|
|
99
102
|
createdAt
|
|
100
103
|
manifestPermalink
|
|
101
104
|
}
|
|
@@ -132,7 +135,7 @@ data class UserAccount(
|
|
|
132
135
|
val ownerUserActor: OwnerUserActor? = null
|
|
133
136
|
)
|
|
134
137
|
|
|
135
|
-
data class OwnerUserActor(val
|
|
138
|
+
data class OwnerUserActor(val primaryAccountProfileImageUrl: String? = null)
|
|
136
139
|
|
|
137
140
|
// branches (covers both getBranches and getBranchesWithCompatibleUpdate)
|
|
138
141
|
data class BranchesData(val app: BranchesApp? = null) {
|
|
@@ -162,10 +165,15 @@ data class UpdateBranchByName(val updates: List<UpdateInfo> = emptyList())
|
|
|
162
165
|
data class UpdateInfo(
|
|
163
166
|
val id: String,
|
|
164
167
|
val message: String? = null,
|
|
165
|
-
val
|
|
168
|
+
val runtime: UpdateRuntime? = null,
|
|
166
169
|
val createdAt: String? = null,
|
|
167
170
|
val manifestPermalink: String
|
|
168
|
-
)
|
|
171
|
+
) {
|
|
172
|
+
val runtimeVersion: String?
|
|
173
|
+
get() = runtime?.version
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
data class UpdateRuntime(val version: String)
|
|
169
177
|
|
|
170
178
|
class GraphQLService(
|
|
171
179
|
private val httpClientService: HttpClientService
|
|
@@ -40,7 +40,7 @@ public final class DevLauncherNetworkInterceptor: NSObject, ExpoRequestCdpInterc
|
|
|
40
40
|
|
|
41
41
|
private static func createNetworkInspectorUrl(bundleUrl: URL) -> URL {
|
|
42
42
|
let host = bundleUrl.host ?? "localhost"
|
|
43
|
-
let port = bundleUrl.port ?? 8081
|
|
43
|
+
let port = bundleUrl.port ?? (bundleUrl.scheme == "https" ? 443 : 8081)
|
|
44
44
|
let scheme = bundleUrl.scheme == "https" ? "wss" : "ws"
|
|
45
45
|
let urlString = "\(scheme)://\(host):\(port)/inspector/network"
|
|
46
46
|
guard let url = URL(string: urlString) else {
|
|
@@ -8,9 +8,29 @@ struct AccountSheet: View {
|
|
|
8
8
|
@State private var showingLogoutConfirmation = false
|
|
9
9
|
|
|
10
10
|
var body: some View {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
NavigationStack {
|
|
12
|
+
content
|
|
13
|
+
.navigationTitle("Account")
|
|
14
|
+
#if os(iOS)
|
|
15
|
+
.navigationBarTitleDisplayMode(.inline)
|
|
16
|
+
#endif
|
|
17
|
+
.toolbar {
|
|
18
|
+
ToolbarItem(placement: .cancellationAction) {
|
|
19
|
+
Button {
|
|
20
|
+
dismiss()
|
|
21
|
+
} label: {
|
|
22
|
+
Image(systemName: "xmark")
|
|
23
|
+
}
|
|
24
|
+
.accessibilityLabel("Close")
|
|
25
|
+
}
|
|
26
|
+
.verticalBarPreferred()
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
.presentationDetents(viewModel.isAuthenticated ? [.medium, .large] : [.large])
|
|
30
|
+
}
|
|
13
31
|
|
|
32
|
+
private var content: some View {
|
|
33
|
+
VStack(spacing: 0) {
|
|
14
34
|
if !viewModel.isAuthenticated {
|
|
15
35
|
Spacer()
|
|
16
36
|
Image("expo-go-logo", bundle: getDevLauncherBundle())
|
|
@@ -35,30 +55,6 @@ struct AccountSheet: View {
|
|
|
35
55
|
#endif
|
|
36
56
|
}
|
|
37
57
|
|
|
38
|
-
private var accountScreenHeader: some View {
|
|
39
|
-
VStack(spacing: 8) {
|
|
40
|
-
HStack {
|
|
41
|
-
Text("Account")
|
|
42
|
-
.font(.title2)
|
|
43
|
-
.fontWeight(.semibold)
|
|
44
|
-
|
|
45
|
-
Spacer()
|
|
46
|
-
|
|
47
|
-
Button {
|
|
48
|
-
dismiss()
|
|
49
|
-
}
|
|
50
|
-
label: {
|
|
51
|
-
Image(systemName: "xmark")
|
|
52
|
-
.font(.system(size: 16, weight: .medium))
|
|
53
|
-
.foregroundColor(.primary)
|
|
54
|
-
.frame(width: 44, height: 44)
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
.padding(.horizontal, 20)
|
|
58
|
-
.padding(.top, 8)
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
58
|
private var userAccountSelector: some View {
|
|
63
59
|
VStack(spacing: 0) {
|
|
64
60
|
ScrollView {
|
|
@@ -72,7 +68,7 @@ struct AccountSheet: View {
|
|
|
72
68
|
}
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
|
-
.cornerRadius
|
|
71
|
+
.clipShape(RoundedRectangle(cornerRadius: 12))
|
|
76
72
|
}
|
|
77
73
|
}
|
|
78
74
|
}
|
|
@@ -88,12 +84,12 @@ struct AccountSheet: View {
|
|
|
88
84
|
label: {
|
|
89
85
|
Text("Log out")
|
|
90
86
|
.font(.headline)
|
|
91
|
-
.
|
|
87
|
+
.foregroundStyle(Color.red)
|
|
92
88
|
.frame(maxWidth: .infinity)
|
|
93
89
|
.padding(.vertical, 12)
|
|
94
90
|
}
|
|
95
91
|
.background(Color.expoSecondarySystemBackground)
|
|
96
|
-
.cornerRadius
|
|
92
|
+
.clipShape(RoundedRectangle(cornerRadius: 12))
|
|
97
93
|
.confirmationDialog(
|
|
98
94
|
"Are you sure you want to log out?",
|
|
99
95
|
isPresented: $showingLogoutConfirmation,
|
|
@@ -110,7 +106,7 @@ struct AccountSheet: View {
|
|
|
110
106
|
VStack(spacing: 16) {
|
|
111
107
|
Text("Log in or create an account to view local development servers and more.")
|
|
112
108
|
.font(.system(size: 14))
|
|
113
|
-
.
|
|
109
|
+
.foregroundStyle(Color.secondary)
|
|
114
110
|
|
|
115
111
|
#if os(tvOS)
|
|
116
112
|
VStack(spacing: 8) {
|
|
@@ -144,13 +140,13 @@ struct AccountSheet: View {
|
|
|
144
140
|
.font(.headline)
|
|
145
141
|
.fontWeight(.semibold)
|
|
146
142
|
}
|
|
147
|
-
.
|
|
143
|
+
.foregroundStyle(Color.expoSystemBackground)
|
|
148
144
|
.frame(maxWidth: .infinity)
|
|
149
145
|
.padding(.vertical, 12)
|
|
150
146
|
.animation(.easeInOut(duration: 0.2), value: viewModel.isAuthenticating)
|
|
151
147
|
}
|
|
152
|
-
.background(Color.
|
|
153
|
-
.cornerRadius
|
|
148
|
+
.background(Color.primary)
|
|
149
|
+
.clipShape(RoundedRectangle(cornerRadius: 12))
|
|
154
150
|
.disabled(viewModel.isAuthenticating)
|
|
155
151
|
}
|
|
156
152
|
|
|
@@ -164,12 +160,12 @@ struct AccountSheet: View {
|
|
|
164
160
|
Text("Sign up")
|
|
165
161
|
.font(.headline)
|
|
166
162
|
.fontWeight(.semibold)
|
|
167
|
-
.
|
|
163
|
+
.foregroundStyle(Color.black.opacity(0.7))
|
|
168
164
|
.frame(maxWidth: .infinity)
|
|
169
165
|
.padding(.vertical, 12)
|
|
170
166
|
}
|
|
171
167
|
.background(Color(.white))
|
|
172
|
-
.cornerRadius
|
|
168
|
+
.clipShape(RoundedRectangle(cornerRadius: 12))
|
|
173
169
|
.disabled(viewModel.isAuthenticating)
|
|
174
170
|
}
|
|
175
171
|
|
|
@@ -184,7 +180,7 @@ struct AccountSheet: View {
|
|
|
184
180
|
VStack(alignment: .leading, spacing: 2) {
|
|
185
181
|
Text(account.ownerUserActor?.username ?? account.name)
|
|
186
182
|
.font(.headline)
|
|
187
|
-
.
|
|
183
|
+
.foregroundStyle(Color.primary)
|
|
188
184
|
.multilineTextAlignment(.leading)
|
|
189
185
|
}
|
|
190
186
|
|
|
@@ -193,7 +189,7 @@ struct AccountSheet: View {
|
|
|
193
189
|
if viewModel.selectedAccountId == account.id {
|
|
194
190
|
Image(systemName: "checkmark.circle.fill")
|
|
195
191
|
.font(.system(size: 16, weight: .medium))
|
|
196
|
-
.
|
|
192
|
+
.foregroundStyle(Color.green)
|
|
197
193
|
}
|
|
198
194
|
}
|
|
199
195
|
.padding(.horizontal, 16)
|
|
@@ -208,7 +204,7 @@ struct AccountSheet: View {
|
|
|
208
204
|
@ViewBuilder
|
|
209
205
|
private func createAvatar(account: UserAccount) -> some View {
|
|
210
206
|
let isOrganization = account.ownerUserActor == nil
|
|
211
|
-
let profilePhoto = account.ownerUserActor?.
|
|
207
|
+
let profilePhoto = account.ownerUserActor?.primaryAccountProfileImageUrl
|
|
212
208
|
let name = account.ownerUserActor?.fullName ?? account.name
|
|
213
209
|
|
|
214
210
|
if isOrganization {
|
|
@@ -220,7 +216,7 @@ struct AccountSheet: View {
|
|
|
220
216
|
.overlay(
|
|
221
217
|
Image(systemName: "building.2")
|
|
222
218
|
.font(.system(size: 18))
|
|
223
|
-
.
|
|
219
|
+
.foregroundStyle(color.foreground)
|
|
224
220
|
)
|
|
225
221
|
} else if let profilePhoto,
|
|
226
222
|
let url = URL(string: profilePhoto) {
|
|
@@ -236,7 +232,7 @@ struct AccountSheet: View {
|
|
|
236
232
|
.overlay(
|
|
237
233
|
Image(systemName: "person")
|
|
238
234
|
.font(.system(size: 18))
|
|
239
|
-
.
|
|
235
|
+
.foregroundStyle(Color.secondary)
|
|
240
236
|
)
|
|
241
237
|
}
|
|
242
238
|
.frame(width: 32, height: 32)
|
|
@@ -252,7 +248,7 @@ struct AccountSheet: View {
|
|
|
252
248
|
.overlay(
|
|
253
249
|
Text(firstLetter)
|
|
254
250
|
.font(.system(size: 18, weight: .medium))
|
|
255
|
-
.
|
|
251
|
+
.foregroundStyle(color.foreground)
|
|
256
252
|
)
|
|
257
253
|
}
|
|
258
254
|
}
|
|
@@ -26,13 +26,13 @@ struct CrashReportView: View {
|
|
|
26
26
|
Button(action: onDismiss) {
|
|
27
27
|
Text("Close")
|
|
28
28
|
.font(.headline)
|
|
29
|
-
.
|
|
29
|
+
.foregroundStyle(Color.primary)
|
|
30
30
|
.frame(maxWidth: .infinity)
|
|
31
31
|
.padding()
|
|
32
32
|
#if !os(tvOS) && !os(macOS)
|
|
33
33
|
.background(Color(.systemGray5))
|
|
34
34
|
#endif
|
|
35
|
-
.cornerRadius
|
|
35
|
+
.clipShape(RoundedRectangle(cornerRadius: 8))
|
|
36
36
|
}
|
|
37
37
|
.padding()
|
|
38
38
|
}
|
|
@@ -40,7 +40,7 @@ struct CrashReportView: View {
|
|
|
40
40
|
.background(Color(.systemBackground))
|
|
41
41
|
#endif
|
|
42
42
|
#if !os(macOS)
|
|
43
|
-
.
|
|
43
|
+
.toolbar(.hidden, for: .navigationBar)
|
|
44
44
|
#endif
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -60,11 +60,11 @@ struct CrashReportView: View {
|
|
|
60
60
|
Button(action: copyToClipboard) {
|
|
61
61
|
Text(showCopiedMessage ? "Copied!" : "Tap to Copy Report")
|
|
62
62
|
.font(.headline)
|
|
63
|
-
.
|
|
63
|
+
.foregroundStyle(Color.expoSystemBackground)
|
|
64
64
|
.frame(maxWidth: .infinity)
|
|
65
65
|
.padding()
|
|
66
|
-
.background(showCopiedMessage ? Color.green : Color.
|
|
67
|
-
.cornerRadius
|
|
66
|
+
.background(showCopiedMessage ? Color.green : Color.primary)
|
|
67
|
+
.clipShape(RoundedRectangle(cornerRadius: 8))
|
|
68
68
|
}
|
|
69
69
|
.disabled(showCopiedMessage)
|
|
70
70
|
}
|
|
@@ -79,7 +79,7 @@ struct CrashReportView: View {
|
|
|
79
79
|
}
|
|
80
80
|
Text(formatTimestamp(getCrashDate()))
|
|
81
81
|
.font(.body)
|
|
82
|
-
.
|
|
82
|
+
.foregroundStyle(Color.secondary)
|
|
83
83
|
}
|
|
84
84
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
85
85
|
}
|
|
@@ -94,7 +94,7 @@ struct CrashReportView: View {
|
|
|
94
94
|
}
|
|
95
95
|
Text(error.message)
|
|
96
96
|
.font(.system(.caption, design: .monospaced))
|
|
97
|
-
.
|
|
97
|
+
.foregroundStyle(Color.primary)
|
|
98
98
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
99
99
|
}
|
|
100
100
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
@@ -111,7 +111,7 @@ struct CrashReportView: View {
|
|
|
111
111
|
if let errorInstance, !errorInstance.stack.isEmpty {
|
|
112
112
|
Text(errorInstance.stack)
|
|
113
113
|
.font(.system(.caption, design: .monospaced))
|
|
114
|
-
.
|
|
114
|
+
.foregroundStyle(Color.primary)
|
|
115
115
|
.fixedSize(horizontal: true, vertical: false)
|
|
116
116
|
#if !os(tvOS)
|
|
117
117
|
.textSelection(.enabled)
|
|
@@ -124,7 +124,7 @@ struct CrashReportView: View {
|
|
|
124
124
|
} else {
|
|
125
125
|
Text("No stack trace available")
|
|
126
126
|
.font(.system(.caption, design: .monospaced))
|
|
127
|
-
.
|
|
127
|
+
.foregroundStyle(Color.secondary)
|
|
128
128
|
.fixedSize(horizontal: true, vertical: false)
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -136,7 +136,7 @@ struct CrashReportView: View {
|
|
|
136
136
|
#if !os(tvOS) && !os(macOS)
|
|
137
137
|
.background(Color(.secondarySystemGroupedBackground))
|
|
138
138
|
#endif
|
|
139
|
-
.cornerRadius
|
|
139
|
+
.clipShape(RoundedRectangle(cornerRadius: 8))
|
|
140
140
|
}
|
|
141
141
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
142
142
|
}
|
package/ios/SwiftUI/Data.swift
CHANGED
|
@@ -20,14 +20,6 @@ struct DevServer: Hashable {
|
|
|
20
20
|
let bundleIdentifier: String?
|
|
21
21
|
let username: String?
|
|
22
22
|
|
|
23
|
-
static func == (lhs: Self, rhs: Self) -> Bool {
|
|
24
|
-
return lhs.url == rhs.url
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
func hash(into hasher: inout Hasher) {
|
|
28
|
-
hasher.combine(url)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
23
|
static func < (lhs: Self, rhs: Self) -> Bool {
|
|
32
24
|
return lhs.url < rhs.url
|
|
33
25
|
}
|
|
@@ -50,9 +42,12 @@ struct BuildInfo {
|
|
|
50
42
|
}
|
|
51
43
|
|
|
52
44
|
struct RecentlyOpenedApp: Identifiable {
|
|
53
|
-
let id = UUID().uuidString
|
|
54
45
|
let name: String
|
|
55
46
|
let url: String
|
|
56
47
|
let timestamp: Date
|
|
57
48
|
let isEasUpdate: Bool?
|
|
49
|
+
|
|
50
|
+
var id: String {
|
|
51
|
+
"\(name)|\(url)"
|
|
52
|
+
}
|
|
58
53
|
}
|
|
@@ -13,16 +13,47 @@ import ExpoModulesCore
|
|
|
13
13
|
#if !os(macOS)
|
|
14
14
|
public override func viewDidLayoutSubviews() {
|
|
15
15
|
super.viewDidLayoutSubviews()
|
|
16
|
+
attachToWindowRootIfNeeded()
|
|
16
17
|
updateTopSafeAreaInset()
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
private func attachToWindowRootIfNeeded() {
|
|
21
|
+
guard parent == nil,
|
|
22
|
+
let hostingView = hostingController?.view,
|
|
23
|
+
hostingView.isDescendant(of: view),
|
|
24
|
+
let windowRootViewController = view.window?.rootViewController,
|
|
25
|
+
windowRootViewController !== self,
|
|
26
|
+
view.superview?.next === windowRootViewController else {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
windowRootViewController.addChild(self)
|
|
30
|
+
didMove(toParent: windowRootViewController)
|
|
31
|
+
refreshHostingAppearance()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private func refreshHostingAppearance() {
|
|
35
|
+
DispatchQueue.main.async { [weak self] in
|
|
36
|
+
guard let hostingController = self?.hostingController else {
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
hostingController.beginAppearanceTransition(true, animated: false)
|
|
40
|
+
hostingController.endAppearanceTransition()
|
|
41
|
+
hostingController.view.setNeedsLayout()
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Some hosts (e.g. SwiftUI or brownfield apps) do not pass the window's safe area down to the launcher.
|
|
19
46
|
private func updateTopSafeAreaInset() {
|
|
20
|
-
let
|
|
47
|
+
guard let hostingController else {
|
|
48
|
+
return
|
|
49
|
+
}
|
|
50
|
+
let additionalInset = hostingController.additionalSafeAreaInsets.top
|
|
51
|
+
let inheritedInset = hostingController.view.safeAreaInsets.top - additionalInset
|
|
21
52
|
let windowInset = view.window?.safeAreaInsets.top ?? 0
|
|
22
|
-
let newInset: CGFloat =
|
|
53
|
+
let newInset: CGFloat = parent != nil || inheritedInset > 0 ? 0 : windowInset
|
|
23
54
|
|
|
24
|
-
if newInset !=
|
|
25
|
-
|
|
55
|
+
if newInset != additionalInset {
|
|
56
|
+
hostingController.additionalSafeAreaInsets.top = newInset
|
|
26
57
|
}
|
|
27
58
|
}
|
|
28
59
|
#endif
|
|
@@ -75,6 +106,9 @@ import ExpoModulesCore
|
|
|
75
106
|
#if !os(macOS)
|
|
76
107
|
navigationController?.setNavigationBarHidden(true, animated: false)
|
|
77
108
|
hostingController.didMove(toParent: self)
|
|
109
|
+
if parent != nil {
|
|
110
|
+
refreshHostingAppearance()
|
|
111
|
+
}
|
|
78
112
|
#endif
|
|
79
113
|
}
|
|
80
114
|
}
|
|
@@ -15,6 +15,7 @@ private let networkPermissionGrantedKey = "expo.devlauncher.hasGrantedNetworkPer
|
|
|
15
15
|
private let filterByBundleIdentifierKey = "expo.devlauncher.nsd.filterByBundleIdentifier"
|
|
16
16
|
private let filterByUsernameKey = "expo.devlauncher.nsd.filterByUsername"
|
|
17
17
|
private let filterBySlugKey = "expo.devlauncher.nsd.filterBySlug"
|
|
18
|
+
private let updatesPageSizeKey = "expo.devlauncher.updatesPageSize"
|
|
18
19
|
|
|
19
20
|
enum LocalNetworkPermissionStatus: Equatable, Sendable {
|
|
20
21
|
case unknown
|
|
@@ -26,10 +27,9 @@ enum LocalNetworkPermissionStatus: Equatable, Sendable {
|
|
|
26
27
|
|
|
27
28
|
@MainActor
|
|
28
29
|
class DevLauncherViewModel: ObservableObject {
|
|
29
|
-
/// Safe area inset for when VC hierarchy doesn't propagate it (e.g., SwiftUI/brownfield apps)
|
|
30
|
-
@Published var topSafeAreaInset: CGFloat = 0
|
|
31
30
|
@Published var recentlyOpenedApps: [RecentlyOpenedApp] = []
|
|
32
31
|
@Published var buildInfo: [AnyHashable: Any] = [:]
|
|
32
|
+
@Published var appIcon: UIImage?
|
|
33
33
|
@Published var updatesConfig: [AnyHashable: Any] = [:]
|
|
34
34
|
@Published var currentError: EXDevLauncherAppError?
|
|
35
35
|
@Published var showingCrashReport = false
|
|
@@ -59,6 +59,11 @@ class DevLauncherViewModel: ObservableObject {
|
|
|
59
59
|
UserDefaults.standard.set(autoLaunchMostRecent, forKey: "EXDevLauncherTryToLaunchLastBundle")
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
@Published var updatesPageSize = UserDefaults.standard.object(forKey: updatesPageSizeKey) as? Int ?? 10 {
|
|
63
|
+
didSet {
|
|
64
|
+
UserDefaults.standard.set(updatesPageSize, forKey: updatesPageSizeKey)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
62
67
|
@Published var isAuthenticated = false
|
|
63
68
|
@Published var isAuthenticating = false
|
|
64
69
|
@Published var user: User? {
|
|
@@ -67,7 +72,7 @@ class DevLauncherViewModel: ObservableObject {
|
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
@Published var selectedAccountId: String?
|
|
70
|
-
@Published var
|
|
75
|
+
@Published var loadingServerURL: String?
|
|
71
76
|
@Published var isLoadingLocalBundle: Bool = false
|
|
72
77
|
@Published var permissionStatus: LocalNetworkPermissionStatus = .unknown
|
|
73
78
|
|
|
@@ -166,8 +171,14 @@ class DevLauncherViewModel: ObservableObject {
|
|
|
166
171
|
username: user?.username
|
|
167
172
|
)
|
|
168
173
|
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
let sorted = filtered.sorted(by: <)
|
|
175
|
+
if sorted != devServers {
|
|
176
|
+
devServers = sorted
|
|
177
|
+
}
|
|
178
|
+
let hiddenCount = allDevServers.count - filtered.count
|
|
179
|
+
if hiddenCount != hiddenDevServerCount {
|
|
180
|
+
hiddenDevServerCount = hiddenCount
|
|
181
|
+
}
|
|
171
182
|
}
|
|
172
183
|
|
|
173
184
|
private func extractPort(from url: String) -> String? {
|
|
@@ -182,6 +193,9 @@ class DevLauncherViewModel: ObservableObject {
|
|
|
182
193
|
let controller = EXDevLauncherController.sharedInstance()
|
|
183
194
|
self.buildInfo = controller.getBuildInfo()
|
|
184
195
|
self.updatesConfig = controller.getUpdatesConfig(nil)
|
|
196
|
+
if let path = buildInfo["appIcon"] as? String, let url = URL(string: path), url.isFileURL {
|
|
197
|
+
self.appIcon = UIImage(contentsOfFile: url.path)
|
|
198
|
+
}
|
|
185
199
|
|
|
186
200
|
loadRecentlyOpenedApps()
|
|
187
201
|
loadMenuPreferences()
|
|
@@ -225,20 +239,20 @@ class DevLauncherViewModel: ObservableObject {
|
|
|
225
239
|
return
|
|
226
240
|
}
|
|
227
241
|
|
|
228
|
-
|
|
242
|
+
loadingServerURL = url
|
|
229
243
|
|
|
230
244
|
EXDevLauncherController.sharedInstance().loadApp(
|
|
231
245
|
bundleUrl,
|
|
232
246
|
onSuccess: { [weak self] in
|
|
233
247
|
DispatchQueue.main.async {
|
|
234
|
-
self?.
|
|
248
|
+
self?.loadingServerURL = nil
|
|
235
249
|
}
|
|
236
250
|
},
|
|
237
251
|
onError: { [weak self] error in
|
|
238
252
|
let message = DevLauncherLoadErrorMessage.message(for: error as NSError, url: url)
|
|
239
253
|
EXDevLauncherRemoteLogsManager.reportError(message, toServerAt: bundleUrl)
|
|
240
254
|
DispatchQueue.main.async {
|
|
241
|
-
self?.
|
|
255
|
+
self?.loadingServerURL = nil
|
|
242
256
|
self?.showErrorAlert(message)
|
|
243
257
|
}
|
|
244
258
|
})
|
|
@@ -32,26 +32,26 @@ public struct DevLauncherRootView: View {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
private var appName: String? {
|
|
36
|
+
guard let name = viewModel.buildInfo["appName"] as? String, !name.isEmpty else {
|
|
37
|
+
return nil
|
|
38
|
+
}
|
|
39
|
+
return name
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
private var mainContent: some View {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Text("Home")
|
|
42
|
-
}
|
|
43
|
+
TabView {
|
|
44
|
+
TabNavigation(.home, title: appName) {
|
|
45
|
+
HomeTabView()
|
|
46
|
+
}
|
|
43
47
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Text("Updates")
|
|
48
|
-
}
|
|
48
|
+
TabNavigation(.updates) {
|
|
49
|
+
UpdatesTabView()
|
|
50
|
+
}
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Text("Settings")
|
|
54
|
-
}
|
|
52
|
+
TabNavigation(.settings) {
|
|
53
|
+
SettingsTabView()
|
|
54
|
+
}
|
|
55
55
|
}
|
|
56
56
|
.onAppear {
|
|
57
57
|
DevLauncherTabBarManager.shared.setCustomAppearance()
|
|
@@ -59,23 +59,8 @@ public struct DevLauncherRootView: View {
|
|
|
59
59
|
.onDisappear {
|
|
60
60
|
DevLauncherTabBarManager.shared.restoreOriginalAppearance()
|
|
61
61
|
}
|
|
62
|
-
#if !os(macOS)
|
|
63
|
-
.navigationBarHidden(true)
|
|
64
|
-
#endif
|
|
65
62
|
.environmentObject(viewModel)
|
|
66
63
|
.environmentObject(DevLauncherNavigation(showingUserProfile: $showingUserProfile))
|
|
67
|
-
|
|
68
|
-
#if !os(macOS)
|
|
69
|
-
let navigationStack = NavigationView {
|
|
70
|
-
tabView
|
|
71
|
-
}.navigationViewStyle(.stack)
|
|
72
|
-
#else
|
|
73
|
-
let navigationStack = NavigationStack {
|
|
74
|
-
tabView
|
|
75
|
-
}
|
|
76
|
-
#endif
|
|
77
|
-
|
|
78
|
-
navigationStack
|
|
79
64
|
.onAppear {
|
|
80
65
|
viewModel.startServerDiscovery()
|
|
81
66
|
}
|
|
@@ -152,17 +137,17 @@ struct RecentlyOpenedAppRow: View {
|
|
|
152
137
|
VStack(alignment: .leading) {
|
|
153
138
|
Text(app.name)
|
|
154
139
|
.font(.headline)
|
|
155
|
-
.
|
|
140
|
+
.foregroundStyle(Color.primary)
|
|
156
141
|
Text(app.url)
|
|
157
142
|
.font(.caption)
|
|
158
|
-
.
|
|
143
|
+
.foregroundStyle(Color.secondary)
|
|
159
144
|
.lineLimit(1)
|
|
160
145
|
}
|
|
161
146
|
|
|
162
147
|
Spacer()
|
|
163
148
|
Image(systemName: "chevron.right")
|
|
164
149
|
.font(.caption)
|
|
165
|
-
.
|
|
150
|
+
.foregroundStyle(Color.secondary)
|
|
166
151
|
}
|
|
167
152
|
.padding()
|
|
168
153
|
.background(Color.expoSecondarySystemBackground)
|