macOS dock enhancement app — window previews on dock hover, Alt+Tab window switcher, Cmd+Tab overlay. Menu bar only (LSUIElement: true). Swift 5.10 / SwiftUI / AppKit. GPL-3.0.
Open DockDoor.xcodeproj in Xcode and build (Cmd+R). No CLI build commands — this is an Xcode-managed project, not SPM.
Every new .swift file must be registered in DockDoor.xcodeproj/project.pbxproj:
- Generate two UUIDs:
for i in 1 2; do uuidgen | tr -d '-'; done - Add a
PBXFileReferenceentry - Add a
PBXBuildFileentry referencing it - Add the file ref to the correct
PBXGroup - Add the build file to
PBXSourcesBuildPhase
All user preferences are declared in consts.swift under extension Defaults.Keys.
Every new setting must be indexed in the search system:
-
Add a
.settingsSearchTarget("tab.settingName")modifier to the control in the view:Toggle(isOn: $mySetting) { Text("My Setting") } .settingsSearchTarget("general.mySetting")
-
Add a catalog entry in
Views/Settings/Search/SettingsSearchCatalog.swift:SettingsSearchItem( id: "general.mySetting", // must match the search target title: String(localized: "My Setting"), // exact string from the view description: String(localized: "Optional description text"), keywords: ["internal", "search", "tokens"], tab: "General", // matches sidebar tab tag section: String(localized: "Section Header"), icon: "sf.symbol.name" )
-
If adding a new settings tab, also update
SettingsSearchEngine.swift— add totabDisplayOrderandtabDisplayNames.
titleanddescriptionuseString(localized:)with the exact same literal as the view — reuses existing translationskeywordsare internal English tokens only (not translated, not displayed)- The
idmust match between the catalog entry and.settingsSearchTarget()call
- Use
String(localized:comment:)for user-facing strings - Do not edit
Localizable.xcstringsdirectly — managed via Crowdin - macOS 13.0 minimum — use single-parameter
onChange { newValue in }form
- No verbose comments — only comment non-obvious logic
- No doc comments unless the API is public and non-obvious
- UI state belongs in coordinators, not views
- Window operations go through
WindowUtilstatic methods - Reusable settings UI goes in
Views/Settings/Shared Components/
| File | Purpose |
|---|---|
consts.swift |
All user preference keys |
WindowUtil.swift |
Window discovery/manipulation (Accessibility APIs) |
DockObserver.swift |
Dock hover detection and event routing |
SharedPreviewWindowCoordinator.swift |
Preview panel lifecycle |
Views/Settings/Search/SettingsSearchCatalog.swift |
Settings search index |