Commit 57a2f2c
authored
refactor: codebase cleanup for open source readiness (#35)
* refactor(models): split Models.swift into separate files
- Extract PortInfo.swift with port/process data model
- Extract ProcessType.swift with process categorization enum
- Extract WatchedPort.swift with notification preferences
- Extract ProcessGroup.swift for tree view grouping
- Add Errors.swift with PortKillerError enum
- Add comprehensive JSDoc documentation to all models
Each model file is now under 100 lines for better maintainability.
* feat(services): add centralized service layer
- Add NotificationService for system notification management
- Add PermissionService for accessibility/notification permissions
- Add PortGroupingService (actor) for centralized grouping logic
- Extract duplicated grouping code from views into shared service
- All services use @mainactor or actor for thread safety
* refactor(views): split MenuBarView into focused components
- MenuBarView.swift (120 lines) - Main container
- MenuBarHeader.swift - Search bar and header
- MenuBarPortList.swift - Port list rendering
- MenuBarPortRow.swift - Individual port row
- MenuBarTreeView.swift - Tree view mode
- MenuBarActions.swift - Kill all, settings, quit actions
Split 580-line file into 6 focused files under 150 lines each.
* refactor(views): split SettingsView into reusable sections
- SettingsView.swift - Main settings container
- SettingsComponents.swift - Reusable row/group components
- PermissionsSection.swift - Accessibility and notification settings
- GeneralSettingsSection.swift - Launch at login and general prefs
Split 526-line file into 4 focused files with reusable components.
* refactor(views): split PortTableView into focused components
- PortTableView.swift - Main table container with toolbar
- PortListRow.swift - Individual port row with actions
- PortSortOptions.swift - Sort enum and comparison logic
Split 444-line file into 3 focused files.
* refactor(components): split ProcessGroupListRow into focused components
- ProcessGroupRow.swift - Process group header with expand/collapse
- NestedPortRow.swift - Individual nested port row with actions
Split 270-line file into 2 focused files.
* refactor(core): modernize core components
- AppState: Add JSDoc documentation, improve organization
- UpdateManager: Already uses @observable macro
- PortScanner: Add comprehensive documentation
- Constants: Add UIConstants and AppConstants enums
Standardize patterns across core components.
* test: add Swift Testing framework with initial tests
- Add PortKillerTests target to Package.swift
- Add ProcessTypeTests for process categorization
- Add PortFilterTests for filter matching logic
Uses Swift Testing framework (not XCTest) for modern test syntax.
* docs: add contribution guidelines and style guide
- CONTRIBUTING.md: Development setup, PR process, issue reporting
- STYLE_GUIDE.md: Swift naming conventions, SwiftUI patterns,
file organization, documentation format
Prepares project for open source contributions.
* ci: add PR validation workflow
- Build & Test job: Debug/Release builds, parallel tests
- Lint job: TODO/FIXME check, file line count, doc headers
- Validate Package job: Package.swift validation
Runs on push to main and all pull requests.
* fix(test): correct filter test to not match command field
* fix(settings): add keyboard shortcuts configuration (closes #32)
- Add ShortcutsSection.swift with KeyboardShortcuts.Recorder
- Users can now customize the toggle main window shortcut
- Includes reset to default button (⌘⇧P)
- Shows accessibility permission warning when needed
Fixes issue where Cmd+Shift+P conflicts with VSCode Command Palette.
* fix(ui): improve panel resizing with proper column width constraints (closes #33)
- Add navigationSplitViewColumnWidth modifiers to all three columns
- Sidebar: min 180, ideal 220, max 280
- Content: min 300, ideal 400, max infinity
- Detail: min 280, ideal 320, max 400
- Remove redundant .frame(minWidth:) from SidebarView and PortDetailView
Fixes erratic resizing behavior reported in issue #33.
* fix: correct Twitter handle to @productdevbook
* refactor(menu): move Open PortKiller above Sponsors
* refactor(menu): group action items together1 parent 7758648 commit 57a2f2c
File tree
40 files changed
+4816
-1931
lines changed- .github/workflows
- Sources
- Managers
- Models
- Services
- Views
- Components
- MenuBar
- PortTable
- Settings
- Tests
40 files changed
+4816
-1931
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
0 commit comments