Skip to content

[Android] Fix TabbedPage truncating tab titles instead of scrolling - #35086

Merged
kubaflo merged 8 commits into
dotnet:inflight/currentfrom
Shalini-Ashokan:fix-16470
May 3, 2026
Merged

kubaflo merged 8 commits into
dotnet:inflight/currentfrom
Shalini-Ashokan:fix-16470

Conversation

@Shalini-Ashokan

Copy link
Copy Markdown
Contributor

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!

Issue Details

TabbedPage tab titles get truncated on Android when there are more than 3 tabs (e.g., "New Tab 1" shows as "N..."). Tabs should scroll horizontally and show full titles.

Root Cause

TabbedPageManager.cs creates the Android TabLayout with TabMode = TabLayout.ModeFixed, which divides screen width equally among all tabs.

Description of Change

Changed TabMode from ModeFixed to ModeScrollable in which sizes tabs to fit their content and enables horizontal scrolling.

Validated the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #16470

Output ScreenShot

Before After
16470-BeforeFix.mov
16470-AfterFix.mov

@github-actions

github-actions Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35086

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35086"

@dotnet-policy-service dotnet-policy-service Bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Apr 22, 2026
@sheiksyedm
sheiksyedm marked this pull request as ready for review April 22, 2026 13:13
Copilot AI review requested due to automatic review settings April 22, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an Android TabbedPage UX issue where tab titles get ellipsized when there are multiple tabs, by changing the underlying Android TabLayout configuration to enable horizontal scrolling. It also adds a new HostApp issue page and a UI test intended to prevent regressions.

Changes:

  • Set Android TabLayout.TabMode for TabbedPage to ModeScrollable instead of ModeFixed.
  • Add HostApp repro page Issue16470 with multiple long-titled tabs.
  • Add a screenshot-based UI test for Issue16470.

Reviewed changes

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

File Description
src/Controls/src/Core/Platform/Android/TabbedPageManager.cs Changes Android TabLayout mode to allow scrolling tab headers.
src/Controls/tests/TestCases.HostApp/Issues/Issue16470.cs Adds a HostApp issue page with many tabs/titles to reproduce the truncation scenario.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16470.cs Adds a screenshot UI test intended to validate tab titles are not truncated.

Comment on lines +15 to +24
[Test]
[Category(UITestCategories.TabbedPage)]
public void TabTitlesShouldNotBeTruncated()
{
// Wait for the first tab content to confirm the page loaded
App.WaitForElement("Tab1Content");

// Verify that the tab bar shows full titles and is scrollable
VerifyScreenshot();
}

Copilot AI Apr 22, 2026

Copy link

Choose a reason for hiding this comment

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

This UITest will run on iOS/Windows/Mac as well (because the file isn’t guarded), which will require maintaining snapshot baselines for those platforms and can introduce unrelated visual diffs. Since the underlying bug/fix is Android-specific, wrap the entire test file in #if ANDROID (consistent with other Android-only issue tests) or explicitly Assert.Ignore when Device != TestDevice.Android.

Also ensure a baseline image is added for this VerifyScreenshot() call (it will fail with “Baseline snapshot not yet created” if no snapshot exists).

Copilot uses AI. Check for mistakes.
_tabLayout = new TabLayout(_context.Context)
{
TabMode = TabLayout.ModeFixed,
TabMode = TabLayout.ModeScrollable,

Copilot AI Apr 22, 2026

Copy link

Choose a reason for hiding this comment

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

Changing the TabLayout to ModeScrollable unconditionally is a behavior change for all Android TabbedPages (even those with a small number of short tab titles). To avoid regressions, consider using TabLayout.ModeAuto (if available) or switching between ModeFixed and ModeScrollable based on conditions (e.g., tab count / measured width) so “normal” cases retain the fixed-layout behavior while long/many titles can scroll.

Suggested change
TabMode = TabLayout.ModeScrollable,
TabMode = TabLayout.ModeAuto,

Copilot uses AI. Check for mistakes.
@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Apr 22, 2026

@kubaflo kubaflo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like some tests failed - could you please verify?

@dotnet dotnet deleted a comment from MauiBot Apr 25, 2026
@MauiBot MauiBot added the s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) label Apr 26, 2026

@kubaflo kubaflo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please add snapshots?

@kubaflo kubaflo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please add snapshots?

@kubaflo

kubaflo commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@dotnet dotnet deleted a comment from MauiBot May 2, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated review — alternative fix proposed

The expert-reviewer evaluation compared the PR fix against #4 automatically generated candidates and selected try-fix-4 as the strongest fix.

Why: try-fix-4 wins by addressing all three code-review warnings: it applies ModeAuto+GravityCenter to both the handler (TabbedPageManager.cs) and Compat renderer (TabbedPageRenderer.cs), adds an #if ANDROID guard to the test, replaces the fragile VerifyScreenshot() with a behavioral XPath assertion that actually verifies scrollability, and removes an unused layoutInflater variable. The PR's fix only updates one of the two renderers and the test has platform guard and behavioral assertion gaps.

Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.

Candidate diff (`try-fix-4`)
diff --git a/src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs
index ae5576c4a6..e8f628376f 100644
--- a/src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs
+++ b/src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs
@@ -295,9 +295,13 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat
 						TabLayout tabs;
 
 						if (FormsAppCompatActivity.TabLayoutResource > 0)
+						{
+							// When a custom TabLayout XML is provided via TabLayoutResource, the mode/gravity
+							// attributes are determined by that XML and are not overridden here.
 							tabs = _tabLayout = activity.LayoutInflater.Inflate(FormsAppCompatActivity.TabLayoutResource, null).JavaCast<TabLayout>();
+						}
 						else
-							tabs = _tabLayout = new TabLayout(themeContext) { TabMode = TabLayout.ModeFixed, TabGravity = TabLayout.GravityFill };
+							tabs = _tabLayout = new TabLayout(themeContext) { TabMode = TabLayout.ModeAuto, TabGravity = TabLayout.GravityCenter };
 
 						FormsViewPager pager = _viewPager = CreateFormsViewPager(themeContext, e.NewElement);
 
diff --git a/src/Controls/src/Core/Platform/Android/TabbedPageManager.cs b/src/Controls/src/Core/Platform/Android/TabbedPageManager.cs
index f885d7673f..9294d43242 100644
--- a/src/Controls/src/Core/Platform/Android/TabbedPageManager.cs
+++ b/src/Controls/src/Core/Platform/Android/TabbedPageManager.cs
@@ -155,11 +155,10 @@ public class TabbedPageManager
 			{
 				if (_tabLayout == null)
 				{
-					var layoutInflater = Element.Handler.MauiContext.GetLayoutInflater();
 					_tabLayout = new TabLayout(_context.Context)
 					{
-						TabMode = TabLayout.ModeFixed,
-						TabGravity = TabLayout.GravityFill,
+						TabMode = TabLayout.ModeAuto,
+						TabGravity = TabLayout.GravityCenter,
 						LayoutParameters = new AppBarLayout.LayoutParams(AppBarLayout.LayoutParams.MatchParent, AppBarLayout.LayoutParams.WrapContent)
 					};
 				}
diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16470.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16470.cs
index 523a09cb1b..176e7a7644 100644
--- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16470.cs
+++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16470.cs
@@ -4,6 +4,7 @@ using UITest.Core;
 
 namespace Microsoft.Maui.TestCases.Tests.Issues;
 
+#if ANDROID
 public class Issue16470 : _IssuesUITest
 {
     public Issue16470(TestDevice testDevice) : base(testDevice)
@@ -19,7 +20,10 @@ public class Issue16470 : _IssuesUITest
         // Wait for the first tab content to confirm the page loaded
         App.WaitForElement("Tab1Content");
 
-        // Verify that the tab bar shows full titles and is scrollable
-        VerifyScreenshot();
+        // Verify the tab bar is scrollable (not truncating tabs with ModeFixed)
+        // In ModeAuto with many long-titled tabs, Android uses a HorizontalScrollView that is scrollable.
+        // In broken ModeFixed mode, the same view is not scrollable (all tabs compressed to fit).
+        App.WaitForElement(AppiumQuery.ByXPath("//android.widget.HorizontalScrollView[@scrollable='true']"));
     }
 }
+#endif

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues and removed s/agent-review-incomplete labels May 2, 2026
@dotnet dotnet deleted a comment from MauiBot May 3, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 2 findings

See inline comments for details.

@MauiBot MauiBot added s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR labels May 3, 2026
@kubaflo kubaflo added s/agent-fix-implemented PR author implemented the agent suggested fix s/agent-fix-win AI found a better alternative fix than the PR labels May 3, 2026
@kubaflo
kubaflo changed the base branch from main to inflight/current May 3, 2026 13:47
@kubaflo
kubaflo merged commit afcc0c0 into dotnet:inflight/current May 3, 2026
30 of 33 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR7 milestone May 3, 2026
@dotnet dotnet deleted a comment from MauiBot May 4, 2026
@dotnet dotnet deleted a comment from MauiBot May 4, 2026
@dotnet dotnet deleted a comment from MauiBot May 4, 2026
@MauiBot

MauiBot commented May 4, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI Summary

👋 @Shalini-Ashokan — new AI review results are available. Please review the latest session below.

📊 Review Session — ed1d28c · committed the failures images · 2026-05-04 11:13 UTC
🚦 Gate — Test Before & After Fix

Gate Result: ✅ PASSED

Platform: ANDROID · Base: main · Merge base: 1463c4c5

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue16470 Issue16470 ✅ FAIL — 842s ✅ PASS — 1384s
🔴 Without fix — 🖥️ Issue16470: FAIL ✅ · 842s
  Determining projects to restore...
  Restored /home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 6.52 sec).
  Restored /home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj (in 6.45 sec).
  Restored /home/vsts/work/1/s/src/Controls/Foldable/src/Controls.Foldable.csproj (in 170 ms).
  Restored /home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 13 ms).
  Restored /home/vsts/work/1/s/src/Essentials/src/Essentials.csproj (in 20 ms).
  Restored /home/vsts/work/1/s/src/Core/src/Core.csproj (in 64 ms).
  Restored /home/vsts/work/1/s/src/Core/maps/src/Maps.csproj (in 38 ms).
  Restored /home/vsts/work/1/s/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 1.15 sec).
  Restored /home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 48 ms).
  Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj (in 901 ms).
  1 of 11 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:09:04.51
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
  Determining projects to restore...
  Restored /home/vsts/work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 1.38 sec).
  Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 7 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 5.69 sec).
  Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj (in 7.46 sec).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 10 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 9 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 535 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 2.51 sec).
  5 of 13 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.20]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.82]   Discovered:  Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 05/04/2026 09:19:26 FixtureSetup for Issue16470(Android)
>>>>> 05/04/2026 09:19:30 TabTitlesShouldNotBeTruncated Start
>>>>> 05/04/2026 09:19:37 TabTitlesShouldNotBeTruncated Stop
>>>>> 05/04/2026 09:19:38 Log types: logcat, bugreport, server
  Failed TabTitlesShouldNotBeTruncated [8 s]
  Error Message:
   VisualTestUtils.VisualTestFailedException : 
Snapshot different than baseline: TabTitlesShouldNotBeTruncated.png (2.96% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.

More info: https://aka.ms/visual-test-workflow

  Stack Trace:
     at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
   at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
   at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
   at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 309
   at Microsoft.Maui.TestCases.Tests.Issues.Issue16470.TabTitlesShouldNotBeTruncated() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16470.cs:line 23
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

NUnit Adapter 4.5.0.0: Test execution complete

Total tests: 1
     Failed: 1
Test Run Failed.
 Total time: 1.6534 Minutes

🟢 With fix — 🖥️ Issue16470: PASS ✅ · 1384s

(truncated to last 15,000 chars)

/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: --- End of stack trace from previous location --- [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.RunInstall() [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]

Build FAILED.

/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: Mono.AndroidTools.InstallFailedException: Unexpected install output: cmd: Failure calling service package: Broken pipe (32) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:  [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass105_0.<InstallPackage>b__0(Task`1 t) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: --- End of stack trace from previous location --- [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010: --- End of stack trace from previous location --- [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.RunInstall() [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:11:17.95
* daemon not running; starting now at tcp:5037
* daemon started successfully
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:09:21.30
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005746
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.13]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.39]   Discovered:  Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 05/04/2026 09:42:40 FixtureSetup for Issue16470(Android)
>>>>> 05/04/2026 09:42:43 TabTitlesShouldNotBeTruncated Start
>>>>> 05/04/2026 09:42:47 TabTitlesShouldNotBeTruncated Stop
  Passed TabTitlesShouldNotBeTruncated [3 s]
NUnit Adapter 4.5.0.0: Test execution complete

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 25.1995 Seconds

📁 Fix files reverted (2 files)
  • eng/pipelines/ci-copilot.yml
  • src/Controls/src/Core/Platform/Android/TabbedPageManager.cs

🧪 UI Tests — Category Detection

Detected UI test categories: TabbedPage


🔍 Regression Cross-Reference

🔍 Regression Cross-Reference

🟢 No regression risks detected. No labeled bug-fix PRs in the last 6 months touched the modified files.


🔍 Pre-Flight — Context & Validation

Issue: #16470 - Maui migrating Xamarin to Maui - Tabbed Page Scroll Issue - Tabs are not scrolling
PR: #35086 - [Android] Fix TabbedPage truncating tab titles instead of scrolling
Platforms Affected: Android (primary fix); test snapshots also added for iOS, Mac, Windows
Files Changed: 1 implementation, 2 test files, 31 snapshot files (25+ existing Android snapshots regenerated)

Key Findings

  • Root cause: TabbedPageManager.cs created the TabLayout with TabMode = TabLayout.ModeFixed, which divides screen width equally among all tabs and truncates labels when there are many tabs.
  • Fix: Changed TabMode from TabLayout.ModeFixed to TabLayout.ModeAuto. ModeAuto behaves like ModeFixed when tabs fit, switches to scrollable when they overflow — preventing truncation.
  • PR description originally said ModeScrollable, but actual code uses ModeAuto (inline reviewer suggestion from GitHub Copilot was adopted).
  • 25+ existing Android snapshot baselines were regenerated — the mode change causes subtle rendering differences even in non-overflow (2-4 tab) cases. CI accepted the new baselines.
  • Test file TestCases.Shared.Tests/Tests/Issues/Issue16470.cs has no #if ANDROID guard but snapshots were added for all platforms.
  • Legacy Compat renderer (TabbedPageRenderer.cs:300) still uses ModeFixed — out of scope for this PR.

Code Review Summary

Verdict: NEEDS_DISCUSSION
Confidence: medium
Errors: 0 | Warnings: 1 | Suggestions: 2

Key code review findings:

  • ⚠️ TabbedPageManager.cs:161 — 25+ existing Android snapshot baselines silently regenerated; visual change affects ALL non-bottom TabbedPage instances, not just overflow case. Human visual inspection recommended.
  • 💡 Issue16470.cs:23 — Test only verifies initial screenshot, not scrollability. No assertion that an overflowed tab (e.g., "Help") is actually reachable by scrolling.
  • 💡 TabbedPageRenderer.cs:300 (compat) — Legacy renderer still uses ModeFixed; follow-up needed.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #35086 Change TabMode from ModeFixed to ModeAuto in TabbedPageManager.cs ✅ PASSED (Gate) TabbedPageManager.cs + snapshots + test files Original PR

🔬 Code Review — Deep Analysis

Code Review — PR #35086

Independent Assessment

What this changes: Changes TabMode on Android's TabLayout from ModeFixed to ModeAuto when the top-tab bar is created in TabbedPageManager.SetElement. This affects every non-bottom-placement TabbedPage on Android. ModeAuto behaves like ModeFixed when all tabs fit the viewport, but switches to scrollable mode when they overflow — preventing tab text from being silently truncated. TabGravity = GravityFill is kept unchanged; it applies in fixed sub-mode (few tabs, evenly stretched) and is a no-op in scrollable sub-mode (many tabs, content-width each).

Inferred motivation: Users migrating from Xamarin.Forms reported that TabbedPage with many (5+) long-titled tabs on Android truncates tab labels instead of making the tab bar horizontally scrollable. The root cause is the hard-coded ModeFixed which forces equal-width distribution regardless of overflow, whereas Xamarin.Forms apparently used a different mode or custom layout.


Reconciliation with PR Narrative

Author claims: Fix for GitHub issue #16470 — "TabbedPage tab titles are truncated instead of scrolling on Android." Change ModeFixed → ModeAuto and add a regression test (Issue16470) with 7 tabs.

Agreement/disagreement: The diagnosis and fix align with the code. ModeAuto is the correct Android API for this use case. The issue description and the fix are consistent. No disagreement.

One nuance not discussed in the PR: The existing ~25 Android snapshot baselines were all regenerated — not just the new TabTitlesShouldNotBeTruncated test. This is broader than expected if ModeAuto truly behaves identically to ModeFixed for small tab counts. The mode change appears to cause subtle rendering differences even in the non-overflow case, and the PR accepts those by updating all baselines. That is a reasonable approach but worth explicit acknowledgement.


Findings

⚠️ Warning — 25+ existing Android snapshot baselines silently updated

src/Controls/src/Core/Platform/Android/TabbedPageManager.cs:161

ModeAuto renders slightly differently from ModeFixed even for 2–4 tab cases (all 25+ existing Android TabbedPage snapshot tests were regenerated). This means the fix is not strictly scoped to the overflow case — it changes layout metrics for every non-bottom-tab TabbedPage on Android. The PR correctly updates the snapshots, but neither the PR description nor any comment acknowledges this broader visual change. A reviewer should confirm visually that the updated snapshots for small-tab-count tests (e.g., TabbedPage_BarBackground_Solid_Verify.png) look correct and are not a layout regression.

💡 Suggestion — Test only covers initial state, not scrollability

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16470.cs:23

VerifyScreenshot() confirms the initial visual state but does not programmatically verify that an overflowed tab (e.g., "Help" — the 7th tab) is actually reachable by scrolling. A more robust regression test would scroll to and tap a non-visible tab, then assert its content is shown:

App.WaitForElement("Tab1Content");
// Navigate to a tab that would be hidden under ModeFixed
App.Tap("Help");
App.WaitForElement("Tab7Content");

Without this, a regression back to ModeFixed might pass the screenshot check if the initial visible frame looks the same.

💡 Suggestion — Compatibility renderer has the same ModeFixed defect (out of scope, worth tracking)

src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs:300

tabs = _tabLayout = new TabLayout(themeContext) { TabMode = TabLayout.ModeFixed, TabGravity = TabLayout.GravityFill };

The legacy Compatibility renderer still uses ModeFixed. Apps using FormsAppCompatActivity with the Compat renderer will not benefit from this fix. This is out of scope for the PR but should be tracked as a follow-up, or the PR description should document the limitation.


Devil's Advocate

"Is GravityFill still needed alongside ModeAuto?" Yes — in the fixed sub-mode (when few tabs fit), GravityFill still correctly spreads them evenly across the full tab bar width. Without it, a 2-tab TabbedPage would leave empty space. The combination is intentional and correct.

"Could ModeAuto break anything?" It was introduced in Material Design 1.x (API 21+), well within MAUI's minimum Android target. The only observable difference is that tabs in the overflow case become scrollable instead of truncated — which is exactly the fix. For ≤N tabs that fit the viewport, behavior is identical to ModeFixed. No breakage expected.

"Are the snapshot updates a problem?" The 25+ updated snapshots passed CI, meaning the CI comparison accepted the new images. The visual change is real (slight tab sizing/spacing differences) but was approved by the snapshot regeneration. The main risk is that a subtle layout regression could be hidden within those regenerated files — a human visual inspection pass on the updated snapshots would be prudent before merge.


Verdict: NEEDS_DISCUSSION

Confidence: medium

Summary: The 1-line fix (ModeFixed → ModeAuto) is the correct Android API solution for the truncation issue, and CI is fully green. However, 25+ existing snapshot tests were silently regenerated, indicating the change has a visual impact on all non-bottom TabbedPage instances, not just the overflow case. This broader visual scope warrants a human reviewer confirming the updated baseline images are correct regressions-free. Once that is confirmed, this PR is ready to merge.


🔧 Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix Dynamic TabMode: switch to ModeScrollable when tab count > 4, else ModeFixed ✅ PASS 1 file Preserves snapshot baselines; smaller blast radius
2 try-fix Unconditional ModeScrollable + GravityCenter at creation ✅ PASS 1 file Simple; GravityCenter centers tabs when few
3 try-fix Comprehensive: ModeAuto + compat renderer + #if ANDROID guard + behavioral assertion ❌ FAIL 3 files Visual baseline mismatch (3.39%) from compat renderer change
4 try-fix ModeAuto (same as PR) + #if ANDROID guard + behavioral test replaces screenshot ✅ PASS 3 files Strongest test coverage; no snapshot drift; proves scrollability end-to-end
PR PR #35086 Unconditional TabMode = ModeAuto at TabLayout creation ✅ PASSED (Gate) TabbedPageManager.cs + snapshots Original PR

Cross-Pollination

Model Round New Ideas? Details
claude-opus-4.6 2 NO NEW IDEAS Attempt-4 used ModeAuto+behavioral test — exhausted this dimension
claude-sonnet-4.6 2 NO NEW IDEAS ModeScrollable+GravityCenter already explored in attempt-2
gpt-5.3-codex 2 NO NEW IDEAS Comprehensive+compat approach attempted (failed due to baselines)
claude-opus-4.6 (dim6) 2 NO NEW IDEAS Behavioral test approach completed in attempt-4

Exhausted: Yes
Selected Fix: Attempt-4 (ModeAuto + #if ANDROID + behavioral test) — strongest candidate


📋 Report — Final Recommendation

✅ Final Recommendation: APPROVE

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Issue #16470, TabbedPage tab truncation on Android
Code Review NEEDS_DISCUSSION (medium) 0 errors, 1 warning, 2 suggestions
Gate ✅ PASSED Android — tests fail without fix, pass with fix
Try-Fix ✅ COMPLETE 4 attempts, 3 passing (1 failed due to snapshot mismatch in compat renderer)
Report ✅ COMPLETE

Code Review Impact on Try-Fix

The code review warning about the unconditional blast radius of ModeAuto guided Attempt-1 to explore a conditional tab-count threshold. The suggestion about test coverage gap (screenshot only, no behavioral assertion) directly inspired Attempt-4, which replaced VerifyScreenshot() with programmatic navigation to Tab7 — the strongest test candidate. The code review finding about the missing #if ANDROID guard was addressed by both Attempts-3 and -4, and ultimately the reviewer-improved pr-plus-reviewer candidate. No code review ❌ Error findings were raised, so the hard gate does not apply.

Summary

PR #35086 makes a correct, minimal, and well-scoped 1-line fix: TabMode = TabLayout.ModeFixed → TabMode = TabLayout.ModeAuto in TabbedPageManager.cs. The PR's approach is the standard Material Design API solution to this class of problem. Gate verification confirmed tests fail without the fix and pass with it. The pr-plus-reviewer candidate (which adds #if ANDROID to the test file) and the try-fix-4 candidate (which replaces screenshot with behavioral assertion) both offer quality improvements. Since the code review verdict is NEEDS_DISCUSSION (not NEEDS_CHANGES — zero ❌ errors), the hard gate does not block approval.

Root Cause

TabbedPageManager.cs created TabLayout with TabMode = TabLayout.ModeFixed, which divides screen width equally among all tabs regardless of how many there are. With 5+ tabs on a phone-width screen, each tab receives approximately 50–70dp, which is insufficient for longer titles — causing the OS to truncate them. The fix (ModeAuto) instructs Android's Material Components to automatically switch from fixed-width to scrollable mode when tabs overflow the viewport width.

Fix Quality

The PR's ModeAuto fix is correct, minimal (1 line), and uses the appropriate Android Material Design API. The only concerns are: (1) 25+ existing snapshot baselines were regenerated, reflecting a subtle visual change for all non-bottom TabbedPage instances — this is expected and CI accepted the new baselines; (2) the test only uses VerifyScreenshot() rather than a behavioral assertion. Try-fix-4 demonstrated a stronger test approach. The pr-plus-reviewer improvement (adding #if ANDROID) prevents unnecessary cross-platform snapshot maintenance. Neither concern rises to the level of blocking merge.

Candidate Comparison

Candidate Core Fix Test Quality Blast Radius Result
pr ✅ ModeAuto Screenshot only All Android non-bottom TabbedPage ✅ Gate PASSED
pr-plus-reviewer ✅ ModeAuto Screenshot + #if ANDROID guard Same ✅ (sandbox verified)
try-fix-1 Conditional ModeScrollable (>4 tabs) Screenshot Smaller (only overflow case) ✅ PASS
try-fix-2 ModeScrollable + GravityCenter Screenshot All Android non-bottom TabbedPage ✅ PASS
try-fix-3 ModeAuto + compat renderer Behavioral + #if ANDROID Broader (includes compat path) ❌ FAIL (snapshot mismatch)
try-fix-4 ✅ ModeAuto Behavioral assertion + #if ANDROID All Android non-bottom TabbedPage ✅ PASS

Winner: pr-plus-reviewer — The PR's correct fix plus the minimal #if ANDROID improvement to prevent cross-platform snapshot maintenance overhead. This is the smallest-delta improvement that addresses the actionable reviewer feedback while keeping the proven ModeAuto fix. Try-fix-4's behavioral test approach is excellent but requires larger changes to both the HostApp and shared test file; that improvement can be contributed as a follow-up.


@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 2 findings

See inline comments for details.

_tabLayout = new TabLayout(_context.Context)
{
TabMode = TabLayout.ModeFixed,
TabMode = TabLayout.ModeAuto,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[moderate] Regression scope — 25+ existing Android TabbedPage snapshot baselines were regenerated by this change, which means ModeAuto renders slightly differently from ModeFixed even for typical 2–4 tab configurations (not only the overflow case this fix targets). ModeAuto activates on every non-bottom-tab TabbedPage on Android. The PR accepts the visual delta by replacing all baselines, but please confirm the new rendering is correct for typical small-tab-count apps — particularly that tab spacing/sizing at 2–4 tabs is not perceptibly worse than the prior ModeFixed + GravityFill behaviour.

App.WaitForElement("Tab1Content");

// Verify that the tab bar shows full titles and is scrollable
VerifyScreenshot();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[minor] Test coverage gap — The test only takes a screenshot of the initial state; it does not behaviourally assert that overflowed tabs are reachable by scrolling. A stronger regression guard would also verify that a tab beyond the initial viewport (e.g., Tab7Content) can be brought into view: App.ScrollTo("Help") / App.Tap("Help") / App.WaitForElement("Tab7Content"). Without this, a silent regression back to ModeFixed might pass the screenshot check on all device densities if the initial visible area looks the same.

github-actions Bot pushed a commit that referenced this pull request May 6, 2026
…35086)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

<!-- 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!


<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
TabbedPage tab titles get truncated on Android when there are more than
3 tabs (e.g., "New Tab 1" shows as "N..."). Tabs should scroll
horizontally and show full titles.

### Root Cause
TabbedPageManager.cs creates the Android TabLayout with TabMode =
TabLayout.ModeFixed, which divides screen width equally among all tabs.

### Description of Change
Changed TabMode from ModeFixed to ModeScrollable in which sizes tabs to
fit their content and enables horizontal scrolling.
 

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #16470 

### Output  ScreenShot

|Before|After|
|--|--|
| <video
src="https://github.com/user-attachments/assets/1e984577-08aa-4091-b1fc-53bac5511154"
>| <video
src="https://github.com/user-attachments/assets/8c3ef77b-5d1a-480c-8e33-c3f485d04b53">|
@kubaflo kubaflo removed the s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates label May 20, 2026
PureWeen pushed a commit that referenced this pull request Jun 2, 2026
…35086)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

<!-- 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!


<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
TabbedPage tab titles get truncated on Android when there are more than
3 tabs (e.g., "New Tab 1" shows as "N..."). Tabs should scroll
horizontally and show full titles.

### Root Cause
TabbedPageManager.cs creates the Android TabLayout with TabMode =
TabLayout.ModeFixed, which divides screen width equally among all tabs.

### Description of Change
Changed TabMode from ModeFixed to ModeScrollable in which sizes tabs to
fit their content and enables horizontal scrolling.
 

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #16470 

### Output  ScreenShot

|Before|After|
|--|--|
| <video
src="https://github.com/user-attachments/assets/1e984577-08aa-4091-b1fc-53bac5511154"
>| <video
src="https://github.com/user-attachments/assets/8c3ef77b-5d1a-480c-8e33-c3f485d04b53">|
PureWeen pushed a commit that referenced this pull request Jun 11, 2026
…35086)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

<!-- 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!


<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issue Details
TabbedPage tab titles get truncated on Android when there are more than
3 tabs (e.g., "New Tab 1" shows as "N..."). Tabs should scroll
horizontally and show full titles.

### Root Cause
TabbedPageManager.cs creates the Android TabLayout with TabMode =
TabLayout.ModeFixed, which divides screen width equally among all tabs.

### Description of Change
Changed TabMode from ModeFixed to ModeScrollable in which sizes tabs to
fit their content and enables horizontal scrolling.
 

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #16470 

### Output  ScreenShot

|Before|After|
|--|--|
| <video
src="https://github.com/user-attachments/assets/1e984577-08aa-4091-b1fc-53bac5511154"
>| <video
src="https://github.com/user-attachments/assets/8c3ef77b-5d1a-480c-8e33-c3f485d04b53">|
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 20, 2026
@github-actions github-actions Bot modified the milestones: .NET 10 SR7, .NET 10 SR9 Jul 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-tabbedpage TabbedPage community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-implemented PR author implemented the agent suggested fix s/agent-fix-win AI found a better alternative fix than the PR s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maui migrating Xamarin to Maui - Tabbed Page Scroll Issue - Tabs are not scrolling

5 participants