Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/agents/issue-resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ You are a specialized issue resolution agent for the .NET MAUI repository. Your
- **iOS**: `xcrun simctl spawn booted log stream --predicate 'processImagePath contains "[AppName]"' --level=debug`
- **Android**: `adb logcat | grep -E "(FATAL|AndroidRuntime|Exception)"`

See `.github/instructions/common-testing-patterns.md` section "Error: App Crashes on Launch" for complete patterns.
See [common-testing-patterns.md](../instructions/common-testing-patterns.md) section "Error: App Crashes on Launch" for complete patterns.

## ⚡ GETTING STARTED (Progressive Disclosure)

Expand Down
28 changes: 14 additions & 14 deletions .github/agents/pr-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You are a specialized PR review agent for the .NET MAUI repository.
**BEFORE creating any plans or todos:**

1. ✅ Check current state: `git branch --show-current`
2. ✅ Read [quick-start.md](.github/instructions/pr-reviewer-agent/quick-start.md) (5 min) - **STOP after "Essential Reading" section**
2. ✅ Read [quick-start.md](../instructions/pr-reviewer-agent/quick-start.md) (5 min) - **STOP after "Essential Reading" section**
3. ✅ Fetch and analyze PR details

**ONLY AFTER completing these steps may you:**
Expand All @@ -31,7 +31,7 @@ You are a specialized PR review agent for the .NET MAUI repository.

**Phase 1: Mandatory Pre-Work (Do NOT skip)**
1. ✅ Check current branch: `git branch --show-current`
2. ✅ Read quick-start.md (5 min) - **STOP after "Essential Reading" section**
2. ✅ Read [quick-start.md](../instructions/pr-reviewer-agent/quick-start.md) (5 min) - **STOP after "Essential Reading" section**
3. ✅ Fetch PR and analyze code changes

**Phase 2: Create Initial Plan**
Expand All @@ -50,30 +50,30 @@ You are a specialized PR review agent for the .NET MAUI repository.

**Step 1: Quick Start (5 minutes - READ THIS FIRST)**

Read **[quick-start.md](.github/instructions/pr-reviewer-agent/quick-start.md)** which covers:
Read **[quick-start.md](../instructions/pr-reviewer-agent/quick-start.md)** which covers:
- ✅ Which app to use (Sandbox vs HostApp)
- ✅ Basic workflow with mandatory checkpoints
- ✅ Where to find detailed instructions
- ✅ Common mistakes to avoid

**Step 2: Context-Specific (Read as needed during work)**

- **CollectionView/CarouselView PR?** → Read [collectionview-handler-detection.md](.github/instructions/pr-reviewer-agent/collectionview-handler-detection.md)
- **SafeArea changes?** → Read [safearea-testing.instructions.md](.github/instructions/safearea-testing.instructions.md)
- **UI test files in PR?** → Read [uitests.instructions.md](.github/instructions/uitests.instructions.md)
- **Need test code examples?** → See [sandbox-setup.md](.github/instructions/pr-reviewer-agent/sandbox-setup.md)
- **Build/deploy commands?** → Use [quick-ref.md](.github/instructions/pr-reviewer-agent/quick-ref.md)
- **Hit an error?** → Check [error-handling.md](.github/instructions/pr-reviewer-agent/error-handling.md)
- **Can't complete testing?** → Use [checkpoint-resume.md](.github/instructions/pr-reviewer-agent/checkpoint-resume.md)
- **CollectionView/CarouselView PR?** → Read [collectionview-handler-detection.md](../instructions/pr-reviewer-agent/collectionview-handler-detection.md)
- **SafeArea changes?** → Read [safearea-testing.instructions.md](../instructions/safearea-testing.instructions.md)
- **UI test files in PR?** → Read [uitests.instructions.md](../instructions/uitests.instructions.md)
- **Need test code examples?** → See [sandbox-setup.md](../instructions/pr-reviewer-agent/sandbox-setup.md)
- **Build/deploy commands?** → Use [quick-ref.md](../instructions/pr-reviewer-agent/quick-ref.md)
- **Hit an error?** → Check [error-handling.md](../instructions/pr-reviewer-agent/error-handling.md)
- **Can't complete testing?** → Use [checkpoint-resume.md](../instructions/pr-reviewer-agent/checkpoint-resume.md)

**Step 3: Before Final Review (Always)**

- **Writing review?** → Read [output-format.md](.github/instructions/pr-reviewer-agent/output-format.md) to eliminate redundancy
- **Writing review?** → Read [output-format.md](../instructions/pr-reviewer-agent/output-format.md) to eliminate redundancy

**Step 4: Deep Understanding (Optional - for complex PRs)**

- **Why test deeply?** → [core-guidelines.md](.github/instructions/pr-reviewer-agent/core-guidelines.md)
- **Complete workflow details?** → [testing-guidelines.md](.github/instructions/pr-reviewer-agent/testing-guidelines.md)
- **Why test deeply?** → [core-guidelines.md](../instructions/pr-reviewer-agent/core-guidelines.md)
- **Complete workflow details?** → [testing-guidelines.md](../instructions/pr-reviewer-agent/testing-guidelines.md)

## Quick Reference

Expand All @@ -85,6 +85,6 @@ Read **[quick-start.md](.github/instructions/pr-reviewer-agent/quick-start.md)**

**Workflow**: Fetch PR → Modify Sandbox → Build/Deploy → Test → Compare WITH/WITHOUT PR → Test edge cases → Review

**Checkpoint/Resume**: If you cannot complete testing due to environment limitations (missing device, platform unavailable), use the checkpoint system in `checkpoint-resume.md`.
**Checkpoint/Resume**: If you cannot complete testing due to environment limitations (missing device, platform unavailable), use the checkpoint system in [checkpoint-resume.md](../instructions/pr-reviewer-agent/checkpoint-resume.md).

**See instruction files above for complete details.**
42 changes: 41 additions & 1 deletion src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.MainPage"
xmlns:local="clr-namespace:Maui.Controls.Sample">
xmlns:local="clr-namespace:Maui.Controls.Sample"
Title="TitleView Rotation Test">

<NavigationPage.TitleView>
<!-- Red background makes it easy to see if TitleView doesn't fill the navigation bar -->
<Grid x:Name="TitleViewGrid"
BackgroundColor="Red"
HorizontalOptions="FillAndExpand">
<Label Text="TitleView Test"
x:Name="TitleLabel"
TextColor="White"
FontSize="18"
FontAttributes="Bold"
VerticalOptions="Center"
HorizontalOptions="Center"/>
</Grid>
</NavigationPage.TitleView>

<VerticalStackLayout Padding="20" Spacing="10">
<Label Text="NavigationPage.TitleView Rotation Test"
FontSize="20"
FontAttributes="Bold"
HorizontalOptions="Center"/>

<Label Text="Testing Issue #32722: TitleView should expand to fill navigation bar after rotation on iOS 26+"
FontSize="14"
HorizontalOptions="Center"/>

<Label x:Name="StatusLabel"
Text="Rotate device to test..."
FontSize="16"
TextColor="Gray"
Margin="0,20,0,0"
HorizontalOptions="Center"/>

<Label x:Name="MeasurementsLabel"
Text=""
FontSize="14"
TextColor="Blue"
Margin="0,10,0,0"/>
</VerticalStackLayout>
</ContentPage>
90 changes: 89 additions & 1 deletion src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,97 @@
namespace Maui.Controls.Sample;
using System;

namespace Maui.Controls.Sample;

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();

// Hook into the Loaded event to measure after layout is complete
Loaded += OnLoaded;

// Also monitor size changes to track rotation
SizeChanged += OnSizeChanged;
}

private void OnLoaded(object sender, EventArgs e)
{
// Wait for layout to complete
Dispatcher.DispatchDelayed(TimeSpan.FromMilliseconds(500), () =>
{
LogMeasurements("OnLoaded (Initial)");
});
}

private void OnSizeChanged(object sender, EventArgs e)
{
// Wait for layout to complete after size change
Dispatcher.DispatchDelayed(TimeSpan.FromMilliseconds(500), () =>
{
LogMeasurements($"OnSizeChanged (Page: {Width:F0}x{Height:F0})");
});
}

private void LogMeasurements(string context)
{
Console.WriteLine($"\n========== {context} ==========");

// Get TitleView measurements
var titleViewWidth = TitleViewGrid.Width;
var titleViewHeight = TitleViewGrid.Height;
var titleViewBounds = TitleViewGrid.Bounds;

Console.WriteLine($"TitleView Width: {titleViewWidth:F2}");
Console.WriteLine($"TitleView Height: {titleViewHeight:F2}");
Console.WriteLine($"TitleView Bounds: {titleViewBounds}");

// Get screen dimensions for reference
var screenWidth = DeviceDisplay.MainDisplayInfo.Width / DeviceDisplay.MainDisplayInfo.Density;
var screenHeight = DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density;
Console.WriteLine($"Screen Size: {screenWidth:F2}x{screenHeight:F2}");

// Get page dimensions
Console.WriteLine($"Page Size: {Width:F2}x{Height:F2}");

#if IOS || MACCATALYST
// Get platform-specific navigation bar width for comparison
if (TitleViewGrid.Handler?.PlatformView is UIKit.UIView platformView)
{
var navController = platformView;
while (navController != null && navController is not UIKit.UINavigationController)
{
navController = navController.Superview;
}

if (navController is UIKit.UINavigationController uiNavController)
{
var navBarWidth = uiNavController.NavigationBar.Frame.Width;
var navBarHeight = uiNavController.NavigationBar.Frame.Height;
Console.WriteLine($"Navigation Bar Size: {navBarWidth:F2}x{navBarHeight:F2}");

var widthDiff = navBarWidth - titleViewWidth;
Console.WriteLine($"Width Difference (NavBar - TitleView): {widthDiff:F2}");

if (Math.Abs(widthDiff) > 10)
{
Console.WriteLine($"⚠️ WARNING: TitleView width ({titleViewWidth:F2}) does NOT match NavBar width ({navBarWidth:F2})");
Console.WriteLine($" This indicates the bug is present!");
}
else
{
Console.WriteLine($"✅ TitleView width matches NavBar width");
}
}
}
#endif

Console.WriteLine("=================================\n");

// Update UI label
Dispatcher.Dispatch(() =>
{
MeasurementsLabel.Text = $"Last measurement: {context}\nTitleView: {titleViewWidth:F0}x{titleViewHeight:F0}";
});
}
}