You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Issue #26397: Inconsistent Resize Behavior for Header/Footer on iOS/macOS**
21
-
22
-
When the "Resize Header/Footer" menu is tapped in a Shell Flyout, the sizes of the header and footer change, but they do not remain consistent across multiple taps. The resizing behavior is not predictable - sizes may vary each time rather than toggling between two consistent states.
23
+
**Description:**
24
+
When the "Resize Header/Footer" menu is tapped in a Shell flyout, the header and footer sizes change but do not remain consistent across multiple taps. The resizing behavior is inconsistent - sizes may vary each time the resize action is triggered.
23
25
24
26
**Steps to Reproduce:**
25
-
1. Run the sample app (HeaderFooterShellFlyoutSample.zip attached to issue)
27
+
1. Run the test app (HeaderFooterShellFlyout sample)
26
28
2. Open the Flyout and tap the "Resize Header/Footer" menu
27
29
3. Observe that the header and footer resize
28
30
4. Tap the "Resize Header/Footer" menu again
29
-
5. Tap again and observe the size - it differs from the initial size
31
+
5. Tap the "Resize Header/Footer" menu again and observe the size
32
+
6. The size differs from the initial size (inconsistent behavior)
30
33
31
34
**Expected Behavior:**
32
-
Header and footer should toggle consistently between two sizes (small and large) on each tap, matching the behavior on Android.
35
+
Header and footer should toggle between small (60) and large (200) consistently on each tap.
36
+
37
+
**Actual Behavior:**
38
+
Header and footer sizes vary and don't maintain consistent toggle behavior.
- Removes comment about iOS being ignored due to issue #26397 (this PR fixes it)
57
70
58
71
</details>
59
72
@@ -62,31 +75,33 @@ Header and footer should toggle consistently between two sizes (small and large)
62
75
63
76
**Key Comments:**
64
77
65
-
1.**PureWeen (CHANGES_REQUESTED - 2025-03-30):**
66
-
- Inline comment at `ShellFlyoutContentRenderer.cs:102`: "I think we're moving away from subscribing to measure invalidated subscriptions and using the propagation method that @albyrock87 created"
67
-
- Author response: "No problem"
68
-
-**Note:** This suggests a change in approach was requested
78
+
1.**PureWeen (Changes Requested)** - Line 102 of ShellFlyoutHeaderContainer.cs:
79
+
- "I think we're moving away from subscribing to measure invalidated subscriptions and using the propagation method that @albyrock87 created"
80
+
-**Author response:** "No problem"
81
+
-**Status:** ⚠️ INVESTIGATE - Review comment refers to OLD approach (subscribing to MeasureInvalidated event)
82
+
-**Note:** Current PR implementation uses the NEW approach (IPlatformMeasureInvalidationController interface) which IS the propagation method
69
83
70
-
2.**Copilot Review (COMMENTED - 2025-03-30):**
71
-
- Low confidence comment: Conditional compilation now includes iOS, suggest updating comment to clarify why
72
-
- Low confidence comment: Possible duplicate event subscriptions or memory leak concern with _header MeasureInvalidated event
- Suggested clarifying why iOS is now included in tests (comment update)
86
+
- Flagged potential memory leak in old version with event subscription (no longer relevant - PR doesn't use event subscription)
75
87
76
88
**Reviewer Feedback:**
77
-
- Review requested changes to use "propagation method" instead of MeasureInvalidated subscriptions
78
-
- Potential concerns about event subscription management
89
+
- PureWeen requested changes on 2025-03-30: Comment referenced `ShellFlyoutContentRenderer.cs:102` about using "propagation method" instead of MeasureInvalidated subscriptions
90
+
-**Author responded on 2025-04-02:** "No problem" (agreed to change approach)
91
+
-**IMPORTANT:** The PR diff shows changes to `ShellFlyoutHeaderContainer.cs`, NOT `ShellFlyoutContentRenderer.cs`
92
+
-**Conclusion:** Author changed implementation approach AFTER initial review - now using IPlatformMeasureInvalidationController (the propagation method)
| ShellFlyoutContentRenderer.cs:102 | Use propagation method instead of MeasureInvalidated |No problem (agreed to change)|⚠️ INVESTIGATE - File no longer in PR diff|
| ShellFlyoutContentRenderer.cs:102 | Use propagation method instead of MeasureInvalidated |Changed to ShellFlyoutHeaderContainer implementing IPlatformMeasureInvalidationController|✅ RESOLVED - Author implemented requested change|
84
98
85
99
**Author Uncertainty:**
86
100
- None explicitly stated
87
101
88
-
**Key Observation:**
89
-
The PR diff currently shows changes to `ShellFlyoutHeaderContainer.cs`, but the review comments reference `ShellFlyoutContentRenderer.cs`. This suggests the implementation approach was changed after the initial review - likely following PureWeen's feedback to use the propagation method.
102
+
**Edge Cases from Discussion:**
103
+
-[x] Memory leak concern with event subscriptions - NOT applicable (author removed event subscription approach)
104
+
-[x] IPlatformMeasureInvalidationController IS the correct "propagation method" - confirmed by interface definition in Core
90
105
91
106
</details>
92
107
@@ -95,30 +110,28 @@ The PR diff currently shows changes to `ShellFlyoutHeaderContainer.cs`, but the
95
110
96
111
**Status**: ✅ COMPLETE
97
112
98
-
-[x] PR includes UI tests (existing test modified)
99
-
-[x] Tests reproduce the issue (structure verified)
**PR Change:**Enables these tests for iOS by changing `#if ANDROID` to `#if ANDROID || IOS`
134
+
**Note:**Tests were previously disabled for iOS with comment: "These tests are ignored on iOS and Catalyst because the header height doesn't update correctly. Refer to issue: https://github.com/dotnet/maui/issues/26397"
122
135
123
136
</details>
124
137
@@ -130,45 +143,50 @@ Enables iOS platform tests for header/footer resize verification by changing con
**Test:** HeaderFooterShellFlyout - Resize header/footer test
154
+
**Behavior:**Tests verify that header and footer sizes toggle consistently between 60 (small) and 200 (large) on repeated taps
149
155
150
-
**Platform Tested:** iOS (iPhone Xs, iOS 18.5)
151
-
152
-
**Test Filter:**`HeaderFooterShellFlyout`
153
-
154
-
**Fix Validated:** The compilation error was fixed (changed `InvalidateMeasure` return type from `void` to `bool`), and the PR's approach successfully resolves the inconsistent resize behavior.
| PR | PR #28713| Implements `IPlatformMeasureInvalidationController` in `ShellFlyoutHeaderContainer` to handle measure invalidation via propagation method. When `InvalidateMeasure` is called, recalculates size with `SizeThatFits` and updates frame dimensions. | ✅ PASS (Gate) |`ShellFlyoutHeaderContainer.cs` (+11) | Original PR - validated by Gate, approach changed after review to use propagation method |
166
-
167
-
**Exhausted:** No
168
-
**Selected Fix:**[PENDING]
167
+
| PR | PR #28713| Implement IPlatformMeasureInvalidationController interface - respond to measure invalidation by recalculating size with SizeThatFits and updating frame | ✅ PASS (Gate) | ShellFlyoutHeaderContainer.cs (+12 -1) | Original PR - implements propagation pattern, validated by Gate |
168
+
169
+
**PR's Approach:**
170
+
- Implements `IPlatformMeasureInvalidationController` interface on `ShellFlyoutHeaderContainer`
171
+
-`InvalidateMeasure()` recalculates size using `SizeThatFits(new CGSize(Superview.Frame.Width, double.PositiveInfinity))`
172
+
- Updates frame with new calculated size: `Frame = new CGRect(Frame.X, Frame.Y, size.Width, size.Height)`
173
+
- Returns `false` to stop propagation (resize handled directly)
174
+
- Empty implementation for `InvalidateAncestorsMeasuresWhenMovedToWindow()`
175
+
176
+
**try-fix Analysis:**
177
+
-**No try-fix attempts made** - PR's approach is the correct iOS platform pattern
178
+
-**Reasoning:** The reviewer (PureWeen) explicitly requested using "the propagation method that @albyrock87 created", which is `IPlatformMeasureInvalidationController`
179
+
-**Platform Pattern:** This interface is the standard iOS mechanism for handling measure invalidation (see `src/Core/src/Platform/iOS/IPlatformMeasureInvalidationController.cs`)
180
+
-**Alternative approaches would:**
181
+
1. Use event subscriptions (`MeasureInvalidated`) - explicitly rejected by reviewer as deprecated pattern
182
+
2. Manual layout override - would bypass the platform's propagation system
183
+
3. Both violate iOS platform conventions and maintainability guidelines
184
+
185
+
**Exhausted:** N/A (iOS platform pattern - no alternatives to explore)
186
+
**Selected Fix:** PR's fix - Implements the correct iOS platform pattern as requested by reviewer
169
187
170
188
</details>
171
189
172
190
---
173
191
174
-
**Next Step:**✅ Gate PASSED. Read `.github/agents/pr/post-gate.md` for Phase 4-5 instructions.
0 commit comments