fix(ios): conflicting styles in typing attributes not correctly detected - #770
Open
hejsztynx wants to merge 3 commits into
Open
fix(ios): conflicting styles in typing attributes not correctly detected#770hejsztynx wants to merge 3 commits into
hejsztynx wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an iOS editor edge case where paragraph-style conflict detection missed conflicts that exist only in UITextView.typingAttributes (e.g., when applying codeblock to a whole paragraph while the conflicting style is only present at the caret).
Changes:
- Updates conflict/block detection to optionally fall back to
detect:at the caret when the caret is inside the target range andany:finds no conflicts. - Refactors the style-presence check into a single
presentboolean to reduce branching.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
hejsztynx
marked this pull request as ready for review
August 13, 2026 16:09
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
There was a bug which you can see in the attached video below. The issue was that when applying
codeblockstyle, we apply it to a whole paragraph, and during this process we look for conflicting styles in the paragraph's range. The problem is, we don't look at current typing attributes for conflicting styles, as there is a case when:The implemented fix is minimal, as I didn't want to tamper with current logic - that's why we catch that specific case with an
if.I've run the e2e tests, everything passes.
Test Plan
Reproduce the bug from the attached video, play around with toggling different styles.
Screenshots / Videos
Before:
Screen.Recording.2026-08-13.at.10.29.46.mov
After:
Screen.Recording.2026-08-13.at.13.47.20.mov
Compatibility
Checklist