Skip to content

Commit d99c452

Browse files
committed
Update CopilotView
1 parent 9df3514 commit d99c452

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

Core/Sources/HostApp/AccountSettings/CopilotView.swift

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SwiftUI
77

88
struct CopilotView: View {
99
static var copilotAuthService: GitHubCopilotAuthServiceType?
10-
10+
1111
class Settings: ObservableObject {
1212
@AppStorage(\.nodePath) var nodePath: String
1313
@AppStorage(\.runNodeWith) var runNodeWith
@@ -26,7 +26,7 @@ struct CopilotView: View {
2626
@State var version: String?
2727
@State var isRunningAction: Bool = false
2828
@State var isUserCodeCopiedAlertPresented = false
29-
29+
3030
func getGitHubCopilotAuthService() throws -> GitHubCopilotAuthServiceType {
3131
if let service = Self.copilotAuthService { return service }
3232
let service = try GitHubCopilotAuthService()
@@ -56,17 +56,15 @@ struct CopilotView: View {
5656
} label: {
5757
Text("Run Node with")
5858
}
59-
60-
VStack { // workaround a layout issue of SwiftUI
61-
Text(
62-
"You may have to restart the helper app to apply the changes. To do so, simply close the helper app by clicking on the menu bar icon that looks like a steer wheel, it will automatically restart as needed."
63-
)
64-
.lineLimit(nil)
65-
.fixedSize(horizontal: false, vertical: true)
66-
.foregroundColor(.secondary)
67-
}
6859
}
6960

61+
Text(
62+
"You may have to restart the helper app to apply the changes. To do so, simply close the helper app by clicking on the menu bar icon that looks like a steer wheel, it will automatically restart as needed."
63+
)
64+
.lineLimit(6)
65+
.fixedSize(horizontal: false, vertical: true)
66+
.foregroundColor(.secondary)
67+
7068
VStack(alignment: .leading) {
7169
Text("Language Server Version: \(version ?? "Loading..")")
7270
Text("Status: \(status?.description ?? "Loading..")")
@@ -104,9 +102,9 @@ struct CopilotView: View {
104102
RoundedRectangle(cornerRadius: 8)
105103
.stroke(Color(nsColor: .separatorColor), style: .init(lineWidth: 1))
106104
}
107-
105+
108106
Divider()
109-
107+
110108
Form {
111109
Toggle("Verbose Log", isOn: $settings.gitHubCopilotVerboseLog)
112110
}
@@ -128,7 +126,7 @@ struct CopilotView: View {
128126
version = try await service.version()
129127
isRunningAction = false
130128

131-
if status != .ok && status != .notSignedIn {
129+
if status != .ok, status != .notSignedIn {
132130
toast(
133131
Text(
134132
"GitHub Copilot status is not \"ok\". Please check if you have a valid GitHub Copilot subscription."

0 commit comments

Comments
 (0)