Skip to content

Conversation

NafeelaNazhir
Copy link
Contributor

@NafeelaNazhir NafeelaNazhir commented Sep 17, 2025

This PR reopens the work from the closed PR #31122

This pull request introduces a new feature matrix page to the test host app, allowing users to interactively test and configure layout options for ScrollView child layouts. The changes add a new LayoutControlPage with a detailed UI for adjusting layout options, as well as the necessary supporting view model and navigation logic.

UI Implementation

  • Introduced LayoutControlPage and LayoutMainPage (LayoutControlPage.xaml and .xaml.cs) which display a ScrollView and buttons to switch between StackLayout and Grid layouts, and navigate to layout options. [1] [2]

Layout Options Configuration

  • Added LayoutOptionsPage (LayoutOptionsPage.xaml and .xaml.cs) providing buttons to change horizontal/vertical options, width/height requests, and scroll orientation for the ScrollView, updating the view model accordingly. [1] [2]

MVVM Support

  • Implemented LayoutViewModel, an INotifyPropertyChanged view model that tracks and updates layout properties (options, size requests, and orientation) for the test pages.

Issues Fixed

Fixes #30698

Screen.Recording.2025-08-11.at.10.48.50.AM.mov

@NafeelaNazhir NafeelaNazhir added area-testing Unit tests, device tests area-controls-scrollview ScrollView labels Sep 17, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 17, 2025
Copy link
Contributor

Hey there @@NafeelaNazhir! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Sep 17, 2025
@NafeelaNazhir NafeelaNazhir marked this pull request as ready for review September 17, 2025 13:19
@Copilot Copilot AI review requested due to automatic review settings September 17, 2025 13:19
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a comprehensive UI test suite for testing ScrollView layout behavior with different LayoutOptions configurations. The feature matrix approach allows for systematic testing of various layout combinations including horizontal/vertical alignment options, width/height requests, and scroll orientations.

  • Adds a new feature matrix test page with interactive UI controls for configuring ScrollView layout properties
  • Implements 48 automated UI tests covering different combinations of layout options, size requests, and orientations
  • Creates supporting infrastructure including MVVM pattern with LayoutViewModel for managing test state

Reviewed Changes

Copilot reviewed 7 out of 199 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ScrollViewWithLayoutOptionsFeatureTests.cs Contains 48 comprehensive UI tests for different ScrollView layout combinations
LayoutViewModel.cs View model implementing INotifyPropertyChanged for managing layout properties
LayoutOptionsPage.xaml.cs Code-behind for options configuration page with event handlers
LayoutOptionsPage.xaml UI layout for configuring layout options, size requests, and orientation
LayoutControlPage.xaml.cs Main test page with ScrollView and layout switching functionality
LayoutControlPage.xaml XAML definition for the main test interface
CorePageView.cs Registration entry point for the new feature matrix page

Comment on lines +49 to +51
App.Tap(Apply);
App.WaitForElement(StackLayoutButton);
App.Tap(StackLayoutButton);
Copy link
Preview

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

The test pattern of navigating to options, configuring settings, applying them, and then tapping layout buttons is repeated 48 times with only minor variations. Consider extracting this into a helper method to reduce code duplication and improve maintainability.

Copilot uses AI. Check for mistakes.


private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e)
{
BindingContext = _viewModel = new LayoutViewModel();
Copy link
Preview

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

Creating a new LayoutViewModel instance here discards any configuration changes made on the options page. The existing _viewModel should be reused to preserve the configured layout options.

Suggested change
BindingContext = _viewModel = new LayoutViewModel();
BindingContext = _viewModel;

Copilot uses AI. Check for mistakes.

Comment on lines 7 to 8
<ToolbarItem Text="Apply"
Clicked="ApplyButton_Clicked"/>
Copy link
Preview

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

The Apply button is missing an AutomationId. Based on the test file, it should have AutomationId="Apply" to match the test expectations.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the AutomationId in the latest commit.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rmarinho rmarinho merged commit 7d767b5 into dotnet:net10.0 Sep 22, 2025
98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-scrollview ScrollView area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants