Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:
jobs:
markedit-mac:
name: MarkEditMac
runs-on: macos-26
runs-on: macos-27
if: github.event.pull_request.draft == false
env:
node-version: '22.x'
DEVELOPER_DIR: /Applications/Xcode_26.5.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_27.0.app/Contents/Developer

defaults:
run:
Expand Down
16 changes: 8 additions & 8 deletions MarkEdit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -1143,7 +1143,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -1182,7 +1182,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MARKETING_VERSION = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "$(inherited)";
PRODUCT_NAME = MarkEdit;
Expand Down Expand Up @@ -1219,7 +1219,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MARKETING_VERSION = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "$(inherited)";
PRODUCT_NAME = MarkEdit;
Expand Down Expand Up @@ -1261,7 +1261,7 @@
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MARKETING_VERSION = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "$(inherited).finder-extension";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1307,7 +1307,7 @@
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MARKETING_VERSION = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "$(inherited).finder-extension";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1340,7 +1340,7 @@
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MARKETING_VERSION = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "$(inherited).preview-extension";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1371,7 +1371,7 @@
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MARKETING_VERSION = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "$(inherited).preview-extension";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
6 changes: 3 additions & 3 deletions MarkEditCore/Package.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// swift-tools-version: 6.0
// swift-tools-version: 6.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "MarkEditCore",
platforms: [
.iOS(.v18),
.macOS(.v15),
.iOS(.v26),
.macOS(.v26),
],
products: [
.library(
Expand Down
6 changes: 3 additions & 3 deletions MarkEditKit/Package.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// swift-tools-version: 6.0
// swift-tools-version: 6.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "MarkEditKit",
platforms: [
.iOS(.v18),
.macOS(.v15),
.iOS(.v26),
.macOS(.v26),
],
products: [
.library(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class EditorModuleFoundationModels: NativeModuleFoundationModels {

public func availability(modelName: String) async -> String {
#if canImport(FoundationModels, _version: 2)
if #available(macOS 27.0, *) {
if #available(anyAppleOS 27.0, *) {
return availability(of: languageModel(named: modelName)).jsonEncoded
}
#endif
Expand All @@ -35,15 +35,11 @@ public final class EditorModuleFoundationModels: NativeModuleFoundationModels {
}

public func createSession(modelName: String, instructions: String?) async -> String? {
guard #available(macOS 26.0, *) else {
return nil
}

let identifier = UUID().uuidString
let session: LanguageModelSession

#if canImport(FoundationModels, _version: 2)
if #available(macOS 27.0, *) {
if #available(anyAppleOS 27.0, *) {
session = LanguageModelSession(
model: languageModel(named: modelName),
instructions: instructions
Expand All @@ -60,7 +56,7 @@ public final class EditorModuleFoundationModels: NativeModuleFoundationModels {
}

public func isResponding(sessionID: String?) async -> Bool {
guard #available(macOS 26.0, *), let session = session(with: sessionID) else {
guard let session = session(with: sessionID) else {
return false
}

Expand All @@ -80,7 +76,7 @@ public final class EditorModuleFoundationModels: NativeModuleFoundationModels {
).jsonEncoded
}

guard #available(macOS 26.0, *), let session = session(with: sessionID) else {
guard let session = session(with: sessionID) else {
return encode(nil, "Model Unavailable", true)
}

Expand Down Expand Up @@ -122,7 +118,7 @@ public final class EditorModuleFoundationModels: NativeModuleFoundationModels {
}
}

guard #available(macOS 26.0, *), let session = session(with: sessionID) else {
guard let session = session(with: sessionID) else {
return didReceive(nil, "Model Unavailable", true)
}

Expand All @@ -148,10 +144,6 @@ public final class EditorModuleFoundationModels: NativeModuleFoundationModels {
// MARK: - Private

private var defaultModelAvailability: LanguageModelAvailability {
guard #available(macOS 26.0, *) else {
return LanguageModelAvailability(isAvailable: false, unavailableReason: "Unsupported OS Version")
}

switch SystemLanguageModel.default.availability {
case .available:
return LanguageModelAvailability(isAvailable: true, unavailableReason: nil)
Expand All @@ -166,12 +158,10 @@ public final class EditorModuleFoundationModels: NativeModuleFoundationModels {
}
}

// [macOS 26] Change the value type to LanguageModelSession
private var sessionPool = [String: AnyObject]()
private var sessionPool = [String: LanguageModelSession]()

@available(macOS 26.0, *)
private func session(with sessionID: String?) -> LanguageModelSession? {
guard let sessionID, let session = (sessionPool[sessionID] as? LanguageModelSession) else {
guard let sessionID, let session = sessionPool[sessionID] else {
return nil
}

Expand All @@ -183,7 +173,7 @@ public final class EditorModuleFoundationModels: NativeModuleFoundationModels {

#if canImport(FoundationModels, _version: 2)

@available(macOS 27.0, *)
@available(anyAppleOS 27.0, *)
private extension EditorModuleFoundationModels {
func languageModel(named modelName: String) -> any LanguageModel {
switch modelName {
Expand Down Expand Up @@ -212,7 +202,6 @@ private extension EditorModuleFoundationModels {

#endif

@available(macOS 26.0, *)
private extension GenerationOptions {
init(_ options: LanguageModelGenerationOptions?) {
#if canImport(FoundationModels, _version: 2)
Expand All @@ -231,7 +220,6 @@ private extension GenerationOptions {
}
}

@available(macOS 26.0, *)
private extension GenerationOptions.SamplingMode {
init?(_ sampling: LanguageModelSampling?) {
if sampling?.greedy == true {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ public final class EditorModuleTranslation: NativeModuleTranslation {
public init() {}

public func translate(text: String, from: String?, to: String?) async -> String {
guard #available(macOS 26.0, *) else {
return TranslationResponse(error: "Unsupported OS Version").jsonEncoded
}

do {
let from = from ?? NLLanguageRecognizer.dominantLanguage(for: text)?.rawValue ?? "en-US"
let session = TranslationSession(from: from, to: to)
Expand All @@ -41,7 +37,6 @@ private struct TranslationResponse: Encodable {
}
}

@available(macOS 26.0, *)
private extension TranslationSession {
convenience init(from: String, to: String?) {
self.init(
Expand Down
4 changes: 2 additions & 2 deletions MarkEditMac/Modules/Package.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// swift-tools-version: 6.0
// swift-tools-version: 6.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Modules",
platforms: [
.macOS(.v15),
.macOS(.v26),
],
products: [
.library(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ public extension NSPasteboard {
}

func url() async -> String? {
guard #available(macOS 15.4, *) else {
guard let string else {
return string(forType: .URL)
}

return NSDataDetector.extractURL(from: string)
}

// This alerts the user only when the pasteboard really contains links
let values = try? await Self.general.detectedValues(for: [\.links])
return values?.links.first?.url.absoluteString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,13 @@ public extension NSColor {
.theme(light: NSColor(white: 0, alpha: 0.3), dark: NSColor(white: 1, alpha: 0.3))
}

static var plainButtonHighlighted: NSColor {
.theme(light: NSColor(white: 0, alpha: 0.1), dark: NSColor(white: 1, alpha: 0.1))
}

static var pushButtonBackground: NSColor {
.theme(light: .white, dark: NSColor(hexCode: 0x565a61))
}

static var modernButtonBackground: NSColor {
.theme(light: NSColor(white: 0, alpha: 0.08), dark: NSColor(white: 1, alpha: 0.066))
}

static var finderContentBackground: NSColor {
if #available(macOS 26.0, *) {
return .windowBackgroundColor
}

return .theme(light: .white, dark: .windowBackgroundColor)
}
}

// MARK: - Convenience Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public protocol FileVersionPickerDelegate: AnyObject {
A custom file version picker to replace Time Machine due to its performance issues.
*/
public final class FileVersionPicker: NSViewController {
private let modernStyle: Bool
private let fileURL: URL
private let currentText: String
private let localizable: FileVersionLocalizable
Expand Down Expand Up @@ -94,7 +93,6 @@ public final class FileVersionPicker: NSViewController {
}()

private lazy var navigateButtons = RoundedNavigateButtons(
modernStyle: modernStyle,
leftAction: { [weak self] in
self?.goBack()
},
Expand Down Expand Up @@ -127,14 +125,12 @@ public final class FileVersionPicker: NSViewController {
private weak var delegate: FileVersionPickerDelegate?

public init(
modernStyle: Bool,
fileURL: URL,
currentText: String,
localVersions: [NSFileVersion],
localizable: FileVersionLocalizable,
delegate: FileVersionPickerDelegate
) {
self.modernStyle = modernStyle
self.fileURL = fileURL
self.currentText = currentText
self.allVersions = localVersions
Expand Down Expand Up @@ -280,7 +276,7 @@ private extension FileVersionPicker {
navigateButtons.trailingAnchor.constraint(equalTo: topGuide.trailingAnchor, constant: -Constants.layoutPadding),
navigateButtons.centerYAnchor.constraint(equalTo: topGuide.centerYAnchor),
navigateButtons.widthAnchor.constraint(equalToConstant: navigateButtons.frame.width),
navigateButtons.heightAnchor.constraint(equalTo: versionMenuButton.heightAnchor, constant: modernStyle ? 0 : -2),
navigateButtons.heightAnchor.constraint(equalTo: versionMenuButton.heightAnchor),

modeMenuButton.trailingAnchor.constraint(equalTo: navigateButtons.leadingAnchor, constant: -Constants.layoutPadding),
modeMenuButton.centerYAnchor.constraint(equalTo: topGuide.centerYAnchor),
Expand Down
2 changes: 1 addition & 1 deletion MarkEditMac/Modules/Sources/FontPicker/FontPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private extension FontPicker {
)
}

let location = CGPoint(x: configuration.modernStyle ? -4 : 0, y: sourceView.frame.height - 10)
let location = CGPoint(x: -4, y: sourceView.frame.height - 10)
menu.popUp(positioning: nil, at: location, in: sourceView)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import AppKit
import CoreText

public struct FontPickerConfiguration {
let modernStyle: Bool
let selectedFontStyle: FontStyle
let selectedFontSize: Double
let selectButtonTitle: String
Expand All @@ -21,7 +20,6 @@ public struct FontPickerConfiguration {
let serifFontName: String

public init(
modernStyle: Bool,
selectedFontStyle: FontStyle,
selectedFontSize: Double,
selectButtonTitle: String,
Expand All @@ -33,7 +31,6 @@ public struct FontPickerConfiguration {
roundedFontName: String,
serifFontName: String
) {
self.modernStyle = modernStyle
self.selectedFontStyle = selectedFontStyle
self.selectedFontSize = selectedFontSize
self.selectButtonTitle = selectButtonTitle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ public extension View {
}

func formBreathingInset() -> some View {
if #available(macOS 26.0, *) {
// For unknown reasons, this is required to prevent extreme tight spacing
return padding(.top, .ulpOfOne)
}

return self
// For unknown reasons, this is required to prevent extreme tight spacing
padding(.top, .ulpOfOne)
}
}

Expand All @@ -61,10 +57,6 @@ private extension HorizontalAlignment {

private struct FlexibleButtonSize: ViewModifier {
func body(content: Content) -> some View {
if #available(macOS 26.0, *) {
content.buttonSizing(.flexible)
} else {
content
}
content.buttonSizing(.flexible)
}
}
Loading