Skip to content

Commit

Permalink
chore: Merge master into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezgerges committed May 15, 2024
2 parents 97dc7b5 + cf22fc7 commit 45c275a
Show file tree
Hide file tree
Showing 321 changed files with 6,855 additions and 7,319 deletions.
2 changes: 0 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ area/automation:
- src/SamplesApp/**/*
- src/Uno.UI.Tests/*
- src/Uno.UI.Tests/**/*
- src/Uno.UI.Tests.Performance/*
- src/Uno.UI.Tests.Performance/**/*
- src/Uno.UI.Wasm.Tests/*
- src/Uno.UI.Wasm.Tests/**/*

Expand Down
2 changes: 1 addition & 1 deletion .vsts-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pr:
- legacy/*

variables:
windowsScaledPool: 'Windows2022-20230918'
windowsScaledPool: 'Windows2022-20240421'
linuxVMImage: 'ubuntu-latest'

stages:
Expand Down
2 changes: 1 addition & 1 deletion .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
windows2019HostedVMImage: 'windows-2019'
windows2022HostedVMImage: 'windows-2022'
windowsScaledPool: 'Windows2022-20230918'
windowsScaledPool: 'Windows2022-20240421'
linuxVMImage: 'ubuntu-latest'
linuxScaledPool: 'Ubuntu2204-20230918'
macOSVMImage: 'macOS-13'
Expand Down
4 changes: 3 additions & 1 deletion build/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@
"wapproj's",
"xamlmerge",
"xbind",
"xcprivacy"
"xcprivacy",
"jlaban",
"sasakrsmanovic"
],
"patterns": [
{
Expand Down
27 changes: 24 additions & 3 deletions build/test-scripts/run-netcore-mobile-template-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ if ($IsWindows)

# Build with msbuild because of https://github.com/microsoft/WindowsAppSDK/issues/1652
# force targetframeworks until we can get WinAppSDK to build with `dotnet build`
& $msbuild $debug "/p:Platform=x86" "/p:TargetFrameworks=net7.0-windows10.0.19041;TargetFramework=net7.0-windows10.0.19041" "UnoAppWinUI.Windows\UnoAppWinUI.Windows.csproj"
& $msbuild $debug "/p:Platform=x86" "UnoAppWinUI.Windows\UnoAppWinUI.Windows.csproj" "/p:TargetFrameworks=net7.0-windows10.0.19041;TargetFramework=net7.0-windows10.0.19041"
Assert-ExitCodeIsZero
}

Expand Down Expand Up @@ -139,7 +139,15 @@ if ($IsWindows)

# Uno Library
# Mobile is removed for now, until we can get net7 supported by msbuild/VS 17.4
& $msbuild $debug /t:pack MyUnoLib\MyUnoLib.csproj "/p:TargetFrameworks=`"net7.0-windows10.0.19041;net7.0`""
$responseFile = @(
"$debug",
"/t:pack",
"MyUnoLib\MyUnoLib.csproj",
"/p:TargetFrameworks=""net7.0-windows10.0.19041;net7.0"""
)
$responseFile | Out-File -FilePath "build.rsp" -Encoding ASCII

& $msbuild "@build.rsp"
Assert-ExitCodeIsZero

# Uno Cross-Runtime Library
Expand All @@ -150,7 +158,17 @@ if ($IsWindows)
# Uno Library with assets, Validate assets count
#
# Mobile is removed for now, until we can get net7 supported by msbuild/VS 17.4
& $msbuild $debug /t:pack /p:IncludeContentInPack=false MyUnoLib2\MyUnoLib2.csproj -bl "/p:TargetFrameworks=`"net7.0-windows10.0.19041;net7.0`""
$responseFile = @(
"$debug",
"/t:pack",
"/p:IncludeContentInPack=false",
"MyUnoLib2\MyUnoLib2.csproj",
"-bl",
"/p:TargetFrameworks=""net7.0-windows10.0.19041;net7.0"""
)
$responseFile | Out-File -FilePath "build.rsp" -Encoding ASCII

& $msbuild "@build.rsp"
Assert-ExitCodeIsZero

mv MyUnoLib2\Bin\Debug\MyUnoLib2.1.0.0.nupkg MyUnoLib2\Bin\Debug\MyUnoLib2.1.0.0.zip
Expand Down Expand Up @@ -247,6 +265,9 @@ $projects =
@("5.2/uno52Lib/uno52Lib.csproj", @("-f", "net8.0-android"), $true, $true),
@("5.2/uno52Lib/uno52Lib.csproj", @("-f", "net8.0-maccatalyst"), $true, $true),
@("5.2/uno52Lib/uno52Lib.csproj", @("-f", "net8.0-desktop"), $true, $true),

@("5.2/uno52Lib/uno52Lib.csproj", @("-f", "net8.0-browserwasm", "-p:ImplicitUsings=disable"), $true, $true),
@("5.2/uno52Lib/uno52Lib.csproj", @("-f", "net8.0-desktop", "-p:ImplicitUsings=disable"), $true, $true),

# Default mode for the template is WindowsAppSDKSelfContained=true, which requires specifying a target platform.
@("5.2/uno52Lib/uno52Lib.csproj", @("-p:Platform=x86" , "-p:TargetFramework=net8.0-windows10.0.19041"), $false, $true),
Expand Down
2 changes: 1 addition & 1 deletion doc/articles/feature-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ WinRTFeatureConfiguration.MessageDialog.StyleOverride = "CustomMessageDialogStyl

## ToolTips

By default, `ToolTips` are disabled on all platforms except for WebAssembly (see [#10791](https://github.com/unoplatform/uno/issues/10791)). To enable them on a specific platform, set the `UseToolTips` configuration flag to `true`. You can add the following in the end of the `App` constructor:
By default, `ToolTips` are disabled on all platforms except for WebAssembly and Skia (see [#10791](https://github.com/unoplatform/uno/issues/10791)). To enable them on a specific platform, set the `UseToolTips` configuration flag to `true`. You can add the following in the end of the `App` constructor:

```csharp
Uno.UI.FeatureConfiguration.ToolTip.UseToolTips = true;
Expand Down
17 changes: 16 additions & 1 deletion doc/articles/features/shapes-and-brushes.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,22 @@ Where you can use which brushes
| Usage | SolidColorBrush | ImageBrush | GradientBrush |
| -------------------------------------------- | --------------- | -------------------- | --------------- |
| `Background` property (many controls/panels) | Yes | Yes (except on Wasm) | Yes |
| `BorderBrush` (`Border`, `Panel`) | Yes | No | Yes (Wasm only) |
| `BorderBrush` (`Border`, `Panel`) | Yes | No | Yes (Skia, Android), partial (iOS, WASM) [see below] |
| `Foreground` (`TextBlock`) | Yes | No | Yes (Wasm only) |
| `Fill` (Shapes) | Yes | Yes (except on Wasm) | Yes |
| `Stroke` (Shapes) | Yes | No | Yes (Wasm only) |

## Gradient border brush limitations on WASM and iOS

There are limitations to support for gradient border brushes on some targets. Currently these are:

- WebAssembly - gradient borders cannot be applied properly on an element which uses `CornerRadius`
- iOS/macOS - gradient borders cannot be applied reliably when `RelativeTransform` is applied on it

If these conditions apply, the border will instead be rendered using `SolidColorBrush` provided by the `FallbackColor` property.

As default WinUI Fluent styles are using `ElevationBorder` brushes in many places, so we created a presenter that provides a "fake" gradient for these cases - `Uno.UI.Controls.FauxGradientBorderPresenter`. For custom styles we suggest you provide a custom "layered" approach that simulates the border, as this presenter is specifically built to support WinUI style-specific scenarios where:

- Exactly two gradient stops are present
- `FallbackColor` of the brush is equal to the "major" gradient stop
- The brush is applied "vertical" - so the "minor" stop is either on top or on the bottom of the control
2 changes: 0 additions & 2 deletions doc/articles/migrating-before-you-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ On certain target platforms, support for some .NET functionality is limited or u
Currently, WebAssembly code in the browser executes on a single thread (much like JavaScript code in the browser). This limitation is expected to be lifted in the future, but for now, code that expects additional threads to be available may not function as expected.

[This issue](https://github.com/unoplatform/uno/issues/2302) tracks support for multi-threading on WebAssembly in Uno Platform.

Additionally, if you're using full AOT compilation on WASM, the same API restrictions will apply as for AOT compilation on iOS.
12 changes: 11 additions & 1 deletion doc/articles/uno-development/ways-to-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Whatever you do, let us know [through Twitter](https://twitter.com/unoplatform)

## Contributing code

The UWP framework and WinUI are pretty big, but many hands make light work. We welcome code and content contributions from the community, and the core team is more than happy to help new contributors ramp up and familiarize themselves with Uno's codebase.
The WinUI framework is pretty big, but many hands make light work. We welcome code and content contributions from the community, and the core team is more than happy to help new contributors ramp up and familiarize themselves with Uno Platform's codebase.

### Diving into the code

Expand Down Expand Up @@ -97,3 +97,13 @@ Once you're ready to create a PR, check out the [Guidelines for pull requests](.
### Need help?

If there's anything you need, [ping us on our Discord Server](https://platform.uno/discord).

## Sponsors & Grants

Please consider sponsoring Uno Platform development, especially if your company benefits from this library.

Your contribution will go towards adding new features and closing issues raised by the community at Uno Platform backlog on GitHub ([Issues · unoplatform/uno (github.com)](https://github.com/unoplatform/uno/issues)) and making sure all functionality continues to meet our high-quality standards.

A grant for continuous full-time development has the biggest impact on progress. Periods of 2 to 5 days allow a contributor to tackle substantial complex issues that are otherwise left to linger until somebody can’t afford to not fix them.

Contact [@jlaban](https://github.com/jeromelaban) or [@sasakrsmanovic](https://github.com/sasakrsmanovic) to arrange a grant to Uno Platform and its core contributors.
4 changes: 2 additions & 2 deletions doc/import_external_docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Set-PSDebug -Trace 1

$external_docs = @{
# use either commit, or branch name to use its latest commit
"uno.wasm.bootstrap" = "9b559fc9a8b5e939fd99fa119a243e760ae3770d" #latest main commit
"uno.wasm.bootstrap" = "0a56349323e4aa03b004cd11292f7d441458783b" #latest main commit
"uno.themes" = "722dd3386d16523d1e1139d916aa89610f7118ac" #latest release branch commit
"uno.toolkit.ui" = "e8821e38a8a0fe8225211a80fd5c74481b9243d1" #latest release branch commit
"uno.check" = "4a7dd7290daf0aabfbb8efabcd2b067898b7f45e" #latest main commit
Expand All @@ -17,7 +17,7 @@ $external_docs = @{
"uno.uitest" = "9669fd2783187d06c36dd6a717c1b9f08d1fa29c" #latest master commit
"uno.extensions" = "30b86afe55fab1f964bbe30c594cf9c7ea72d7a3" #latest release branch commit
"workshops" = "f87cb67d9fd9cb3e78c740b62d40fe8d3201182a" #latest master commit
"uno.samples" = "4599f4e09d12cfef46f5f70e65347e93600af499" #latest master commit
"uno.samples" = "ad049bef2e55a485df23d8e38c40aea903aa5cf1" #latest master commit
}

$uno_git_url = "https://github.com/unoplatform/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Uno.UI.Media;

public class MediaPlayerPresenterExtension : IMediaPlayerPresenterExtension
{
private MediaPlayerPresenter? _owner;
private MediaPlayerPresenter _owner;
private GtkMediaPlayer _player;

public uint NaturalVideoHeight => _player.NaturalVideoHeight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public MediaPlayerPresenterExtension(object owner)
_owner.Child = _htmlPlayer = new HtmlMediaPlayer();
}


public void MediaPlayerChanged()
{
if (this.Log().IsEnabled(LogLevel.Debug))
Expand Down
6 changes: 4 additions & 2 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@
<PackageReference Update="Uno.Diagnostics.Eventing" Version="2.0.1" />
<PackageReference Update="Uno.Wasm.Bootstrap" Version="8.0.0-dev.252" />
<PackageReference Update="Uno.Wasm.Bootstrap.DevServer" Version="8.0.0-dev.252" />
<PackageReference Update="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Update="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Update="MSTest" Version="3.3.1" />
<PackageReference Update="MSTest.TestFramework" Version="3.3.1" />
<PackageReference Update="MSTest.TestAdapter" Version="3.3.1" />
<PackageReference Update="MSTest.Analyzers" Version="3.3.1" />
<PackageReference Update="Uno.MonoAnalyzers" Version="1.0.0" PrivateAssets="all" />
<PackageReference Update="Uno.Wasm.WebSockets" Version="1.1.0" />
<PackageReference Update="Microsoft.TypeScript.MSBuild" Version="4.3.5" />
Expand Down
15 changes: 15 additions & 0 deletions src/SamplesApp/SamplesApp.Shared/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,20 @@ public MainPage()

sampleControl.DataContext = new SampleChooserViewModel(sampleControl);
}

#if UNO_HAS_ENHANCED_LIFECYCLE || !HAS_UNO
protected
#if HAS_UNO
internal
#endif
override void OnNavigatedTo(NavigationEventArgs e)
{
if (this.IsLoaded)
{
// https://github.com/unoplatform/uno/issues/1478
throw new System.Exception("OnNavigatedTo should happen before Loaded.");
}
}
#endif
}
}
3 changes: 2 additions & 1 deletion src/SamplesApp/SamplesApp.Skia/SamplesApp.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
<PackageReference Include="IdentityModel.OidcClient" Version="3.1.2" />
<PackageReference Include="Microsoft.Graph" Version="3.12.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="MSTest.Analyzers" />
<!-- TODO: Use version 8 when compiling against .NET 8? -->
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.11.4-develop" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public void ContentPresenter_Template()

_app.Marked("actionButton").FastTap();

Assert.IsFalse(_app.Marked("innerText").HasResults());
Assert.IsFalse(_app.Marked("innerText2").HasResults());
Assert.IsTrue(_app.Marked("innerText").HasResults());
Assert.IsTrue(_app.Marked("innerText2").HasResults());
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ public void BitmapImage_vs_SvgImageSource_BitmapRemote()
var url = _app.Marked("url");
var btnBitmap = _app.Marked("btnBitmap");
var streamMode = _app.Marked("streamMode");
var showLow = _app.Marked("showLow");
var showLog = _app.Marked("showLog");
var img = _app.Marked("img");

showLow.SetDependencyPropertyValue("IsCheked", "False");
showLog.SetDependencyPropertyValue("IsChecked", "False");

// Load image from url
url.SetDependencyPropertyValue("Text", "https://uno-assets.platform.uno/tests/images/uno-overalls.png");
Expand Down Expand Up @@ -279,10 +279,10 @@ public void BitmapImage_vs_SvgImageSource_SvgRemote()
var url = _app.Marked("url");
var btnSvg = _app.Marked("btnSvg");
var streamMode = _app.Marked("streamMode");
var showLow = _app.Marked("showLow");
var showLog = _app.Marked("showLog");
var img = _app.Marked("img");

showLow.SetDependencyPropertyValue("IsCheked", "False");
showLog.SetDependencyPropertyValue("IsChecked", "False");

// Load image from url
url.SetDependencyPropertyValue("Text", "https://uno-assets.platform.uno/tests/images/uno-overalls.svg");
Expand Down Expand Up @@ -318,10 +318,10 @@ public void BitmapImage_vs_SvgImageSource_BitmapLocal()
var url = _app.Marked("url");
var btnBitmap = _app.Marked("btnBitmap");
var streamMode = _app.Marked("streamMode");
var showLow = _app.Marked("showLow");
var showLog = _app.Marked("showLog");
var img = _app.Marked("img");

showLow.SetDependencyPropertyValue("IsCheked", "False");
showLog.SetDependencyPropertyValue("IsChecked", "False");

// Load image from url
url.SetDependencyPropertyValue("Text", "ms-appx:///Assets/Formats/uno-overalls.png");
Expand Down Expand Up @@ -357,10 +357,10 @@ public void BitmapImage_vs_SvgImageSource_SvgLocal()
var url = _app.Marked("url");
var btnSvg = _app.Marked("btnSvg");
var streamMode = _app.Marked("streamMode");
var showLow = _app.Marked("showLow");
var showLog = _app.Marked("showLog");
var img = _app.Marked("img");

showLow.SetDependencyPropertyValue("IsCheked", "False");
showLog.SetDependencyPropertyValue("IsChecked", "False");

// Load image from url
url.SetDependencyPropertyValue("Text", "ms-appx:///Assets/Formats/uno-overalls.svg");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public void TextBox_Formatting_FlickerText()
using (new AssertionScope())
{
text2.Should().Be(text1, because: "Text content should not change at max length.");
text3.Should().Be("TextChanged: 1");
text3.Should().Be("TextChanged: 2");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,18 @@ private async Task RecordAllTestsInner(string folderName, int totalGroups, int c

ContentPhone = content;

if (control is IWaitableSample waitableSample)
{
await waitableSample.SamplePreparedTask;
}

#if HAS_UNO
await _dispatcher.RunIdleAsync(_ => { });
await _dispatcher.RunIdleAsync(_ => { });
#else
await Task.Delay(500, ct);
#endif

if (control is IWaitableSample waitableSample)
{
await waitableSample.SamplePreparedTask;
}

Console.WriteLine($"Generating screenshot for {fileName}");
var file = await rootFolder.CreateFileAsync(fileName + ".png",
CreationCollisionOption.ReplaceExisting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Uno.UI.Samples.Tests;

internal record TestCase
{
public object[] Parameters { get; init; } = Array.Empty<object>();
public object?[] Parameters { get; init; } = Array.Empty<object>();

public PointerDeviceType? Pointer { get; init; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Uno.UI.Samples.Tests;

internal record UnitTestMethodInfo
{
private readonly List<object[]> _casesParameters;
private readonly List<object?[]> _casesParameters;
private readonly IList<PointerDeviceType> _injectedPointerTypes;

private readonly bool _ignoredBecauseOfConditionalTestAttribute;
Expand Down
Loading

0 comments on commit 45c275a

Please sign in to comment.