Skip to content

Raise TextChanged once when TextTransform changes typed text - #40736

Closed
kubaflo wants to merge 14 commits into
mainfrom
fix-30084-texttransform-textchanged
Closed

kubaflo wants to merge 14 commits into
mainfrom
fix-30084-texttransform-textchanged

Conversation

@kubaflo

@kubaflo kubaflo commented Nov 27, 2026

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!

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

Description of Change

With TextTransform="Uppercase" on an Entry, Editor or SearchBar, typing a lowercase letter raised TextChanged twice: once with the raw input and again when the platform echoed the transformed text. Text coming from the platform is now transformed before it's set, so TextChanged fires once, with the transformed text.

Issues Fixed

Fixes #30084

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, the agent opens a follow-up PR that keeps your commits.

Fixes #30084

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 17:59
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 27, 2026 17:59 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@kubaflo

kubaflo commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

@dalexsoto stamp

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 27, 2026 18:00 — with GitHub Actions Inactive
@github-actions github-actions Bot added the s/autopilot-running MAUI Autopilot loop is running; remove this label to stop it label Nov 27, 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 Nov 27, 2026
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 27, 2026 18:01 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 27, 2026 18:03 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 27, 2026 18:04 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 27, 2026 18:04 — with GitHub Actions Inactive

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.

🟡 Changes recommended

Input normalization changes secure-field passwords and can leave native text out of sync when the transformed value matches the stored value.

2 open issues
What changed in this PR

This PR addresses #30084 by normalizing platform-originated text in the shared InputView setter, aiming to prevent duplicate TextChanged events in Entry, Editor, and SearchBar.

Changes:

  • Applies TextTransform before storing handler-originated text, while preserving handler setter priority.
  • Adds a comment explaining how early transformation avoids duplicate notifications.
File Description
src/​Controls/​src/​Core/​InputView/​InputView.cs Transforms incoming text before setting TextProperty and documents the intended event behavior.

Review effort: Balanced

dalexsoto
dalexsoto previously approved these changes Nov 27, 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.

@github-actions github-actions Bot 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.

Expert Review — 3 findings · ⚠️ 1 breaking change

Reviewed commit 1bcdec5.

Warning

Existing apps would look or behave differently without opting in. See the Behavioral Change Disclosure findings at:

See inline comments for details.

@github-actions github-actions Bot added s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) and removed s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress labels Nov 27, 2026
@github-actions github-actions Bot mentioned this pull request Nov 27, 2026
github-actions Bot and others added 3 commits November 27, 2026 18:39
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 18:47
@github-actions github-actions Bot added s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress and removed s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) labels Nov 27, 2026
@github-actions github-actions Bot added the s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress label Nov 27, 2026

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.

🔵 Needs a closer look

Cross-platform input normalization affects native callback ordering, secure input, and caret/IME behavior, requiring device-level validation not supplied in this review.

No open issues 🎉

Review effort: Balanced

@github-actions github-actions Bot 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.

Expert Review — 3 findings · ⚠️ 2 breaking changes

Reviewed commit c57eb2d.

Warning

Existing apps would look or behave differently without opting in. See the Behavioral Change Disclosure findings at:

See inline comments for details.

@github-actions github-actions Bot added s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) s/autopilot-retrying maui-expert-autopilot: retrying a step that failed once and removed s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress s/autopilot-running MAUI Autopilot loop is running; remove this label to stop it s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) s/autopilot-retrying maui-expert-autopilot: retrying a step that failed once labels Nov 27, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the s/autopilot-needs-maintainer-decision MAUI Autopilot stopped: a maintainer needs to decide how to continue label Nov 27, 2026
kubaflo added a commit that referenced this pull request Nov 28, 2026
…from Azure DevOps, back off on rate limits (#40750)

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

### 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).

Repository infrastructure. Agentic workflows run from the default
branch, so it targets `main`.

### Description of Change

**1. UI test screenshots from Azure DevOps.** When a UI test fails on a
screenshot (`Baseline snapshot not yet created` or `Snapshot different
than baseline`), the round now downloads the new screenshot from the
build's `uitest-snapshot-results-*` artifact and maps it to its baseline
path. If the PR causes the visual change (the triage says `related`),
the round commits the screenshot as the baseline. It never updates a
baseline for an unrelated failure.

Example from build 1703227:

| Test | Environment | Baseline | Baseline path |
|---|---|---|---|
| `NavigationPageChildContentExtendsUnderFloatingTabBar` | `ios-26` |
changed |
`src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/NavigationPageChildContentExtendsUnderFloatingTabBar.png`
|

**2. Back off on Copilot API rate limits.** On #40736 the fix round
failed twice in a row on `429 Too Many Requests`: the automatic retry
fired immediately and hit the same limit. When the agent fails with a
429, the retry now waits 15 minutes, and the **Stopped** comment says it
was the rate limit.

**3. Merge conflicts are resolved** (like #39487). A conflicting PR
(`mergeable: false`) gets a `conflicts` round first. Setup applies the
PR's net change onto the base tip on `autopilot/pr-<n>` (`git merge
--squash`). `PublicAPI.Unshipped.txt` conflicts are resolved
deterministically (base entries, plus the PR's added ones, minus its
removed ones); the agent resolves code conflicts. The result is one
commit by the PR's author and is published as an `[autopilot]` follow-up
PR; the loop moves there.

Why not a merge commit on the PR branch: it would bring in every file
`main` changed since the PR's base. gh-aw's allowed-files check rejects
that, and `GITHUB_TOKEN` can't push merges that include
`.github/workflows` changes, which `main` has almost daily. Both would
need a GitHub App token. The rebased commit only touches the PR's own
files.

**4. Follow-up PR branch names are kept** (`preserve-branch-name:
true`). gh-aw otherwise adds a random suffix, and `next_round` couldn't
find `autopilot/pr-<n>` to move the loop there.

#### Validation

- Conflicts setup, run on #39487's real branches: one commit by
`Dhivya-SF4094` on top of `main`, merges cleanly with `main`, its diff
against `main` is exactly the PR's 15 files, and the two
`PublicAPI.Unshipped.txt` conflicts are combined.
- Fork [kubaflo#993](kubaflo#993) (a
code conflict): the round detected the conflict, rebased, and the agent
resolved and committed it. Opening the follow-up PR can't be tested on
the fork because its sandbox branches share no history with the fork's
`main`; #39487 will test it here. The fork run also surfaced two bugs,
both fixed: `git merge --squash` needed a git identity, and a conflicts
round that published nothing would repeat.

- The new evidence step, run locally against build 1703227 (a real
`Snapshot different than baseline` failure): it downloaded the artifact
anonymously and produced the table above.
- `gh aw compile maui-expert-autopilot`: passed; embedded scripts parse.

### Issues Fixed

None.

### 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, the agent opens a follow-up PR that keeps your commits.

---------
@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 Nov 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

MAUI Autopilot — Started

Models
  • Review: GPT-6.1 Sol (MAUI expert reviewer)
  • Fix: GPT-6.2 Sol, MAI Code 2 and Claude Opus 5.5 fix independently, then cross-examine each other; the best fix is kept
  • Test selection: GPT-6.2 Sol and MAI Code 2
Info
Label Meaning
s/autopilot-reviewing The MAUI expert reviewer is reviewing the PR
s/autopilot-fixing Fixing review findings or failing tests
s/autopilot-testing Running the relevant UI and device tests
s/autopilot-waiting-for-maintainer-review Review clean and tests passed
s/autopilot-needs-maintainer-decision The loop stopped; a maintainer decides how to continue

@github-actions github-actions Bot added s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) and removed s/autopilot-needs-maintainer-decision MAUI Autopilot stopped: a maintainer needs to decide how to continue labels Nov 29, 2026
github-actions Bot and others added 3 commits November 29, 2026 17:54
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 29, 2026 18:05

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.

🟡 Changes recommended

Even no-op appended or prepended Text hooks disable normalization and cause duplicate Android TextChanged events, requiring wrapper-aware mapping detection and regression coverage for both hook types.

1 open issue

Review effort: Balanced

Comment on lines +381 to +383
(Entry, IEntryHandler) => mapping == Entry.DefaultTextMapping || mapping == EntryHandler.BuiltInTextMapping,
(Editor, IEditorHandler) => mapping == Editor.DefaultTextMapping || mapping == EditorHandler.BuiltInTextMapping,
(SearchBar, ISearchBarHandler) => mapping == SearchBar.DefaultTextMapping || mapping == SearchBarHandler.BuiltInTextMapping,
github-actions Bot added a commit that referenced this pull request Nov 29, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot removed s/autopilot-running MAUI Autopilot loop is running; remove this label to stop it s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) labels Nov 29, 2026
@kubaflo kubaflo closed this Nov 30, 2026
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.

InputView with TextTransform="Uppercase" triggers TextChanged twice per character

3 participants