Skip to content

Commit b7ca50f

Browse files
committed
fix(concurrency): resolve Swift 6 strict concurrency and UI compilation issues
1 parent ff63f41 commit b7ca50f

32 files changed

Lines changed: 345 additions & 321 deletions

OpenClip.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,8 +1903,8 @@
19031903
isa = XCRemoteSwiftPackageReference;
19041904
repositoryURL = "https://github.com/sindresorhus/KeyboardShortcuts";
19051905
requirement = {
1906-
kind = exactVersion;
1907-
version = 2.2.2;
1906+
kind = upToNextMajorVersion;
1907+
minimumVersion = 2.0.0;
19081908
};
19091909
};
19101910
0BBBF5D087479FC9C36D0D54 /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */ = {

Sources/Core/Actions/URLTemplateAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public struct URLTemplateAction: Action, Sendable {
6060
// no-ops.
6161
let trimmed = context.selection.text.trimmingCharacters(in: .whitespacesAndNewlines)
6262
let performContext: ActionContext
63-
if let match = context.match {
63+
if context.match != nil {
6464
performContext = context
6565
} else {
6666
performContext = ActionContext(

Sources/Core/Extensions/Trust/ExtensionTrustGate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ public enum ExtensionTrustGate {
118118
) -> ExtensionGatePlan {
119119
var trust = trust
120120
var hashes = hashes
121-
var sources = sources
121+
let sources = sources
122122
var newMigrated = isMigrated
123123
var migratedChanged = false
124124
var trustChanged = false
125125
var hashesChanged = false
126-
var sourcesChanged = false
126+
let sourcesChanged = false
127127
var events: [ExtensionTrustChange] = []
128128
var result: [any Action] = []
129129

Sources/Core/Utils/TextPlaceholderEngine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct TextPlaceholderEngine {
2424
public static func replacePlaceholders(
2525
in template: String,
2626
context: ActionContext,
27-
urlEncode: Bool
27+
urlEncode: Bool = true
2828
) -> String {
2929
replace(
3030
in: template,

Sources/OpenClip/AI/Providers/OllamaProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public final class OllamaProvider: AIProvider {
8282
guard let url = URL(string: "\(normalized)/api/tags") else {
8383
throw AIError.invalidURL("\(normalized)/api/tags")
8484
}
85-
var request = URLRequest(url: url, timeoutInterval: 5)
85+
let request = URLRequest(url: url, timeoutInterval: 5)
8686
let (data, response) = try await URLSession.shared.data(for: request)
8787
guard let http = response as? HTTPURLResponse, http.statusCode == 200 else {
8888
throw AIError.invalidResponse

Sources/OpenClip/Platform/HotkeyManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public final class HotkeyManager {
2929
}
3030

3131
let frontApp = NSWorkspace.shared.frontmostApplication ?? NSRunningApplication.current
32-
let policy = await RuleEngine.shared.resolvePolicies(for: frontApp.bundleIdentifier ?? "")
32+
let policy = RuleEngine.shared.resolvePolicies(for: frontApp.bundleIdentifier ?? "")
3333
let appIdentity = AppIdentity(frontApp)
3434

3535
// Start the paste-availability probe now, in parallel with selection retrieval, so

Sources/OpenClip/Platform/Selection/AXElementInspector.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ public struct AXElementInspector {
129129
/// from a CF value is diagnosed as an unconditional cast, so the CF type ID is checked first.
130130
private static func axElement(_ value: CFTypeRef?) -> AXUIElement? {
131131
guard let value, CFGetTypeID(value) == AXUIElementGetTypeID() else { return nil }
132-
return value as! AXUIElement
132+
let element: AXUIElement = value as! AXUIElement
133+
return element
133134
}
134135

135136
/// The selection bounds for a text range via `kAXBoundsForRangeParameterizedAttribute`,

Sources/OpenClip/Platform/Selection/AXMenuNavigator.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ public struct AXMenuNavigator {
185185

186186
private static func axElement(_ value: CFTypeRef?) -> AXUIElement? {
187187
guard let value, CFGetTypeID(value) == AXUIElementGetTypeID() else { return nil }
188-
return value as! AXUIElement
188+
let element: AXUIElement = value as! AXUIElement
189+
return element
189190
}
190191

191192
// MARK: - Localized titles

Sources/OpenClip/UI/Design/LiquidGlass.swift

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,14 @@ public enum LiquidGlassVariant {
2020

2121
@MainActor
2222
public extension View {
23-
/// Renders the view as a Liquid Glass surface on macOS 26+, or an ultra-thin
24-
/// standard material on macOS 14-15 so the UI keeps a similar frosted look.
23+
/// Renders the view as a glass surface using ultra-thin material for a frosted look.
2524
func glassSurface(
2625
_ variant: LiquidGlassVariant = .regular,
2726
cornerRadius: CGFloat = 14
2827
) -> some View {
29-
Group {
30-
if #available(macOS 26.0, *) {
31-
glassEffect(
32-
variant == .regular ? .regular : .clear,
33-
in: RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
34-
)
35-
} else {
36-
background(
37-
.ultraThinMaterial,
38-
in: RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
39-
)
40-
}
41-
}
28+
background(
29+
.ultraThinMaterial,
30+
in: RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
31+
)
4232
}
4333
}

Sources/OpenClip/UI/Popup/PopupPositioner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public struct PopupPositioner: Sendable {
3737
let popupWidth = max(0, min(width, maxPopupWidth))
3838

3939
// --- Horizontal: center on release X, clamp to edges ---
40-
var x = releaseX - popupWidth / 2
40+
let x = releaseX - popupWidth / 2
4141
return max(screenBounds.minX + padding, min(x, screenBounds.maxX - popupWidth - padding))
4242
}
4343

0 commit comments

Comments
 (0)