Commit 62e3c7dafd

62e3c7dafd265558ed379cccd7ca5877f42fafec

parent: 3ae217cf9d

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-26 18:20 UTC

Fix compiler warnings in the app, widget and watch targets

Layout: unified · split

Changed files (12)
Sources/OrgApp/DocumentSession.swift +2 −2 · view
@@ -887,7 +887,7 @@ public final class DocumentSession {
887887 /// path; the subtree leaves its file only once it has. Returns a message for the echo area.
888888 @discardableResult
889889 public func refile(to target: RefileTarget, from: (path: String, offset: Int)? = nil, keep: Bool = false, now: Date = Date()) -> String? {
890 guard var (path, context) = source(from, now: now) else { return from == nil ? nil : "Can't read the entry's file." }
890 guard case (let path, var context)? = source(from, now: now) else { return from == nil ? nil : "Can't read the entry's file." }
891891 do {
892892 switch prepareMove(path, context: context, to: target.path) {
893893 case .refused(let message): return message
@@ -1099,7 +1099,7 @@ public final class DocumentSession {
10991099 /// Returns a message.
11001100 @discardableResult
11011101 public func archive(from: (path: String, offset: Int)? = nil, now: Date = Date()) -> String? {
1102 guard var (path, context) = source(from, now: now) else { return from == nil ? nil : "Can't read the entry's file." }
1102 guard case (let path, var context)? = source(from, now: now) else { return from == nil ? nil : "Can't read the entry's file." }
11031103 let destination: Archive.Destination
11041104 switch Archive.destination(context, sourcePath: path) {
11051105 case .success(let value): destination = value
Sources/Orgstar/BufferTabs.swift +1 · view
@@ -1,5 +1,6 @@
11import AppKit
22import OrgApp
3import OrgPresentation
34import SwiftUI
45
56/// A divider that resizes the pane before it by dragging. An `HSplitView` inside the window's
Sources/Orgstar/ContentView.swift +3 −3 · view
@@ -368,14 +368,14 @@ struct ContentView: View {
368368 #endif
369369 // `org-clock-out-when-done`, and the notification when the Effort runs out.
370370 clock.notifications = SystemReminderCenter.isAvailable ? SystemReminderCenter() : nil
371 session.textChanged = { [weak session, weak clock, weak commands] path in
371 session.textChanged = { [weak session = self.session, weak clock = self.clock, weak commands = self.commands] path in
372372 guard let session, let clock, let message = clock.textChanged(path, session) else { return }
373373 commands?.show(message)
374374 }
375375 clock.remindAtEffort(session)
376376 commands.knownTags = { [index = workspace.index] in (try? index.tags()) ?? [] }
377377 commands.completionIndex = workspace.index
378 commands.handoff.place = { [weak session, weak workspace] in workspace.flatMap { session?.handoffPlace(roots: $0.rootPaths) } }
378 commands.handoff.place = { [weak session = self.session, weak workspace = self.workspace] in workspace.flatMap { session?.handoffPlace(roots: $0.rootPaths) } }
379379 commands.continueHandoff = continueHandoff
380380 commands.mainWindowOpen = true
381381 commands.whatsNew = WhatsNew.pending(firstLaunch: noFolders && !welcomeShown)
@@ -987,7 +987,7 @@ struct ContentView: View {
987987 }
988988 guard method == .cp || method == .mv else { return }
989989 #endif
990 attachActions.attach(panel.urls, method: method)
990 self.attachActions.attach(panel.urls, method: method)
991991 })
992992 }
993993
Sources/Orgstar/LintPane.swift +1 · view
@@ -1,5 +1,6 @@
11import OrgApp
22import OrgCore
3import OrgPresentation
34import SwiftUI
45
56/// Lint File's panel under the editor: the problems in the open file, by line. Choosing a row
Sources/Orgstar/ReplaceInFilesSheet.swift +1 · view
@@ -1,5 +1,6 @@
11import OrgApp
22import OrgCore
3import OrgPresentation
34import SwiftUI
45
56/// Edit ▸ Find ▸ Replace in Files…, Org ▸ TODO and Tags ▸ Rename Tag… and Rename TODO Keyword…:
Sources/Orgstar/Sidebar.swift +1 · view
@@ -1,5 +1,6 @@
11import OrgApp
22import OrgCore
3import OrgPresentation
34import OrgWorkspace
45import SwiftUI
56import UniformTypeIdentifiers
Sources/Orgstar/ThemePickerSection.swift +1 −1 · view
@@ -35,7 +35,7 @@ struct ThemePickerSection: View {
3535 ForEach(ThemeSpec.palettes(appearance), id: \.id) { palette in
3636 Label {
3737 // Below 4.5:1 for body text or coloured roles in places.
38 palette.lowContrast ? Text(palette.displayName) + Text(verbatim: " – ") + Text("Low contrast") : Text(palette.displayName)
38 palette.lowContrast ? Text("\(Text(palette.displayName))\(Text(verbatim: " – "))\(Text("Low contrast"))") : Text(palette.displayName)
3939 } icon: { Image(nsImage: Self.swatch(palette)) }.tag(palette.id)
4040 }
4141 if ThemeSpec.palette(selection.wrappedValue, appearance) == nil {
Sources/OrgstarMobile/MobileFragments.swift +1 −1 · view
@@ -153,7 +153,7 @@ final class EditorFind: NSObject, @preconcurrency UITextSearching, UIFindInterac
153153
154154 /// Where `query` is in `text`, as the find bar's options ask: case, and matching a word's
155155 /// start or a whole word.
156 nonisolated static func matches(of query: String, in text: NSString, options: UITextSearchOptions) -> [Range<Int>] {
156 static func matches(of query: String, in text: NSString, options: UITextSearchOptions) -> [Range<Int>] {
157157 func isWord(_ index: Int) -> Bool {
158158 guard index >= 0, index < text.length, let scalar = Unicode.Scalar(text.character(at: index)) else { return false }
159159 return CharacterSet.alphanumerics.contains(scalar)
Sources/OrgstarMobile/ReaderScreen.swift +10 −4 · view
@@ -621,12 +621,18 @@ final class ReaderFind: NSObject, @preconcurrency UITextSearching, UIFindInterac
621621 return a < b ? .orderedAscending : a > b ? .orderedDescending : .orderedSame
622622 }
623623
624 /// May be called off the main thread; reads only `text`, an immutable string.
625624 nonisolated func performTextSearch(queryString: String, options: UITextSearchOptions, resultAggregator: UITextSearchAggregator<AnyHashable?>) {
626 for found in EditorFind.matches(of: queryString, in: text, options: options) {
627 resultAggregator.foundRange(TextRange(found), searchString: queryString, document: nil)
625 // The aggregator takes results from any thread; the ranges are made on the main thread.
626 nonisolated(unsafe) let aggregator = resultAggregator
627 let search = {
628 MainActor.assumeIsolated {
629 for found in EditorFind.matches(of: queryString, in: self.text, options: options) {
630 aggregator.foundRange(TextRange(found), searchString: queryString, document: nil)
631 }
632 }
633 aggregator.finishedSearching()
628634 }
629 resultAggregator.finishedSearching()
635 if Thread.isMainThread { search() } else { DispatchQueue.main.sync(execute: search) }
630636 }
631637
632638 func decorate(foundTextRange: UITextRange, document: AnyHashable??, usingStyle style: UITextSearchFoundTextStyle) {
Sources/OrgstarWatchWidgets/WatchWidgets.swift +2 −2 · view
@@ -72,7 +72,7 @@ struct NextEntryView: View {
7272 .accessibilityLabel(Text("\(open) open today"))
7373 case .accessoryCorner:
7474 Text("\(open)").font(.title3.weight(.semibold)).widgetLabel { Text(next?.title ?? String(localized: "Agenda clear")) }
75 .accessibilityLabel(Text("\(open) open today") + Text(verbatim: next.map { ", \($0.title)" } ?? ""))
75 .accessibilityLabel(Text("\(Text("\(open) open today"))\(Text(verbatim: next.map { ", \($0.title)" } ?? ""))"))
7676 default:
7777 VStack(alignment: .leading, spacing: 0) {
7878 Text(next?.gutter ?? String(localized: "Agenda")).font(.headline).widgetAccentable().lineLimit(1)
@@ -114,7 +114,7 @@ struct ClockView: View {
114114 }
115115 }
116116 .accessibilityElement(children: .ignore)
117 .accessibilityLabel(clock.map { Text("Clocked in") + Text(verbatim: ", \($0.heading), ") + Text($0.startedAt, style: .timer) } ?? Text("Not clocked in"))
117 .accessibilityLabel(clock.map { Text("\(Text("Clocked in"))\(Text(verbatim: ", \($0.heading), "))\(Text($0.startedAt, style: .timer))") } ?? Text("Not clocked in"))
118118 default:
119119 VStack(alignment: .leading, spacing: 0) {
120120 if let clock {
Sources/OrgstarWidgets/HabitsWidget.swift +1 −1 · view
@@ -140,7 +140,7 @@ struct HabitCells: View {
140140 }
141141 }
142142 .accessibilityElement(children: .ignore)
143 .accessibilityLabel(Text("Done \(cells.filter { $0.glyph == "*" }.count) of \(cells.count) days") + Text(verbatim: ", ") + todayState)
143 .accessibilityLabel(Text("\(Text("Done \(cells.filter { $0.glyph == "*" }.count) of \(cells.count) days"))\(Text(verbatim: ", "))\(todayState)"))
144144 }
145145
146146 /// Today's state in words.
Sources/OrgstarWidgets/TodayWidget.swift +1 −1 · view
@@ -165,7 +165,7 @@ struct WideRow: View {
165165 if let priority = row.priority { parts.append(Text("Priority \(priority)")) }
166166 parts.append(Text(verbatim: row.title))
167167 if !row.category.isEmpty { parts.append(Text(verbatim: row.category)) }
168 return parts.dropFirst().reduce(parts[0]) { $0 + Text(verbatim: ", ") + $1 }
168 return parts.dropFirst().reduce(parts[0]) { Text("\($0)\(Text(verbatim: ", "))\($1)") }
169169 }
170170}
171171
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form