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

🧪 [Experiment] TransitionHelper #354

Merged

Conversation

michael-hawker
Copy link
Member

@michael-hawker michael-hawker commented Jan 11, 2023

Port of PR CommunityToolkit/WindowsCommunityToolkit#4338
Discussion: #353

This PR brings over @HHChaos's TransitionHelper component from the Main Toolkit into labs. It's a set of helpers for morphing controls between one another on the same page, see example here (speaks better than words):

LabsTransitionHelper.mp4

Only setup for UWP/WinAppSDK. Uses Composition APIs, so not going to work on Uno Platform atm.

TODO

@michael-hawker michael-hawker added experiment 🧪 Used to track issues that are experiments (or their linked discussions) animations 🏮 labels Jan 11, 2023
@michael-hawker
Copy link
Member Author

Error from CI:

"D:\a\Labs-Windows\Labs-Windows\labs\TransitionHelper\src\CommunityToolkit.Labs.WinUI.TransitionHelper.csproj" (default target) (16:31) ->
  D:\a\Labs-Windows\Labs-Windows\labs\TransitionHelper\src\TransitionHelper.Animation.cs(30,29): error CA1001: Type 'TransitionHelper' owns disposable field(s) '_currentAnimationCancellationTokenSource' but is not disposable [D:\a\Labs-Windows\Labs-Windows\labs\TransitionHelper\src\CommunityToolkit.Labs.WinUI.TransitionHelper.csproj]

Will have to investigate what this is and what this means to fix.

@michael-hawker
Copy link
Member Author

Found and added explicit details on what we saw in the WindowsAppSDK with ImageBrush on the WinUI repo here: microsoft/microsoft-ui-xaml#7809 (comment)

@michael-hawker
Copy link
Member Author

CI issue, this was here before migration:

 D:\a\Labs-Windows\Labs-Windows\components\TransitionHelper\src\TransitionHelper.Animation.cs(30,29): error CA1001: Type 'TransitionHelper' owns disposable field(s) '_currentAnimationCancellationTokenSource' but is not disposable [D:\a\Labs-Windows\Labs-Windows\components\TransitionHelper\src\CommunityToolkit.Labs.WinUI.TransitionHelper.csproj]

Also need the single project head to not copy over the wasm head (we should probably try and auto-detect this)

@michael-hawker
Copy link
Member Author

@niels9001 @Arlodotexe should be rebased and ready to go now, filed an issue for the disposable problem and added to ignore for project, so hopefully should build now.

Let's get it in, and then @niels9001 you can add a smaller sample later after?


<!-- TODO: Putting here as seems to get flagged on different partials, need to deal with TokenSource being disposible -->
<!-- See: https://github.com/CommunityToolkit/Labs-Windows/issues/407 -->
<NoWarn>CA1001</NoWarn>
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm confused as to why this didn't work...

  D:\a\Labs-Windows\Labs-Windows\components\TransitionHelper\src\TransitionHelper.Animation.cs(30,29): error CA1001: Type 'TransitionHelper' owns disposable field(s) '_currentAnimationCancellationTokenSource' but is not disposable [D:\a\Labs-Windows\Labs-Windows\components\TransitionHelper\src\CommunityToolkit.Labs.WinUI.TransitionHelper.csproj]

@Arlodotexe any thoughts?

I did it here as the CI flags it in the partial TransitionHelper.Animation.cs file, but locally it flags it on the TransitionHelper.Logic.cs file... 😟

Copy link
Member

@Arlodotexe Arlodotexe Mar 28, 2023

Choose a reason for hiding this comment

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

Maybe try <NoWarn>$(NoWarn);CA1001</NoWarn>? Could be overwritten in another place as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Arlodotexe just looked, we have a bunch of places in the Tooling props which aren't doing this:
image

I'll test here if this resolves this issue, but may need a PR on the tooling for this too then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, didn't realize this PR wasn't updated still with the tooling module change, pushed a test up since it's all in the same branch, if that resolves, I'll copy them over to the tooling submodule, get that updated, and then update this PR to use that before we merge.

@michael-hawker
Copy link
Member Author

Ugh, won't run with merge conflict, pushed to this repo so I could run action independently for now here: https://github.com/CommunityToolkit/Labs-Windows/actions/runs/4546660046

@michael-hawker
Copy link
Member Author

Hmm, getting some error about the Owl image from the Shimmer experiment... that's weird.

"D:\a\Labs-Windows\Labs-Windows\CommunityToolkit.AllComponents.sln" (default target) (1:2) ->
"D:\a\Labs-Windows\Labs-Windows\tooling\ProjectHeads\AllComponents\Tests.WinAppSdk\CommunityToolkit.Tests.WinAppSdk.csproj" (default target) (27:6) ->
(_HandleFileConflictsForPublish target) -> 
  C:\Program Files\dotnet\sdk\6.0.407\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: D:\a\Labs-Windows\Labs-Windows\components\Shimmer\samples\Assets\Owl.jpg, D:\a\Labs-Windows\Labs-Windows\components\TransitionHelper\samples\Assets\Owl.jpg. [D:\a\Labs-Windows\Labs-Windows\tooling\ProjectHeads\AllComponents\Tests.WinAppSdk\CommunityToolkit.Tests.WinAppSdk.csproj]


"D:\a\Labs-Windows\Labs-Windows\CommunityToolkit.AllComponents.sln" (default target) (1:2) ->
"D:\a\Labs-Windows\Labs-Windows\tooling\ProjectHeads\AllComponents\WinAppSdk\CommunityToolkit.App.WinAppSdk.csproj" (default target) (29:6) ->
  C:\Program Files\dotnet\sdk\6.0.407\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: D:\a\Labs-Windows\Labs-Windows\components\Shimmer\samples\Assets\Owl.jpg, D:\a\Labs-Windows\Labs-Windows\components\TransitionHelper\samples\Assets\Owl.jpg. [D:\a\Labs-Windows\Labs-Windows\tooling\ProjectHeads\AllComponents\WinAppSdk\CommunityToolkit.App.WinAppSdk.csproj]

But I think that means that warning thing helped, so will open a tooling PR for that, so we can update this one on top of the latest main.

@michael-hawker
Copy link
Member Author

Submodule first step here: CommunityToolkit/Tooling-Windows-Submodule#38

@michael-hawker
Copy link
Member Author

Figured out what the issue is, filed CommunityToolkit/Tooling-Windows-Submodule#40 for tracking. Will work-around the issue for now and rebuild.

@michael-hawker michael-hawker merged commit 96a6fe0 into CommunityToolkit:main Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
animations 🏮 experiment 🧪 Used to track issues that are experiments (or their linked discussions)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants