fix: bugs, improvements, and SwiftUI modernization#115
Conversation
Bugs fixed: - CheckUpdatesButton: .disabled() was on Image instead of Button - ShortcutsManager: mouse button subscriptions never fired for key+modifier shortcuts - ShortcutsManager: keyDown/keyUp monitor passed wrong userShortcut for other types - drawCircleAt: now returns NSWindow to prevent immediate deallocation - AppDelegate: removed app activation handlers that broke tracking in menu bar app - MouseTracker: replaced force unwraps with guard-let to prevent crashes - UpdatesView: @ObservedObject → @StateObject (view owns the instance) Improvements: - Constants: var → let for IGNORE_APP_BUNDLE_ID and MAIN_WINDOW_WIDTH - Preferences: cached ignored apps Set to avoid recomputing on every call - PermissionsManager: removed dead commented-out code - InfoView: removed unused hasPermissions parameter - ShortcutsManager.stopTracking: cleans up mouse subscriptions - Simplified redundant quadrant dx/dy calculation SwiftUI modernization: - foregroundColor → foregroundStyle - cornerRadius → clipShape(.rect(cornerRadius:)) - Force unwraps → if-let/guard-let throughout views
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (35)
📝 WalkthroughWalkthroughThis PR adds comprehensive SwiftUI reference documentation spanning state management, animations, accessibility, charts, and platform-specific APIs, while refactoring the Swift Shift app to improve code quality through const-correctness, safer optional handling, modern API usage, and internal logic optimization. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bugs fixed
.disabled()was onImageinstead ofButton— button was never actually disabledactiveShortcutswasn't set totrue)userShortcutwhen stopping tracking for other shortcut typesNSWindowso caller can keep a strong reference (was deallocated immediately)guard letto prevent crashes on desynced state@ObservedObject→@StateObject— view owns the instance, was being recreated every redrawImprovements
var→letforIGNORE_APP_BUNDLE_IDandMAIN_WINDOW_WIDTHSetto avoid recomputing on every callhasPermissionsparameteriw.xterms canceled out)SwiftUI modernization
foregroundColor→foregroundStyle(deprecated since iOS 15+)cornerRadius→clipShape(.rect(cornerRadius:))(deprecated)if let/guard letthroughout viewsOther
.agents/skills/swiftui-expert-skillfor SwiftUI best practices referenceSummary by CodeRabbit
Release Notes
Documentation
Bug Fixes
Refactor