Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ready for Review - [MouseJump] move "common" classes into separate project #34333

Conversation

mikeclayton
Copy link
Contributor

@mikeclayton mikeclayton commented Aug 17, 2024

Summary of the Pull Request

This is an attempt to break PR #33486 ([Mouse Jump] - Customisable appearance - borders, margins, colours) down into smaller chunks because it's gotten unmanageable due to its age and number of commits (currently 37 commits / 205 files changed and 25 merge conflicts).

This PR just moves the files in the "MouseJumpUI\Common" folder into a separate *.csproj project so that it can eventually be referenced by the SettingsUI project to draw a sample preview image when style settings are changed. There's no functionality changes in the code, just a move of the existing classes into a separate project (and updating the namespaces), so it'll hopefully be a lot easier to review than #33486, which can eventually be cancelled.

A separate follow-up PR will re-implement the Settings UI changes to close PR #33486 and Issue #27511.

PR Checklist

Detailed Description of the Pull Request / Additional comments

This PR moves all of the code currently held in the MouseJumpUI project under "src\modules\MouseUtils\MouseJumpUI\Common" into a new project "MouseJump.Common". This will allow the project to be referenced from the SettingsUI project in a follow-up PR as part of the work to implement customisable style settings.

Validation Steps Performed

  • Workflow tests
    • Automated tests passing locally
    • Minimal actions workflow (spelling check) passing for PR
    • Full actions workflow (msbuild) passing for PR
  • UI tests
  • Lifecycle tests
    • Starting PowerToys Runner launches MouseJumpUI.exe when enabled, and not when disabled
    • Enabling / disabling Mouse Jump in settings starts / stops MouseJumpUI.exe
    • Exiting PowerToys Runner stops MouseJumpUI.exe
    • Killing runner exe via Task Manager stops MouseJumpUI.exe
    • Stopping Visual Studio local debug run stops MouseJumpUI.exe
      • note - runner needs to be in non-admin mode otherwise Visual Studio debugger disconnects at launch
    • Hotkey and size settings are automatically reloaded when config file is modified from Settings UI
    • Hotkey and size settings are automatically reloaded when config file is modified manually (e.g. in notepad) while runner and MouseJumpUI.exe are running
  • Internal Test Suite
    • Enable Mouse Jump. Then:
    • Press the activation shortcut and verify the screens preview appears.
    • Change activation shortcut and verify that new shortcut triggers Mouse Jump.
    • Click around the screen preview and ensure that mouse cursor jumped to clicked location.
    • Reorder screens in Display settings and confirm that Mouse Jump reflects the change and still works correctly.
    • Change scaling of screens and confirm that Mouse Jump still works correctly.
    • Unplug additional monitors and confirm that Mouse Jump still works correctly.
    • Disable Mouse Jump and verify that the module is not activated when you press the activation shortcut.

@mikeclayton mikeclayton marked this pull request as draft August 17, 2024 19:31
Clayton added 5 commits August 17, 2024 21:19
… the checks

# Conflicts:
#	src/modules/MouseUtils/MouseJump.Common.UnitTests/MouseJump.Common.UnitTests.csproj
# Conflicts:
#	src/modules/MouseUtils/MouseJump.Common.UnitTests/MouseJump.Common.UnitTests.csproj

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@mikeclayton
Copy link
Contributor Author

mikeclayton commented Aug 22, 2024

So it looks like adding <UseWinforms>true</UseWinForms> to MouseJump.Common.csproj has fixed the problem with verifyDepsJsonLibraryVersions.ps1 detecting a different version of System.Drawing.Common.dll being referenced in MouseJump.Common versus all the other modules.

I'm not keen on it as a fix as MouseJump.Common only really needs a reference to System.Drawing.Common and not the whole WinForms, but I can't work out how to get the build to use the right version of System.Drawing.Common, so this might have to do for now :-S...

@mikeclayton mikeclayton marked this pull request as ready for review August 23, 2024 13:36
@mikeclayton mikeclayton changed the title WIP - [MouseJump] move "common" classes into separate project Ready for Review - [MouseJump] move "common" classes into separate project Aug 23, 2024
@mikeclayton
Copy link
Contributor Author

mikeclayton commented Aug 23, 2024

I think this PR is ready for review now - the manual and automated tests all work and the build pipeline is green.

The only remaining piece of work is to incorporate the new "MouseJump.Common.dll" assembly into the installer. I'm not super-confident about what is required for that - would someone from the core team be able to help?

@crutkas crutkas added the Needs-Review This Pull Request awaits the review of a maintainer. label Aug 26, 2024
@mikeclayton
Copy link
Contributor Author

Fixed a bunch of merge conflicts - build is working again.

@mikeclayton
Copy link
Contributor Author

@jaimecbernardo - just a quick head-up - before this gets merged into main the new MouseJump.Common.dll needs to be added to the installer, which I wasn't confident about doing myself...

@jaimecbernardo
Copy link
Collaborator

@jaimecbernardo - just a quick head-up - before this gets merged into main the new MouseJump.Common.dll needs to be added to the installer, which I wasn't confident about doing myself...

Thanks for the heads up. It should be added automatically, but it might need to be included in signing.

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

Hi @mikeclayton , I've given it a try but after building in Visual Studio the MouseJump exe doesn't seem to be created. Can you please try building the PR from a clean state and verifying? I think the changes done to the .csproj might be related to this issue.
Thank you for the contribution, but can you please make the PR testable? 😉 Thank you!

@mikeclayton
Copy link
Contributor Author

Hi @mikeclayton , I've given it a try but after building in Visual Studio the MouseJump exe doesn't seem to be created. Can you please try building the PR from a clean state and verifying? I think the changes done to the .csproj might be related to this issue. Thank you for the contribution, but can you please make the PR testable? 😉 Thank you!

Oh, interesting. I'll take a look tonight (UK time)...

@mikeclayton
Copy link
Contributor Author

Looks like I removed these from the MouseJumpUI.csproj and MouseJump.Common.csproj somewhere along the line...

    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

so it was building in the wrong folder.

I'll re-add them later...

@mikeclayton
Copy link
Contributor Author

@jaimecbernardo - the latest commit appears to put the build output in the right location now when I run it locally.

@jaimecbernardo
Copy link
Collaborator

@jaimecbernardo - the latest commit appears to put the build output in the right location now when I run it locally.

I can confirm it's working well now. Thank you :) Going to spin some builds to verify signing and do the final review after.

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for the contribution!

@jaimecbernardo jaimecbernardo merged commit dc7c7ef into microsoft:main Oct 21, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In for .86 Needs-Review This Pull Request awaits the review of a maintainer.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants