Skip to content

feat: make on-upgrade steps more obvious #172

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

Merged
merged 2 commits into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,7 @@ struct VPNMenu<VPN: VPNService, FS: FileSyncDaemon>: View {
}.buttonStyle(.plain)
TrayDivider()
}
// This shows when
// 1. The user is logged in
// 2. The network extension is installed
// 3. The VPN is unconfigured
// It's accompanied by a message in the VPNState view
// that the user needs to reconfigure.
if state.hasSession, vpn.state == .failed(.networkExtensionError(.unconfigured)) {
Button {
state.reconfigure()
} label: {
ButtonRowView {
Text("Reconfigure VPN")
}
}.buttonStyle(.plain)
}
if vpn.state == .failed(.systemExtensionError(.needsUserApproval)) {
Button {
openSystemExtensionSettings()
} label: {
ButtonRowView { Text("Approve in System Settings") }
}.buttonStyle(.plain)
} else {
AuthButton<VPN>()
}
AuthButton<VPN>()
Button {
openSettings()
appActivate()
Expand Down
38 changes: 32 additions & 6 deletions Coder-Desktop/Coder-Desktop/Views/VPN/VPNState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,43 @@ struct VPNState<VPN: VPNService>: View {
Group {
switch (vpn.state, state.hasSession) {
case (.failed(.systemExtensionError(.needsUserApproval)), _):
Text("Awaiting System Extension approval")
.font(.body)
.foregroundStyle(.secondary)
VStack {
Text("Awaiting System Extension approval")
.foregroundColor(.secondary)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, Theme.Size.trayInset)
.padding(.vertical, Theme.Size.trayPadding)
.frame(maxWidth: .infinity)
Button {
openSystemExtensionSettings()
} label: {
Text("Approve in System Settings")
}
}
case (_, false):
Text("Sign in to use Coder Desktop")
.font(.body)
.foregroundColor(.secondary)
case (.failed(.networkExtensionError(.unconfigured)), _):
Text("The system VPN requires reconfiguration.")
.font(.body)
.foregroundStyle(.secondary)
VStack {
Text("The system VPN requires reconfiguration")
.foregroundColor(.secondary)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, Theme.Size.trayInset)
.padding(.vertical, Theme.Size.trayPadding)
.frame(maxWidth: .infinity)
Button {
state.reconfigure()
} label: {
Text("Reconfigure VPN")
}
}.onAppear {
// Show the prompt onAppear, so the user doesn't have to
// open the menu bar an extra time
state.reconfigure()
}
case (.disabled, _):
Text("Enable Coder Connect to see workspaces")
.font(.body)
Expand Down
Loading