Skip to content

[iOS] Keep compatibility renderer targets stable during context menus - #41195

Merged
kubaflo merged 2 commits into
mainfrom
fix/ios-compat-context-flyout
Dec 3, 2026
Merged

kubaflo merged 2 commits into
mainfrom
fix/ios-compat-context-flyout

Conversation

@kubaflo

@kubaflo kubaflo commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: cefdfbd8a1cc0be652410d6ff60c58bfb23e3675

Dimension Assessment Rationale
Change confidence 9/10 ↑ Filters only views inserted during native presentation and reuses the weak table as the marker
↓ UIKit implementation differs by OS
Diagnosis confidence 9/10 ↑ Instrumentation identified the UIKit sibling and the interaction-count difference
Evidence fit 9/10 ↑ All four selected MenuFlyout rows passed on the updated revision
↓ CI uses iOS 27.2 rather than 27.1

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!

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

For .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into net11; agents must not retarget or merge.

Description of Change

Keep transient UIKit menu presentation subviews from becoming the compatibility renderer's PlatformView. c950332974 (#40439) introduced both programmatic cases. The native menu button inserts an additional UIKit sibling when it opens; the compatibility renderer's existing filter only excludes MAUI's own presenter views. On iOS 27.1 that sibling became the renderer’s target, and it could still be present when the menu was replaced. Track the views inserted by native presentation weakly, for their lifetime, without relying on private UIKit class names or owning their removal. Reuse the weak table itself as the marker, matching the existing iOS long-press recognizer pattern.

The separate interaction-count failure was a stale expectation: 873c706238 (#40482) added native iOS interactions when the mobile feature is enabled. Replacing a flyout must remove its programmatic presenter while retaining the platform context-menu interaction on supported configurations.

Validation: iPhone Duo simulator on iOS 27.1, CoreCLR; the CI lane used iOS 27.2.

selectors='Microsoft.Maui.DeviceTests.ButtonTests.ImageAndTextGroupHonorsAlignmentMapperCustomization,Microsoft.Maui.DeviceTests.ButtonTests.ImageAndTextGroupPreservesUnsetAlignmentAxis,Microsoft.Maui.DeviceTests.ButtonTests.ImageAndTextGroupRendersAtRequestedAlignment,Microsoft.Maui.DeviceTests.AccessibilityTests+InNewWindowCollection.ValidateIsImportantForAccessibility,Microsoft.Maui.DeviceTests.ContextFlyoutTests.ProgrammaticCompatibilityMenuCanReplaceAndActivate,Microsoft.Maui.DeviceTests.ContextFlyoutTests.ProgrammaticPresenterRemovedOnFlyoutChange'
menu='Microsoft.Maui.DeviceTests.ContextFlyoutTests.ProgrammaticCompatibilityMenuCanReplaceAndActivate,Microsoft.Maui.DeviceTests.ContextFlyoutTests.ProgrammaticPresenterRemovedOnFlyoutChange,Microsoft.Maui.DeviceTests.ContextFlyoutTests.ProgrammaticNativeMenuReopensAfterNativeDismissal'
  • pwsh -NoProfile -File .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -DeviceUdid BF9ED2ED-8DA6-40F2-A979-A3698BA8BF36 -IncludeMethods "$selectors" -Timeout 00:25:00 -OutputDirectory "$PWD/.local-temp/ios-baseline" — two MenuFlyout failures, one pass.
  • pwsh -NoProfile -File .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -DeviceUdid BF9ED2ED-8DA6-40F2-A979-A3698BA8BF36 -IncludeMethods "$selectors" -Timeout 00:25:00 -OutputDirectory "$PWD/.local-temp/ios-fixed2" — all three MenuFlyout rows passed, including replacement and action activation; the two remaining failures were Button cases outside this PR.
  • pwsh -NoProfile -File .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios -DeviceUdid BF9ED2ED-8DA6-40F2-A979-A3698BA8BF36 -IncludeMethods "$menu" -Timeout 00:25:00 -OutputDirectory "$PWD/.local-temp/ios-menu-marker" — 4 passed, 0 failed, 0 skipped on the updated PR revision, including native dismissal and reopening.

Issues Fixed

Reported by .NET MAUI device-test build 1707231.

Let AI finish this PR

  • Let the MAUI agent address review feedback and fix remaining issues on this PR. Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo

kubaflo commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@dalexsoto stamp

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

dalexsoto
dalexsoto previously approved these changes Dec 3, 2026

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stamping as requested by @kubaflo; no code review performed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/autopilot-running MAUI Autopilot loop is running; remove this label to stop it label Dec 3, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress label Dec 3, 2026
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@github-actions github-actions Bot added the s/autopilot-rate-limited MAUI Autopilot: waiting for the Copilot API rate limit to clear label Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

MAUI Autopilot — Waiting for the Copilot API rate limit

@kubaflo The MAUI expert review hit the Copilot API rate limit (429). The loop tries again every 15 minutes, for up to 6 hours after it started. Run.

Error
safe_outputs: Unable to download artifact(s): Artifact not found for name: expert-results-47218571510
safe_outputs: No files were found with the provided path: /home/runner/work/_temp/expert-publication/publication.json

@kubaflo

kubaflo commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@dalexsoto stamp

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stamping as requested by @kubaflo; no code review performed.

@kubaflo
kubaflo merged commit 629992b into main Dec 3, 2026
24 of 42 checks passed
@kubaflo
kubaflo deleted the fix/ios-compat-context-flyout branch December 3, 2026 23:41
@kubaflo kubaflo removed s/autopilot-running MAUI Autopilot loop is running; remove this label to stop it s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress s/autopilot-rate-limited MAUI Autopilot: waiting for the Copilot API rate limit to clear labels Dec 4, 2026
kubaflo added a commit that referenced this pull request Dec 4, 2026
… resume (#41220)

<!-- copilot-assessment:v1 -->
### Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: `2277fc6429ef728d0c7a72021cac627685b9473b`

| Dimension | Assessment | Rationale |
|---|---|---|
| Change confidence | 9/10 | ↑ Only the runner of the two jobs that hold
the 15-minute waits changes; both keep `timeout-minutes: 25`.<br>↑ gh-aw
compiled both workflows; each lock changes only that runner and its
metadata hash.<br>↓ No live rate-limit wait has run on the new runner
yet. |
| Diagnosis confidence | 9.5/10 | ↑ All five rate-limited loops' wait
jobs ended `cancelled` 15:00–15:03 after starting, despite
`timeout-minutes: 25`.<br>↑ GitHub documents that ubuntu-slim jobs are
limited to 15 minutes of execution time. |
| Evidence fit | 9.5/10 | ↑ #41188, #41182 and #41183 are still open
with `s/autopilot-rate-limited`, and no Autopilot run has picked them up
since; #41204 and #41195 merged with the same stale labels. |
<!-- /copilot-assessment -->

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

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

<!-- Enter description of the fix in this section -->

When the expert review or a fix round hits the Copilot API rate limit
(or a ghcr.io outage), the job labels the PR `s/autopilot-rate-limited`,
waits 15 minutes, and dispatches the next round. Both jobs that hold
that wait run on `ubuntu-slim`, which [ends every job at 15
minutes](https://github.blog/changelog/2026-01-22-1-vcpu-linux-runner-now-generally-available-in-github-actions/).
The wait starts after the job's own work, so the runner cancels it
before the dispatch, and the loop silently stalls.

On 2026-12-03 this stalled all five rate-limited loops. In expert runs
[47218604696](https://github.com/dotnet/maui/actions/runs/47218604696)
(#41188),
[47218665214](https://github.com/dotnet/maui/actions/runs/47218665214)
(#41182),
[47218667908](https://github.com/dotnet/maui/actions/runs/47218667908)
(#41183),
[47218477536](https://github.com/dotnet/maui/actions/runs/47218477536)
(#41204) and
[47218571510](https://github.com/dotnet/maui/actions/runs/47218571510)
(#41195), `autopilot_failed` ended `cancelled` 15:00–15:03 after it
started. All five PRs still carry `s/autopilot-running`.

This moves `autopilot_failed` (copilot-review-expert) and `next_round`
(maui-expert-autopilot), the only jobs with the 15-minute wait, to
`ubuntu-latest`. Their existing 25-minute timeouts already cover the
wait. Nothing else changes.

Validation: `gh aw compile maui-expert-autopilot copilot-review-expert
--no-check-update` (v0.86.2) passed with the existing warnings; each
lock diff is the runner line plus its metadata hash; `git diff --check`
passed. No live dispatch was run.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Observed on #41188, #41182, #41183, #41204 and #41195.

### Let AI finish this PR

- [ ] **Let the MAUI agent address review feedback and fix remaining
issues on this PR.** Maintainers still decide whether it is merged. For
PRs from forks, keep "Allow edits by maintainers" on so the agent can
push to your branch; otherwise it opens a follow-up PR that keeps your
commits.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants