How wojciech-kulik/flashspace works
Main Components
• Entry Point & Core App Logic:
• Components in FlashSpace/App (FlashSpaceApp, AppDelegate, AppDependencies, Migrations) represent the entry point and core life-cycle management.
• Feature Modules:
• FlashSpace/Features contains modular components for each feature: FocusManager (window and app focus switching), HotKeys (managing configurable hotkeys), Integrations (interfacing with external applications/systems), MenuBar (display and interaction with the macOS menu bar), PictureInPicture (handling experimental PiP capabilities), Profiles (configuration management), Settings (user preferences and configuration views), SpaceControl (preview and control of workspaces), and Workspaces (defining and managing workspaces).
• UI Components:
• FlashSpace/UI holds custom UI elements (Alerts, InputDialog, Toast notifications, HotKeyControl) to deliver user interactions and notifications.
• FlashSpace/Main deals with the main view and its corresponding view model.
• Utilities & Extensions:
• FlashSpace/Utils offers support services such as Autostart, FileChooser, PermissionsManager, and UpdatesManager.
• FlashSpace/Extensions provides helper extensions for common types and functionality that enable cleaner code throughout the application.
• Assets & Resources:
• Project & Build Infrastructure:
• Files like project.yml, the Xcode project (FlashSpace.xcodeproj), and fastlane configurations indicate the build and deployment setup.
• GitHub workflows and configuration files support continuous integration and quality checks.
Relationships and Interactions
• The Core Application interacts with multiple feature modules, invoking specialized managers (like the FocusManager or SpaceControl) based on user input or system events.
• UI components bind to feature view models (e.g., MainViewModel and SpaceControlViewModel) to reflect live status and control state.
• The Features interact with each other (e.g., HotKeys may trigger workspace changes managed by the WorkspaceManager; MenuBar features display workspace info) and with Utils for system tasks such as launching, configuration updates, and permission handling.
• Extensions provide common functionality that is used across features and the core app to simplify tasks like handling shortcuts, manipulating views, or formatting strings.
• There is also an external service integration part (e.g., SketchyBar integration) which is triggered by changes in the workspace state and handled via configurable scripts.
Architectural Patterns and Design Principles
• Modularization: Each major functionality (workspace management, window focus, hotkey management, settings) is encapsulated in its own module under the Features directory.
• MVVM for UI: The code includes clear separation between View (MainView, SpaceControlView, etc.) and ViewModel components.
• Extensions and Utility Layers: The code leverages Swift’s extension mechanism to add common functionalities and maintain DRY code.
• Clean Separation of Concerns: Core services (e.g., AppDependencies, Migrations) are isolated from UI and feature-specific logic.
Final Detailed Steps for the Principal Software Engineer
a. Start by sketching the top-level structure:
• Surround it with the major feature modules (e.g., Focus Manager, HotKeys, SpaceControl, Settings, Workspaces).
• UI components (MainView, MenuBar, etc.) connected to these features.
c. In external integrations (such as SketchyBar) to illustrate how the app interfaces with external systems.
f. Use annotations to highlight critical design decisions such as the “non-disruptive behavior” and the deliberate avoidance of managing individual app windows per workspace.