Modernize codebase: Swift 6, tests, and cleanup#137
Merged
karbassi merged 22 commits intomichaelvillar:masterfrom Feb 7, 2026
Merged
Modernize codebase: Swift 6, tests, and cleanup#137karbassi merged 22 commits intomichaelvillar:masterfrom
karbassi merged 22 commits intomichaelvillar:masterfrom
Conversation
- Raise MACOSX_DEPLOYMENT_TARGET from 10.11 to 10.13 (Xcode minimum) - Use occlusionState instead of isVisible in handleOcclusionChange - Remove redundant #available(OSX 10.13, *) check
- Update MACOSX_DEPLOYMENT_TARGET from 10.13 to 14.0 - Remove redundant #available(OSX 10.14, *) check in isDarkMode
Save selected sound index on change and restore it on launch. Menu checkmark state also reflects the saved preference.
…nto TimerLogic Move progress scale conversion, display string formatting, badge formatting, keyboard input processing, and sound filename mapping into a new TimerLogic enum with static functions. This makes the core logic unit-testable without requiring UI instantiation.
- Remove blank line after opening brace in TimerLogic and TimerTests - Sort imports in TimerTests (@testable before XCTest) - Replace arc4random_uniform with Int.random(in:) in MVTimerController - Fix comment spacing in MVTimerController - Remove superfluous swiftlint:disable for unused_setter_value in MVMainView - Move explicit_self and unused_import to analyzer_rules in config - Remove defunct anyobject_protocol rule from config
- Replace `import Cocoa` with `import AppKit` in all view/controller files - Add explicit `self.` prefix to instance members per `explicit_self` analyzer rule
- Update CI workflow to trigger on main branch instead of master - Update README deployment target from macOS 10.11 to macOS 14 (Sonoma) - Use async/await for notification authorization, log errors
…ypadEnter`, both 0x4C)
- Extract NSGradient to static constant in MVMainView (allocated every draw call) - Cache NSBezierPath for clock face hit testing in MVClockView (allocated every hitTest) - Cache NSImage resources as static constants in MVClockProgressView and MVClockFaceView - Remove unnecessary window focus notification observers from MVMainView - Scope MVClockView focus notifications to own window via viewDidMoveToWindow - Add VoiceOver accessibility to MVClockView (timer state announcements)
NSTextView is a heavyweight rich text editor with text storage, layout manager, and input handling. NSTextField with isEditable=false is far lighter for read-only labels. Adds string/setFont bridge properties for API compatibility.
- Set CURRENT_PROJECT_VERSION = 1 (CFBundleVersion was empty) - Update objectVersion 46 → 56, compatibilityVersion to Xcode 14.0 - Update developmentRegion English → en, deduplicate knownRegions - Update LastSwiftUpdateCheck/LastUpgradeCheck to 1600 - Update GCC_C_LANGUAGE_STANDARD gnu99 → gnu11 - Update CLANG_CXX_LANGUAGE_STANDARD gnu++0x → gnu++14 - Remove deprecated ALWAYS_SEARCH_USER_PATHS, GCC_DYNAMIC_NO_PIC, ENABLE_STRICT_OBJC_MSGSEND - Add explicit SWIFT_OPTIMIZATION_LEVEL = -O for Release
- Add 5 asset catalog color sets with light/dark variants for timer colors - Replace inline NSColor(srgbRed:...) with NSColor(resource:) for compile-time safety - Add VoiceOver accessibility to MVClockArrowView (slider role with duration value)
Add @mainactor to AppDelegate, replace Foundation.Timer with Task.sleep, and convert NotificationCenter observers to async sequences — eliminating all MainActor.assumeIsolated workarounds in callbacks.
…t config - Split MVClockView.swift into MVClockView.swift + MVClockView+Behavior.swift to comply with default file_length threshold - Split TimerUITests.swift into 7 focused test files with shared base class to comply with default file_length and type_body_length thresholds - Replace virtual keycode constants with event.charactersIgnoringModifiers, eliminating Keycodes.swift entirely (also improves international keyboard support) - Remove SwiftLint excluded section and disabled_rules - Enable number_separator opt-in rule - Extract AppDelegate notification observers into observeNotifications()
Extract shared accessibility time formatting to TimerLogic, make minutes/progress computed properties, replace currentImage with state enum, inline applySoundIndex, remove soundMenuItems stored array, remove docktile/timerTimeLabelFontSize properties, rename unused parameters, replace && with condition lists, and fix superfluous else.
5db3244 to
d1b7d16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issues
Test plan
make build— clean build, 0 errorsmake lint— 0 SwiftLint violationsmake test— 43 unit tests passmake uitest— 38 UI tests pass