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

Feedback wanted - [Mouse Jump] - Customisable appearance - borders, margins, colours, etc #33486

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

mikeclayton
Copy link
Contributor

Summary of the Pull Request

This is a follow-up to #32838 and #27511 to introduce some style settings to control the visual appearance of the Mouse Jump preview popup - previous work in #32838 added the style rendering code but didn't surface it in the Settings UI project and left the visual appearance as it was previously, but generated using some new rendering code.

This PR adds Settings UI options - it shows a live preview in the "Appearance and behaviour" section of the Mouse Jump settings which updates dynamically as colour and layout options are edited.

It's a Work In Progress, but I'd appreciate a review of the functionality in this PR so far, primarily in terms of whether the overall approach fits in with general PowerToys design guidelines, or whether it needs a major rethink before I spend a lot of time refining it. I'm not so worried about the code right now - mostly just the visual appearance and functionality of the new Mouse Jump Settings UI options.

Here's a (slightly rubbish) capture of it in action for reference:

mousejump-styles.mp4

@mikeclayton mikeclayton marked this pull request as draft June 23, 2024 23:27
@htcfreek
Copy link
Collaborator

@mikeclayton
Regarding the live preview panel: I don't think that we need a live preview of the screen. A fake image should be enough. And I think we should only show one desktop in the preview. Reasons for my thoughts are performance and visibility.

@mikeclayton
Copy link
Contributor Author

@htcfreek - I can change the preview to use a static image as a fake desktop - the most recent unit tests do this anyway, so I can just re-use that. It might be worth leaving two screens though - the setting currently labelled "Screen Margin" defines the spacing between the individual screens - if there was just one screen the effect of this setting wouldn't be visible in the preview.

(I think the setting names and descriptions probably all need some thought as well, but I'm keen to get the layout and functionality right first...)

@htcfreek
Copy link
Collaborator

@htcfreek - I can change the preview to use a static image as a fake desktop - the most recent unit tests do this anyway, so I can just re-use that. It might be worth leaving two screens though - the setting currently labelled "Screen Margin" defines the spacing between the individual screens - if there was just one screen the effect of this setting wouldn't be visible in the preview.

Sounds both good to me. Saw that point with the two screens late.

(I think the setting names and descriptions probably all need some thought as well, but I'm keen to get the layout and functionality right first...)

Sounds good.

@mikeclayton
Copy link
Contributor Author

mikeclayton commented Jun 28, 2024

@htcfreek - I've replaced the live preview of the current desktop with a static image: - see below.

image

The static "fake desktop" image it uses is is here: https://github.com/microsoft/PowerToys/pull/33486/files#diff-7fa63c54234718f0f78bb369b5da042242265e8487e4fa2e8cdca1107c57b5ac and it's based on my original animation at https://github.com/mikeclayton/FancyMouse. If it's not really suitable (e.g. doesn't meet UI guidelines / colours / logos / similarity to real products / etc ) would you be able to ask someone in the core team to create one we can use as that might be quicker than me trying to meet the design criteria.

It would be good to hear if there's any other UI feedback as well...

@mikeclayton
Copy link
Contributor Author

mikeclayton commented Jun 28, 2024

@htcfreek - I'm also having a bit of trouble with the Azure DevOps pipeline. I've added a new project - MouseJump.Common - but I'm getting an error about the target framework version - I've had a dig, but I can't see what's different compared to other projects that are building successfully before it (e.g. ImageResizer).

Are you able to take a look and see if you can see what the issue is?

For reference, the pipeline error is:

https://dev.azure.com/ms/PowerToys/_build/results?buildId=589043&view=logs&j=b6b44f60-477e-5b36-eeeb-589df0c177de&t=f5043f15-036d-5d3b-8695-92dff4115778

##[error]C:\hostedtoolcache\windows\dotnet\sdk\8.0.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): Error NETSDK1047: Assets file 'D:\a_work\1\s\src\modules\MouseUtils\MouseJump.Common\obj\project.assets.json' doesn't have a target for 'net8.0-windows10.0.20348.0/win-x64'. Ensure that restore has run and that you have included 'net8.0-windows10.0.20348.0' in the TargetFrameworks for your project. You may also need to include 'win-x64' in your project's RuntimeIdentifiers. [D:\a_work\1\s\src\modules\MouseUtils\MouseJump.Common\MouseJump.Common.csproj]

@htcfreek
Copy link
Collaborator

htcfreek commented Jun 29, 2024

@htcfreek - I'm also having a bit of trouble with the Azure DevOps pipeline. I've added a new project - MouseJump.Common - but I'm getting an error about the target framework version - I've had a dig, but I can't see what's different compared to other projects that are building successfully before it (e.g. ImageResizer).

Are you able to take a look and see if you can see what the issue is?

For reference, the pipeline error is:

https://dev.azure.com/ms/PowerToys/_build/results?buildId=589043&view=logs&j=b6b44f60-477e-5b36-eeeb-589df0c177de&t=f5043f15-036d-5d3b-8695-92dff4115778

(...)

The order/structure of the two "common" .csproject files is different. Maybe that is the reason. 🤔🤷🏻‍♂️ But for such problems I am the wrong person to ask. 😅

@mikeclayton
Copy link
Contributor Author

mikeclayton commented Jun 29, 2024

@htcfreek - no worries.

I'm at a bit of a loss as to what else to try though - is there someone on the core team that I could @ mention who might be able to help?

@htcfreek
Copy link
Collaborator

@htcfreek - no worries.

I'm at a bit of a loss as to what else to try though - is there someone on the core team that I could @ mention who might be able to help?

Jaime (jaimecbernardo) I think.

@mikeclayton
Copy link
Contributor Author

mikeclayton commented Jun 29, 2024

@jaimecbernardo - I'm having some problems with the Azure DevOps Pipeline that I've not been able to resolve - is this something you're able to take a look at?

In this PR I've moved some of the MouseJumpUI code into a new project - MouseJump.Common - which lets me re-use some of the code in the SettingsUI project for configuring options.

However, when the build runs I get this error:

https://dev.azure.com/ms/PowerToys/_build/results?buildId=589043&view=logs&j=b6b44f60-477e-5b36-eeeb-589df0c177de&t=f5043f15-036d-5d3b-8695-92dff4115778

##[error]C:\hostedtoolcache\windows\dotnet\sdk\8.0.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): Error NETSDK1047: Assets file 'D:\a_work\1\s\src\modules\MouseUtils\MouseJump.Common\obj\project.assets.json' doesn't have a target for 'net8.0-windows10.0.20348.0/win-x64'. Ensure that restore has run and that you have included 'net8.0-windows10.0.20348.0' in the TargetFrameworks for your project. You may also need to include 'win-x64' in your project's RuntimeIdentifiers. [D:\a_work\1\s\src\modules\MouseUtils\MouseJump.Common\MouseJump.Common.csproj]

I've tried comparing the MouseJump.Common to other projects and I can't see any differences that might cause the problem, so I'm a bit stuck with what else to try. If you're able to shed any light it would be massively appreciated...

{D9C5DE64-6849-4278-91AD-9660AECF2876}.Debug|x64.Build.0 = Debug|x64
{D9C5DE64-6849-4278-91AD-9660AECF2876}.Debug|x86.ActiveCfg = Debug|x64
{D9C5DE64-6849-4278-91AD-9660AECF2876}.Debug|x86.Build.0 = Debug|x64
{D9C5DE64-6849-4278-91AD-9660AECF2876}.Release|ARM64.ActiveCfg = Release|ARM64

Choose a reason for hiding this comment

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

Feeling in my head

Copy link
Contributor Author

@mikeclayton mikeclayton Jun 29, 2024

Choose a reason for hiding this comment

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

I'm not sure that's the issue - D9C5DE64-6849-4278-91AD-9660AECF2876 is the project guid for MouseJumpUI.UnitTests - see

<ProjectGuid>{D9C5DE64-6849-4278-91AD-9660AECF2876}</ProjectGuid>

That was one other thing I changed as part of moving some code to MouseJump.Common - I moved the test code to a new MouseJump.Common.UnitTests project and removed MouseJumpUI.UnitTests...

Copy link
Contributor Author

@mikeclayton mikeclayton Jun 29, 2024

Choose a reason for hiding this comment

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

I think it's pointed me in the right direction though. It looks like for whatever reason the project GUIDs are wrong in the solution file compared to the one specified in the *.csproj files.

I've just removed and re-added the projects to the solution and the diff looks like this (check the guid changes at the end of the lines):

-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MouseJump.Common", "src\modules\MouseUtils\MouseJump.Common\MouseJump.Common.csproj", "{F35E1EF3-C2AE-4407-8029-92B8F2B4A382}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MouseJump.Common", "src\modules\MouseUtils\MouseJump.Common\MouseJump.Common.csproj", "{923DF87C-CA99-4D1C-B1D2-959174E95BFA}"

-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MouseJump.Common.UnitTests", "src\modules\MouseUtils\MouseJump.Common.UnitTests\MouseJump.Common.UnitTests.csproj", "{6A10C2B0-92AE-4928-996B-FCF55D2E3F39}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MouseJump.Common.UnitTests", "src\modules\MouseUtils\MouseJump.Common.UnitTests\MouseJump.Common.UnitTests.csproj", "{D5E42C63-57C5-4EF6-AECE-1E2FCA725B77}"

I'll try committing that shortly and fingers crossed it'll fix the build error...

Copy link
Contributor Author

@mikeclayton mikeclayton Jun 29, 2024

Choose a reason for hiding this comment

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

So that didn't work :-(

I've noticed the x64 build seems to be pulling slightly different builds of dlls - https://dev.azure.com/ms/PowerToys/_build/results?buildId=589287&view=logs&j=0f660c0a-4423-5c5d-276b-f98b39c69e13&t=34873f2b-5f38-5b1d-35e6-61803dc82c39

System.Drawing.dll
	 8.0.624.26909
		 PowerToys.ImageResizer.deps.json
                 ...
		 PowerToys.MouseJumpUI.deps.json
                 ...
	 8.0.624.26715
		 PowerToys.MouseJump.Common.deps.json
Detected  4  libraries that are mentioned with different version across the dependencies.

Currently trying to work out what's causing that in case it's related.

I'm wondering if it's something do to with the nuget package caching in the Azure DevOps pipeline...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The latest commit (adding <RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers> to the *.csproj seems to have fixed the NETSDK1047 error (more by luck than judgement I feel), but I'm still seeing failures from the verifyDepsJsonLibraryVersions.ps1 build step.

Will continue to investigate...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants