diff --git a/.github/agents/issue-resolver.md b/.github/agents/issue-resolver.md index feb2dca1f4a0..ca6cff3e285e 100644 --- a/.github/agents/issue-resolver.md +++ b/.github/agents/issue-resolver.md @@ -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) diff --git a/.github/agents/pr-reviewer.md b/.github/agents/pr-reviewer.md index 7b7aaa833195..e217074d939f 100644 --- a/.github/agents/pr-reviewer.md +++ b/.github/agents/pr-reviewer.md @@ -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:** @@ -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** @@ -50,7 +50,7 @@ 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 @@ -58,22 +58,22 @@ Read **[quick-start.md](.github/instructions/pr-reviewer-agent/quick-start.md)** **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 @@ -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.** \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml b/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml index 7363d18deadd..c208eb23d642 100644 --- a/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml +++ b/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml @@ -1,5 +1,45 @@  + xmlns:local="clr-namespace:Maui.Controls.Sample" + Title="TitleView Rotation Test"> + + + + + + + + + \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs b/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs index b7744fa262ea..48958a030d7a 100644 --- a/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs +++ b/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml.cs @@ -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}"; + }); } } \ No newline at end of file