[net11.0] Merge newMain to net11.0#8
Closed
github-actions[bot] wants to merge 15 commits intonet11.0from
Closed
Conversation
Added documentation for the .NET MAUI Test Reproduction Agent, outlining its purpose, usage, and workflow for creating reproduction tests for reported issues.
`HybridWebView.js.map` is a TypeScript compilation artifact that should not be tracked in source control. Without an explicit gitignore pattern, Copilot PRs and other automated tools have been attempting to commit this file. ## Changes - Added `*.js.map` pattern to `.gitignore` to exclude JavaScript source maps - Removed previously committed `HybridWebView.js.map` from git tracking ## Pattern Specificity The `*.js.map` pattern targets only JavaScript source maps. Existing `.css.map` files (Bootstrap dependencies in templates) remain tracked as intended since they have different file extensions. ``` # Before: HybridWebView.js.map appeared as untracked $ git status Untracked files: src/Core/src/Handlers/HybridWebView/HybridWebView.js.map # After: File is properly ignored $ git check-ignore -v HybridWebView.js.map .gitignore:389:*.js.map ``` <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > all copilot PRs keep checking in src/Core/src/Handlers/HybridWebView/HybridWebView.js.map can you figure out why that has started happening and how we should fix? </details> <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/dotnet/maui/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
This pull request introduces improvements to the CarouselView feature and enhances the reliability of drag-and-drop UI tests. The most significant changes include updating the way the "Apply" action is triggered in the CarouselView options page, making CarouselView scroll operations non-animated, and improving the robustness of UI tests for both CarouselView and drag-and-drop scenarios. **CarouselView improvements:** * Moved the "Apply" action from a toolbar item to a button within the main content area in `CarouselViewOptionsPage.xaml` for better accessibility and user experience. * Changed the `ScrollTo` method in `CarouselViewControlPage.xaml.cs` to disable animation, ensuring immediate navigation to the selected item. **UI test reliability enhancements:** * Improved the drag-and-drop UI test in `DragAndDropUITests.cs` by retrying the drag-and-drop operation up to three times and asserting failure if the drop event does not fire, increasing test robustness against flakiness. * Added a retry mechanism for the `VerifyCarouselViewWithScrollTo` test on iOS, re-attempting the scroll action if the expected item does not appear, to handle platform-specific flakiness.
### Description of Change Use netcore public when possible
### Description of Change Specify the pool to send the tests
…d of UI navigation (dotnet#31673) ### Description of Change #### This PR reopens the work from the closed [dotnet#30651](dotnet#30651) This pull request introduces functionality to streamline test execution by allowing tests to be launched directly via startup arguments or programmatically. Key changes include adding support for passing test names as environment variables, introducing a `PageFactory` mechanism for dynamic page creation, and enhancing test lifecycle management for specific platforms like Mac Catalyst. Note: This PR is an extension of the PR(dotnet#30286) with a proper implementation. #### Test Execution Enhancements: - **Startup Argument Support**: Added logic to retrieve test names from environment variables and dynamically load the corresponding test page in `CreateDefaultMainPage()` (`MauiProgram.cs`). - **Dynamic Page Creation**: Introduced a `PageFactory` property in the `IssueModel` class to enable dynamic test page instantiation (`TestCases.cs`). - **Direct Test Page Retrieval**: Implemented `TryToGetTestPage()` in `TestCaseScreen` to retrieve test pages by description using `PageFactory` (`TestCases.cs`). #### Platform-Specific Test Lifecycle Improvements: - **Mac Catalyst Test Configuration**: Enhanced `_IssuesUITest` to pass test names as startup arguments and manage app launch/close lifecycle specifically for Mac Catalyst (`_IssuesUITest.cs`). [[1]](https://github.com/dotnet/maui/pull/30651/files#diff-6e8c0ea1f2979b5484d14facb1aa5b2ccef3ee748f1606eaf46220ac0936e3edR22-R46) [[2]](https://github.com/dotnet/maui/pull/30651/files#diff-6e8c0ea1f2979b5484d14facb1aa5b2ccef3ee748f1606eaf46220ac0936e3edR58-R61) - ** Appium Options for Mac Catalyst**: Updated `AppiumCatalystApp` to include environment variables in Appium options for test execution (`AppiumCatalystApp.cs`). #### Helper Methods for Test Execution: - **Parameterized App Launch**: Added a method to launch apps with additional parameters, supporting test-specific configurations (`HelperExtensions.cs`). - **Mac-Specific App Closure**: Modified `FixtureOneTimeTearDown()` to handle app closure for Mac Catalyst during test teardown (`UITestBase.cs`). ### Output https://github.com/user-attachments/assets/82fc12ad-b0d3-4bad-901f-0ab6b2bddda1 ### Issues Fixed Fixes dotnet#30285
- [x] Apply changes from PR dotnet#33101 to AppThemeBinding.cs (make class public for NET11+, make AppThemeResource public) - [x] Apply changes from PR dotnet#33101 to KnownMarkups.cs (replace helper methods with object initializers) - [x] Apply changes from PR dotnet#33101 to XamlGenerator.cs (remove AppThemeBindingHelpers generation) - [x] Apply changes from PR dotnet#33101 to test file (wrap with NET11_0_OR_GREATER) - [x] Apply changes from PR dotnet#33107 to KnownMarkups.cs (wrap method with NET11_0_OR_GREATER) - [x] Apply changes from PR dotnet#33107 to NodeSGExtensions.cs (wrap dictionary entry with NET11_0_OR_GREATER) - [x] Verify changes compile successfully - [x] Run relevant tests to ensure functionality (123 SourceGen tests passed, 34 AppTheme XAML tests passed) - [x] Code review completed (no issues found) - [x] Security scan completed (no vulnerabilities found) - [x] Remove unrelated HybridWebView.js.map file (per review feedback) <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > Please apply the changes from dotnet#33101 and dotnet#33107 to the main branch </details> <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/dotnet/maui/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
…c M3 styles (dotnet#33074) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> This pull request introduces the foundation for Material Design 3 (M3) support in .NET MAUI for Android. The changes allow developers to opt into Material Design 3 via a new MSBuild property, provide runtime detection of the Material version, and add the necessary Android resources and styles for M3. By default, apps continue to use Material Design 2 to maintain backward compatibility. **Material Design 3 opt-in and configuration:** - Added a new MSBuild property `UseMaterial3` (default: false) to allow developers to opt into Material Design 3 for Android. Internal build properties are set based on this value, and a build log message informs developers which Material version is active. (`Microsoft.Maui.Controls.Common.targets`) [[1]](diffhunk://#diff-6d91a62f494b70d0fb3dcd4fd0020ef5f83dcbbc9c8240b5cad98fc1058c6061R14-R36) [[2]](diffhunk://#diff-6d91a62f494b70d0fb3dcd4fd0020ef5f83dcbbc9c8240b5cad98fc1058c6061R57-R76) - The Material Design version is now surfaced as a runtime feature switch (`Microsoft.Maui.RuntimeFeature.IsMaterial3Enabled`), which is set during the build process if `UseMaterial3` is specified. (`Microsoft.Maui.Controls.targets`, `RuntimeFeature.cs`) [[1]](diffhunk://#diff-59cefde4ef74a9adcaff4aa8bc3271bd2d795d2b4214d7d56327b5edcca73c14R354-R357) [[2]](diffhunk://#diff-0fd447e39a83800f1f629c61f23d5a18a5c4d3d30fa3ecd81dbafbc15eb3a402R30) [[3]](diffhunk://#diff-0fd447e39a83800f1f629c61f23d5a18a5c4d3d30fa3ecd81dbafbc15eb3a402R151-R158) **Runtime and theming support:** - Introduced `MaterialDesignHelper` for runtime detection of Material Design 3 enablement, with caching for performance and a method to retrieve the current Material version. (`MaterialDesignHelper.cs`) - Updated `MauiMaterialContextThemeWrapper` to dynamically select the correct base theme (Material 2 or Material 3) at runtime using the new helper. (`MauiMaterialContextThemeWrapper.cs`) **Android resource additions for Material Design 3:** - Added comprehensive Material Design 3 color definitions for both light and dark themes, including compatibility colors for legacy components. (`colors-material3.xml`) - Added Material Design 3 style definitions, including base theme, no action bar variant, action mode, and splash theme. (`styles-material3.xml`) ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes dotnet#33073 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> ### Output | Material 2 | Material 3| |--|--| | <img width="1080" height="1920" alt="M2" src="https://github.com/user-attachments/assets/877c4133-6f08-40da-90c3-d685d9e1b882" /> | <img width="1080" height="1920" alt="M3" src="https://github.com/user-attachments/assets/e2cebb4b-8438-4858-b453-414c2e03b504" /> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Split iOS device tests by category in Helix to work around an unknown issue that causes tests to take over an hour when run together, vs under 15 minutes when split. ## Problem When running all Controls.DeviceTests categories together on iOS in CI, the test run takes over an hour. When the same tests are split by category, they complete in under 15 minutes total. This issue only reproduces in CI - we haven't been able to reproduce it locally. Ideally we'd find and fix the root cause, but until then this workaround keeps CI times reasonable. ## Changes ### Helix Configuration (`eng/helix_xharness.proj`) - Add `ControlsTestCategoriesToSkipForRestOfTests` property defining heavy categories to run individually - Split Controls.DeviceTests into 4 work items for iOS: - 3 heavy categories run separately: `CollectionView`, `Shell`, `HybridWebView` - 1 "Other" work item runs all remaining categories - Core.DeviceTests runs as a single work item (no splitting) - MacCatalyst and Android unchanged ### Test Infrastructure (`src/Core/tests/DeviceTests.Shared/DeviceTestSharedHelpers.cs`) - Add support for `TestFilter=SkipCategories=X,Y,Z` environment variable - Allows skipping multiple categories via comma or semicolon-separated list - Existing `TestFilter=Category=X` support unchanged ### Documentation (`.github/instructions/helix-device-tests.instructions.md`) - Add Copilot instructions for Helix device test configuration - Document category splitting, local execution, and troubleshooting ## Result iOS device tests now run as ~8 parallel work items instead of 5, with the slowest categories isolated. This brings iOS device test time from 1+ hour down to ~15 minutes.
This pull request makes minor adjustments to the shadow feature test UI and test logic. The main change is the removal of the numeric keyboard from several entry fields in the shadow feature test page, and a small improvement to the shadow color test to clear the color entry before entering a new value. UI adjustments in shadow feature page: * Removed the `Keyboard="Numeric"` property from the `OffsetXEntry`, `OffsetYEntry`, `RadiusEntry`, and `OpacityEntry` input fields in `ShadowFeaturePage.xaml`, so these fields will now use the default keyboard instead of the numeric keyboard. Test improvements: * Updated the `Shadow_SetColor` test to clear the `ColorEntry` field before entering a new color value, ensuring the test input is not affected by any previous value.
…mple Projects (dotnet#33282) <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> This pull request introduces a new `UseMaterial3` property, set to `false` by default, across several project files. It also adds documentation comments to clarify that if this flag is changed, developers must delete the `artifacts` folder and rebuild the entire codebase to avoid build issues. Configuration and documentation updates: * Added the `<UseMaterial3>false</UseMaterial3>` property to `Maui.Controls.Sample.Sandbox.csproj`, `Maui.Controls.Sample.csproj`, and `Controls.TestCases.HostApp.csproj`, along with comments explaining the need to clean artifacts and rebuild if the flag is changed. [[1]](diffhunk://#diff-d99ae49df2f89869b0081632bce2fb57dff57b036662b3f6c8e5feeb6a66ef9dR16-R18) [[2]](diffhunk://#diff-af863121b6168780847c8835ede77fb1b01120fa3f9dd5fb48a846128f9c08fdR18-R20) [[3]](diffhunk://#diff-c73eb67a2a515f32003a6bdc59df7156d492dfcafb1b828723476f67cd439103R16-R18) Fixes # <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
- Add MergeBranchAndCreatePR.ps1 script for automated branch merging - Add weekly-branch-merge.yml workflow (runs Mondays, merges main to net10.0/net11.0) - Add merge-branches skill following Agent Skills specification - Add skills.instructions.md for skill development guidelines - Update copilot-instructions.md with skills section Features: - Required parameters: Remote, TargetBranch - Creates merge branch (never pushes to target directly) - Adds p/0 label to PRs - Skips if merge branch already exists - Dry run mode for testing
PureWeen
pushed a commit
that referenced
this pull request
Mar 9, 2026
…tnet#33071) App crashes because of changing a shared Drawable on the fly. I found out it is the SearchBar. It only happens on Android and in large apps with lots of screens. Unfortunately I can't reproduce it in the TestSuite. But by reading the docs of Android this crash is common and caused by changing a Drawable which is still referenced. With a custom SearchBarHandler the issues is resolved. ```Backtrace (top frames): #00 pc 00000000006b8694 /system/lib64/libhwui.so android::getRootAlpha(_JNIEnv*, _jobject*, long) +4 #1 pc 0000000002256c90 /memfd:jit-cache (deleted) art_jni_trampoline +112 #2 pc 000000000223bc4c /memfd:jit-cache (deleted) android.graphics.drawable.VectorDrawable.-$$Nest$smnGetRootAlpha +108 #3 pc 000000000223bb20 /memfd:jit-cache (deleted) android.graphics.drawable.VectorDrawable$VectorDrawableState.getAlpha +144 #4 pc 00000000025c50e0 /memfd:jit-cache (deleted) android.graphics.drawable.VectorDrawable.getAlpha +128 #5 pc 00000000025c4f9c /memfd:jit-cache (deleted) android.graphics.drawable.VectorDrawable.getOpacity +124 #6 pc 00000000025c1ea8 /memfd:jit-cache (deleted) android.widget.ImageView.isOpaque +152 #7 pc 000000000227979c /memfd:jit-cache (deleted) android.view.View.invalidateInternal +428 #8 pc 00000000025c4790 /memfd:jit-cache (deleted) android.widget.ImageView.invalidateDrawable +256 #9 pc 000000000224419c /memfd:jit-cache (deleted) android.graphics.drawable.Drawable.invalidateSelf +156 #10 pc 000000000260e710 /memfd:jit-cache (deleted) android.graphics.drawable.VectorDrawable.setTintList +192 #11 pc 00000000025d0094 /memfd:jit-cache (deleted) **android.graphics.drawable.Drawable.setTint +148** ``` ### Description of Change - Changes tinting of Androids SearchBar to unified setTint instead of setColorFilter - Mutates the drawable before setting the tint. ### Issues Fixed Issue is fixed with a custom handler for now. Fixes dotnet#33070
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
Weekly merge of
newMainintonet11.0.This PR brings the latest changes from
newMainbranch into thenet11.0branch.Checklist