fix(android): combining inline styles - #747
Open
hejsztynx wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses two Android-specific inline styling bugs in the enriched text input: (1) inline code styling was resetting other active inline styles (bold/italic) by forcing a normal monospace typeface, and (2) span merging logic was incorrectly considering a “next” span starting two characters later, leading to unintended merges.
Changes:
- Preserve existing bold/italic style when switching text rendering to monospace for inline code spans.
- Fix inline span merge adjacency detection by adjusting the “next span” probe range to check the immediate boundary.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| android/src/main/java/com/swmansion/enriched/textinput/styles/InlineStyles.kt | Adjusts next-span lookup so merging considers the immediately adjacent span boundary (fixes incorrect merges). |
| android/src/main/java/com/swmansion/enriched/common/spans/EnrichedInlineCodeSpan.kt | Preserves current typeface style when applying monospace to avoid overwriting bold/italic for inline code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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 two bugs regarding inline styles on Android
Test Plan
You can walk-through the test cases in the attached videos below
Screenshots / Videos
Before:
Screen.Recording.2026-08-05.at.22.06.07.mov
After:
Screen.Recording.2026-08-05.at.21.54.11.mov
Before:
Screen.Recording.2026-08-05.at.22.06.39.mov
After:
Screen.Recording.2026-08-05.at.21.54.45.mov
Compatibility
Checklist