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 - [Mouse Jump] Customisable appearance - borders, margins, colours, etc - final part #35521

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

mikeclayton
Copy link
Contributor

@mikeclayton mikeclayton commented Oct 21, 2024

Summary of the Pull Request

This is the last part of the Mouse Jump styles work that finally enables the feature in Settings UI and in the Mouse Jump preview image.

See #27511 for the original feature suggestion.

Changes in this PR

  • Moved the Mouse Jump "settings ui" xaml and code into a separate "MouseJumpPanel.xaml" control to make it easier to make changes to the settings controls
  • Added a new "Appearance" expander in Mouse Jump settings with all the new border, colour, 3d effect, spacing, etc settings controls to allow the user to set custom properties
  • Also added some predefined style options:
    • "Compact" is the original Mouse Jump style with just a borders around the whole image and no other chrome
    • "Bezelled" is the new default with some simple spacing between screens and 3d bezels drawn around them

image

Reviewer Notes

  • Added a reference to CommunityToolkit.WinUI.Controls.Segmented in PowerToys.Settings to allow the "Compact | Bezelled | Custom" options for Preview Style

  • Added a reference to MouseJump.Common in PowerToys.Settings to allow rendering the preview image when settings are changed

  • I've made "Bezelled" the new default style as a precursor to the proposed Mouse Without Borders integration in Integrate Mouse Jump with Mouse Without Borders to allow jumping to remote computers when MWB is enabled #34126 - it'll be easier to make the bezel colours vary by host if they're already visible.

  • Code touches the internals of the Segmented control to force the preview image to be centered - see PreviewImage_Loaded method - might be brittle if the implementation changes?

  • Config upgrade seems a bit odd - the in-memory settings get upgraded fine with "version": "1.`" but it seems to get reverted and saved again as "version": "1.0" and then overwritten again as "version"": "1.1". I've worked around this by additionally checking if the new settings have values before upgrading, but it seems like that's what the version flag is supposed to be for. It works for now anyway, but not sure if this is the right way to do it...

  • Does the "Copy to Custom preview style" need an "Are you sure? Yes / No" before overwriting and / or a "Copied!" message after copying? I'm happy to leave it as is, but feedback welcome...

PR Checklist

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
  • Settings tests
    • Changing thumbnail size settings updates the size of the thumbnail
    • Changing preview type between Compact, Bezelled and Custom shows the correct preview type
    • Changing custom preview settings shows the correct settings
    • Launching with settings version 1.0 upgrades settings to version 1.1, with "Bezelled" as the default style and the "Custom" settings preconfigured to match "Bezelled"
  • 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 October 21, 2024 20:38

This comment has been minimized.

This comment has been minimized.

@mikeclayton
Copy link
Contributor Author

I think this PR is ready for review now - I still need to do the full set of regression tests but the happy path works fine.

There's some notes for reviewers in the original post at the top.

@mikeclayton mikeclayton marked this pull request as ready for review October 23, 2024 17:54
@mikeclayton mikeclayton changed the title WIP - [Mouse Jump] Customisable appearance - borders, margins, colours, etc - final part Ready for Review - [Mouse Jump] Customisable appearance - borders, margins, colours, etc - final part Oct 23, 2024
@crutkas crutkas added the Needs-Review This Pull Request awaits the review of a maintainer. label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Review This Pull Request awaits the review of a maintainer.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[Mouse Jump] Customisable appearance - borders, margins, colours, etc
2 participants