fix(iOS): merge inline style with plain text - #722
Merged
kacperzolkiewski merged 1 commit intoJul 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an iOS regression where inline meta-attributes (e.g., bold) could incorrectly “bleed” into adjacent plain text when edits involve replacements/deletions, and adds an E2E flow to validate the behavior.
Changes:
- iOS: restricts attribute-capture logic during
shouldChangeTextInRangeto avoid capturing on deletions. - E2E: adds a Maestro flow reproducing and asserting the inline-style merge scenario via screenshot.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ios/EnrichedTextInputView.mm | Adjusts attribute capture conditions during text replacement to prevent style leakage on iOS. |
| .maestro/enrichedInput/flows/inline_styles_merge.yaml | Adds an automated Maestro flow to reproduce/assert correct inline-style merge behavior. |
Comments suppressed due to low confidence (1)
ios/EnrichedTextInputView.mm:1929
attributesAtIndex:will throw ifrange.locationis out of bounds. Also, when this method returnsNO(e.g. for submit/return handling),_capturedAttributesBeforeChangeis left set and can be incorrectly applied to the next edit indidProcessEditing:. Consider guarding the index and clearing the captured attributes before earlyNOreturns.
// replacement. Only capture for genuine replacements (text.length > 0), not
// for deletions/backspace (text.length == 0).
if (range.length > 0 && text.length > 0) {
_capturedAttributesBeforeChange =
[textView.textStorage attributesAtIndex:range.location
effectiveRange:NULL];
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
szydlovsky
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes merging inline style with plain text.
This regression was introduced in this PR: #551
Test Plan
first linesecondsecondand remove last bolded lettersecondwordScreenshots / Videos
Before:
Screen.Recording.2026-07-23.at.10.25.53.mov
After:
Screen.Recording.2026-07-23.at.10.26.17.mov
Compatibility
Checklist