Skip to content

Clear the build warnings - #31

Merged
JarlLyng merged 1 commit into
mainfrom
fix-warnings
Nov 18, 2026
Merged

JarlLyng merged 1 commit into
mainfrom
fix-warnings

Conversation

@JarlLyng

Copy link
Copy Markdown
Owner

What & why

Xcode Cloud reported 16 warnings on build 32. They were all still on main, and this clears them. No behavior changes.

  • ContentView.swift: ProjectImport is @MainActor. NSOpenPanel is main-actor-only, and the import button is the only caller. This clears 8 warnings.
  • EditorModel.swift: undo registration runs in MainActor.assumeIsolated. UndoManager belongs to the main actor, and every edit comes from the UI. This clears 6 warnings.
    • I did not mark the whole model @MainActor. That breaks PatternautDocument.init(configuration:), which SwiftUI may call off the main thread.
    • The guard let undoManager comes first, so a model with no undo manager yet, such as during document open, never reaches the assertion.
  • Validation.swift: removed a role that was read and never used.
  • ProjectBundleWriter.swift: xattr names are decoded with String(decoding:as:) instead of the deprecated String(cString:).

How to test

  • A clean app build has 0 warnings, down from 16. swift build in PatternautCore has 0.
  • cd PatternautCore && swift test: 162 tests pass.
  • In the app:
    • make an edit, change the tempo and the key, then undo and redo each;
    • open a saved .patternaut document;
    • import a project.

Checklist

  • Builds and runs; existing tests pass (cd PatternautCore && swift test)
  • App project regenerated with xcodegen if App/project.yml or sources changed (no new files)
  • No new tracking, accounts, subscriptions, or off-device data
  • Docs / CHANGELOG updated if behavior changed (no behavior change)

🤖 Generated with Claude Code

- ProjectImport runs on the main actor, as NSOpenPanel requires.
- The undo registration says it runs on the main actor, which owns the
  undo manager. Marking all of EditorModel would break opening documents,
  which SwiftUI may do off the main thread.
- A track role the validator read but never used is gone, and xattr names
  are decoded without the deprecated String(cString:).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JarlLyng
JarlLyng merged commit f63642d into main Nov 18, 2026
2 checks passed
@JarlLyng
JarlLyng deleted the fix-warnings branch November 18, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant