Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b348029

Browse files
committedMay 29, 2025·
feat: make on-upgrade steps more obvious
1 parent 5785fae commit b348029

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed
 

‎Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenu.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -81,30 +81,6 @@ struct VPNMenu<VPN: VPNService, FS: FileSyncDaemon>: View {
8181
}.buttonStyle(.plain)
8282
TrayDivider()
8383
}
84-
// This shows when
85-
// 1. The user is logged in
86-
// 2. The network extension is installed
87-
// 3. The VPN is unconfigured
88-
// It's accompanied by a message in the VPNState view
89-
// that the user needs to reconfigure.
90-
if state.hasSession, vpn.state == .failed(.networkExtensionError(.unconfigured)) {
91-
Button {
92-
state.reconfigure()
93-
} label: {
94-
ButtonRowView {
95-
Text("Reconfigure VPN")
96-
}
97-
}.buttonStyle(.plain)
98-
}
99-
if vpn.state == .failed(.systemExtensionError(.needsUserApproval)) {
100-
Button {
101-
openSystemExtensionSettings()
102-
} label: {
103-
ButtonRowView { Text("Approve in System Settings") }
104-
}.buttonStyle(.plain)
105-
} else {
106-
AuthButton<VPN>()
107-
}
10884
Button {
10985
openSettings()
11086
appActivate()

‎Coder-Desktop/Coder-Desktop/Views/VPN/VPNState.swift

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,45 @@ struct VPNState<VPN: VPNService>: View {
1010
Group {
1111
switch (vpn.state, state.hasSession) {
1212
case (.failed(.systemExtensionError(.needsUserApproval)), _):
13-
Text("Awaiting System Extension approval")
14-
.font(.body)
15-
.foregroundStyle(.secondary)
13+
VStack {
14+
Text("Awaiting System Extension approval")
15+
.font(.headline)
16+
.foregroundColor(.secondary)
17+
.multilineTextAlignment(.center)
18+
.fixedSize(horizontal: false, vertical: true)
19+
.padding(.horizontal, Theme.Size.trayInset)
20+
.padding(.vertical, Theme.Size.trayPadding)
21+
.frame(maxWidth: .infinity)
22+
Button {
23+
openSystemExtensionSettings()
24+
} label: {
25+
Text("Approve in System Settings")
26+
}
27+
}
1628
case (_, false):
1729
Text("Sign in to use Coder Desktop")
1830
.font(.body)
1931
.foregroundColor(.secondary)
2032
case (.failed(.networkExtensionError(.unconfigured)), _):
21-
Text("The system VPN requires reconfiguration.")
22-
.font(.body)
23-
.foregroundStyle(.secondary)
33+
VStack {
34+
Text("The system VPN requires reconfiguration")
35+
.font(.headline)
36+
.foregroundColor(.secondary)
37+
.multilineTextAlignment(.center)
38+
.fixedSize(horizontal: false, vertical: true)
39+
.padding(.horizontal, Theme.Size.trayInset)
40+
.padding(.vertical, Theme.Size.trayPadding)
41+
.frame(maxWidth: .infinity)
42+
Button {
43+
state.reconfigure()
44+
} label: {
45+
Text("Reconfigure VPN")
46+
}
47+
}.onAppear {
48+
// Show the prompt onAppear, so the user doesn't have to
49+
// open the menu bar an extra time
50+
state.reconfigure()
51+
}
2452
case (.disabled, _):
2553
Text("Enable Coder Connect to see workspaces")
2654
.font(.body)

0 commit comments

Comments
 (0)
Please sign in to comment.