style(macos): swiftformat
This commit is contained in:
@@ -153,12 +153,11 @@ enum PiOAuthStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension Data {
|
extension Data {
|
||||||
func base64URLEncodedString() -> String {
|
fileprivate func base64URLEncodedString() -> String {
|
||||||
self.base64EncodedString()
|
self.base64EncodedString()
|
||||||
.replacingOccurrences(of: "+", with: "-")
|
.replacingOccurrences(of: "+", with: "-")
|
||||||
.replacingOccurrences(of: "/", with: "_")
|
.replacingOccurrences(of: "/", with: "_")
|
||||||
.replacingOccurrences(of: "=", with: "")
|
.replacingOccurrences(of: "=", with: "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -475,7 +475,8 @@ struct OnboardingView: View {
|
|||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Text("Workspace")
|
Text("Workspace")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
Text(self.workspacePath.isEmpty ? AgentWorkspace.displayPath(for: ClawdisConfigFile.defaultWorkspaceURL()) : self.workspacePath)
|
Text(self.workspacePath.isEmpty ? AgentWorkspace
|
||||||
|
.displayPath(for: ClawdisConfigFile.defaultWorkspaceURL()) : self.workspacePath)
|
||||||
.font(.callout)
|
.font(.callout)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
@@ -491,7 +492,8 @@ struct OnboardingView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.buttonStyle(.borderedProminent)
|
.buttonStyle(.borderedProminent)
|
||||||
.disabled(self.identityApplying || self.identityName.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
|
.disabled(self.identityApplying || self.identityName.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
|
.isEmpty)
|
||||||
|
|
||||||
Button("Open workspace") {
|
Button("Open workspace") {
|
||||||
let url = AgentWorkspace.resolveWorkspaceURL(from: self.workspacePath)
|
let url = AgentWorkspace.resolveWorkspaceURL(from: self.workspacePath)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ enum WindowPlacement {
|
|||||||
fallback: ((NSScreen?) -> NSRect)? = nil)
|
fallback: ((NSScreen?) -> NSRect)? = nil)
|
||||||
{
|
{
|
||||||
let frame = window.frame
|
let frame = window.frame
|
||||||
let targetScreens = NSScreen.screens.isEmpty ? [NSScreen.main].compactMap { $0 } : NSScreen.screens
|
let targetScreens = NSScreen.screens.isEmpty ? [NSScreen.main].compactMap(\.self) : NSScreen.screens
|
||||||
let isVisibleSomewhere = targetScreens.contains { screen in
|
let isVisibleSomewhere = targetScreens.contains { screen in
|
||||||
frame.intersects(screen.visibleFrame.insetBy(dx: 12, dy: 12))
|
frame.intersects(screen.visibleFrame.insetBy(dx: 12, dy: 12))
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ enum WindowPlacement {
|
|||||||
if isVisibleSomewhere { return }
|
if isVisibleSomewhere { return }
|
||||||
|
|
||||||
let screen = NSScreen.main ?? targetScreens.first
|
let screen = NSScreen.main ?? targetScreens.first
|
||||||
let next = fallback?(screen) ?? centeredFrame(size: defaultSize, on: screen)
|
let next = fallback?(screen) ?? self.centeredFrame(size: defaultSize, on: screen)
|
||||||
window.setFrame(next, display: false)
|
window.setFrame(next, display: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user