-
Notifications
You must be signed in to change notification settings - Fork 80
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
Adding ColorPicker #241
Adding ColorPicker #241
Conversation
Co-Authored-By: robloo <[email protected]>
Co-Authored-By: robloo <[email protected]>
@Arlodotexe Could you help out with the following:
|
Co-Authored-By: robloo <[email protected]>
Co-Authored-By: robloo <[email protected]>
Co-Authored-By: robloo <[email protected]>
@Arlodotexe Would you mind looking at what the error is and review? |
@Arlodotexe Ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will try this out soon. Couple of minor comments/remarks.
@niels9001 did notice a bit of grid illusion though with the new setup?
components/ColorPicker/src/CommunityToolkit.WinUI.Controls.ColorPicker.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>
components/ColorPicker/src/CommunityToolkit.WinUI.Controls.ColorPicker.csproj
Show resolved
Hide resolved
Hmm, seem to have some trouble using the nuget package from the pull request feed:
Not sure why it's looking there instead of the segmented package itself, as that's where it should be, I do see the segmented package as a proper dependency in Nuget package explorer... so bit confused. |
Need to remove CornerRadius on the color swatch aswell |
Found the reason why the component isn't showing on WebAssembly. We're referencing the Animations component for Our options are to either:
@niels9001 @michael-hawker What are you thoughts? |
Can we combine conditionals with a namespace like that in Uno? It may be easier to just modify the We do need a better way of tracking what's not supported in Uno though doing it that way, right? As it's not like we'd have it throw an unsupported exception. |
Official Uno docs recommend wrapping it in a container such as a Grid. That requires adjusting the Visual Tree in a lot of different places, both in our codebase and in the codebase of those consuming our packages
At a high level, our custom MultiTarget system is designed to mitigate this happening on accident by allowing us to isolate code that depends on unsupported APIs (e.g. Composition) into separate libraries (e.g. Media) and disabling Uno-specific When we enable Uno for a component that didn't previously support it, we need to be doing a sweep of the component to make sure nothing throws when running under the new platform. We didn't originally support the We can disable implicit animations from running to get this out, but we should also consider a full sweep of the Animations package to see what can be implemented without using Composition, versus what needs to be disabled so it doesn't throw while we wait for Uno to implement Composition. Giving the Animations package a quick once-through, I've also noted that:
|
Yeah, I'd want to avoid changing the visual tree structure specifically for Uno. Makes it harder to undo later when things are supported, and also hurts the performance for everything else otherwise. |
@Arlodotexe still not working with UWP. Tried the latest build, same error message. |
Attaching UWP binlog from the CI here (compared to the consuming app above): |
@Arlodotexe just adding here as we discovered in our last call: https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/6bfe8a5d21feb8818a8048b9fc41a84a70af8b0f/Microsoft.Toolkit.Uwp.UI.Controls.Markdown/Microsoft.Toolkit.Uwp.UI.Controls.Markdown.csproj#L27-L40 <!--
HACK: Fix the 'ProjectReference' inclusion of duplicate UWP resources.
The UWP project system includes the 'Controls.Core' project's resources because
it doesn't know, it'll be an independent package later during packing.
Therefore, we need to remove these extra resources in the packaging pipeline.
-->
<Target Name="_RemoveUnwantedResources" AfterTargets="GetPackagingOutputs">
<!--<Message Text="Package Files Before: @(PackagingOutputs)" Importance="High" />-->
<ItemGroup>
<PackagingOutputs Remove="@(PackagingOutputs)" Condition="'%(PackagingOutputs.Filename)%(PackagingOutputs.Extension)' == 'Microsoft.Toolkit.Uwp.UI.Controls.Core.pri'" />
<PackagingOutputs Remove="@(PackagingOutputs)" Condition="$([System.String]::new('%(PackagingOutputs.TargetPath)').StartsWith('Microsoft.Toolkit.Uwp.UI.Controls.Core\'))" />
</ItemGroup>
<!--<Message Text="Package Files After: @(PackagingOutputs)" Importance="High" />-->
</Target> For now, can we just try adding this into the csproj for the ColorPicker and see if it resolves the issue? Then we can figure out if we want to generalize later. Seems like this is a UWP only issue, so we should condition the Target to be UWP only. |
@michael-hawker Gave this a try and no dice. The reason might be that the Segmented pri isn't included in the nuget package. We might have to craft a custom fix for this. |
@Arlodotexe thanks, I doubt the updates for .NET 8 will fix our underlying issue, can we try the suggestion from the platform team of adding:
to the ColorPicker csproj? |
f80dc50
to
9524352
Compare
This had no effect on the error message we were seeing when the ColorPicker package is built and consumed on UWP. |
@Arlodotexe new fix from the platform folks to try in the ColorPicker library project: <Target Name="BeforeGenerateProjectPriFile">
<ItemGroup>
<_LayoutFile Remove="@(_LayoutFile)" Condition="$([System.String]::Copy("%(_LayoutFile.TargetPath)").StartsWith('CommunityToolkit.WinUI.Controls.Segmented\'))" />
</ItemGroup>
</Target>
|
Had to install WinUI 2.7 directly in the test app, but this did the trick! ColorPicker for UWP can now be safely consumed from the NuGet package 🎉 |
This PR ports over
ColorPicker
andColorPickerButton
from: CommunityToolkit/WindowsCommunityToolkit#4502Changes introduced:
Segmented
control instead of aListBox
Segmented
control will now hide if only 1 color option is selected.ColorPicker
ColorPickerButton
Closes: #69