Skip to content

refactor/updatetestsuite#103

Merged
NullPointerDepressiveDisorder merged 27 commits into
mainfrom
bug/updatetestsuite
Feb 12, 2026
Merged

refactor/updatetestsuite#103
NullPointerDepressiveDisorder merged 27 commits into
mainfrom
bug/updatetestsuite

Conversation

@NullPointerDepressiveDisorder

@NullPointerDepressiveDisorder NullPointerDepressiveDisorder commented Feb 10, 2026

Copy link
Copy Markdown
Owner

This pull request introduces a new MiddleDragCore module and refactors the codebase to support modularization and improved testability. The most important changes include making key manager classes public, updating protocols and dependency injection helpers for accessibility and app lifecycle management, and updating all test imports to use the new core module. Additionally, the Xcode scheme was updated to include tests for the new module.

Modularization and Public API Changes

  • Converted AccessibilityMonitor, MultitouchManager, and their related protocols and helpers to public classes and protocols, enabling their use outside the main app module. This includes making constructors, properties, and methods public where needed. (MiddleDrag/Managers/AccessibilityMonitor.swift, MiddleDrag/Managers/MultitouchManager.swift, MiddleDrag/Managers/AccessibilityWrappers.swift) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

Dependency Injection and Testability

  • Updated accessibility and app lifecycle protocols and their implementations to be public and injectable, improving testability and modularity. (MiddleDrag/Managers/AccessibilityWrappers.swift) [1] [2] [3]

Test Infrastructure Updates

Xcode Scheme Improvements

  • Updated the Xcode scheme to add MiddleDragCoreTests as a testable target, ensuring tests for the new module are run in CI and development. (MiddleDrag.xcodeproj/xcshareddata/xcschemes/MiddleDrag.xcscheme)

App Module Integration

  • Updated the main app delegate to import MiddleDragCore, reflecting the new modular structure. (MiddleDrag/AppDelegate.swift)

Note

Medium Risk
Moderate risk due to significant Xcode project/target restructuring and widened public API surface, plus concurrency/CI-specific behavioral changes that could affect runtime initialization and event handling.

Overview
Introduces a new MiddleDragCore framework target (plus MiddleDragCoreTests) and updates the Xcode scheme/test plan so CI runs the new test bundle instead of the prior app test target; the app target now embeds and depends on MiddleDragCore.

To support modularization, many previously-internal types are made public (e.g., MultitouchManager, AccessibilityMonitor, Log/CrashReporter, PreferencesManager, LaunchAtLoginManager, UpdateManager, UI helpers), and all unit tests switch @testable import to MiddleDragCore.

Stabilizes CI and test runs by disabling parallel test workers in the GitHub xcodebuild action, adding a workflow timeout, skipping app bootstrap and Sentry initialization under XCTest, avoiding posting CGEvents in CI/headless environments, and serializing DeviceMonitor start/stop with a global lock; several hardware/CGEvent-dependent tests are made opt-in via environment flags.

Written by Cursor Bugbot for commit 46c807e. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings February 10, 2026 03:47
@sentry

sentry Bot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modularizes the app by introducing a new MiddleDragCore framework target, moving most logic into the framework for improved module boundaries (notably for Swift concurrency behavior in tests) while keeping the app target as a thin entry point.

Changes:

  • Added MiddleDragCore and MiddleDragCoreTests targets and updated the Xcode project/scheme to support the new module.
  • Promoted key managers/helpers/models to public so the app target can consume the framework.
  • Updated unit tests to @testable import MiddleDragCore and added documentation describing the framework extraction.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
docs/FRAMEWORK_EXTRACTION.md New guide documenting the framework extraction and test target migration.
MiddleDrag/Utilities/UpdateManager.swift Makes UpdateManager (and delegate methods) public for framework consumption.
MiddleDrag/Utilities/SystemGestureHelper.swift Exposes helper and key APIs publicly for cross-module use.
MiddleDrag/Utilities/PreferencesManager.swift Makes manager and key APIs public for framework/app boundary.
MiddleDrag/Utilities/LaunchAtLoginManager.swift Makes manager and key APIs public for framework/app boundary.
MiddleDrag/Utilities/AnalyticsManager.swift Exposes logging/telemetry types publicly for framework consumers.
MiddleDrag/UI/MenuBarController.swift Makes controller public and exports notification names used by the app.
MiddleDrag/UI/AlertHelper.swift Makes helper class and key static APIs public.
MiddleDrag/Models/GestureModels.swift Makes config/preferences types public for framework boundary.
MiddleDrag/MiddleDragTests/*.swift Switches tests to @testable import MiddleDragCore.
MiddleDrag/Managers/MultitouchManager.swift Makes manager APIs public for use from the app module.
MiddleDrag/Managers/AccessibilityWrappers.swift Makes DI protocols/wrappers public to support testing and modularization.
MiddleDrag/Managers/AccessibilityMonitor.swift Makes monitor APIs public for use from the app module.
MiddleDrag/AppDelegate.swift Imports MiddleDragCore in the app entry point.
MiddleDrag.xcodeproj/xcshareddata/xcschemes/MiddleDrag.xcscheme Adds MiddleDragCoreTests to the scheme’s test action.
MiddleDrag.xcodeproj/project.pbxproj Adds framework/test targets, embeds the framework, and updates build/link settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread MiddleDrag.xcodeproj/project.pbxproj Outdated
Comment thread MiddleDrag/Managers/MultitouchManager.swift Outdated
Comment thread MiddleDrag/Utilities/AnalyticsManager.swift Outdated
Comment thread docs/FRAMEWORK_EXTRACTION.md Outdated
Comment thread MiddleDrag.xcodeproj/xcshareddata/xcschemes/MiddleDrag.xcscheme Outdated
Comment thread MiddleDrag.xcodeproj/project.pbxproj Outdated
Comment thread docs/FRAMEWORK_EXTRACTION.md Outdated
Comment thread MiddleDrag.xcodeproj/xcshareddata/xcschemes/MiddleDrag.xcscheme Outdated
@NullPointerDepressiveDisorder NullPointerDepressiveDisorder changed the title Bug/updatetestsuite refactor/updatetestsuite Feb 10, 2026
Comment thread MiddleDrag/Managers/MultitouchManager.swift Outdated
Comment thread MiddleDrag.xcodeproj/xcshareddata/xcschemes/MiddleDrag.xcscheme Outdated
Comment thread MiddleDrag.xcodeproj/project.pbxproj Outdated
Comment thread MiddleDrag/Models/GestureModels.swift
Comment thread MiddleDrag.xcodeproj/project.pbxproj Outdated
Comment thread MiddleDrag.xcodeproj/project.pbxproj Outdated
…raction documentation and adjusting test suite for improved concurrency handling
…nitor to prevent hangs in CI environments and improve thread safety in multitouch operations
…ses, preventing potential dereferencing issues.
…roper cleanup of status item on deallocation
… tests in headless CI environments, improving test reliability.
… in headless CI environments, preventing potential hangs during mouse location retrieval.
…e process and focus on running tests with coverage.
Comment thread MiddleDrag/MiddleDragTests/DeviceMonitorTests.swift Outdated
…kflow, and update test methods to conditionally skip based on environment variables, improving test flexibility and reliability.
…ent tests in the CI workflow, simplifying the test configuration and enhancing clarity.
…Services and set a timeout for the build and test job, improving stability and preventing hangs during execution.
…allel testing and limit workers to one, preventing hangs during DeviceMonitor/Multitouch tests.
…it/integration tests, improving test execution flow and preventing unnecessary initialization.
@NullPointerDepressiveDisorder NullPointerDepressiveDisorder added the tests PR adds tests label Feb 11, 2026
Comment thread MiddleDrag/UI/MenuBarController.swift
… status item on deallocation, ensuring proper cleanup on both main and background threads.
…ruct for improved memory management and safety during deinitialization, ensuring proper cleanup on both main and background threads. Additionally, modify Xcode project settings to enable Objective-C header installation and adjust build script for debug symbol uploads.
Comment thread MiddleDrag/Core/MouseEventGenerator.swift
… AppKit screen API calls from background queues in CI environments, ensuring stability and avoiding potential hangs during mouse location retrieval.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread MiddleDrag/Managers/DeviceMonitor.swift Outdated
…nt blocking during cleanup operations, ensuring smoother start/stop transitions and enhancing thread safety.
Comment thread MiddleDrag/Core/MouseEventGenerator.swift
…read mouse location using AppKit on the main thread, ensuring thread safety and improving fallback handling for Quartz coordinates.
@NullPointerDepressiveDisorder
NullPointerDepressiveDisorder merged commit 8118b5f into main Feb 12, 2026
7 checks passed
@NullPointerDepressiveDisorder
NullPointerDepressiveDisorder deleted the bug/updatetestsuite branch February 12, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests PR adds tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants