Skip to content

fix(android): combining inline styles - #747

Open
hejsztynx wants to merge 3 commits into
mainfrom
@ksienkiewicz/fix-android-inline-styles-combining
Open

fix(android): combining inline styles#747
hejsztynx wants to merge 3 commits into
mainfrom
@ksienkiewicz/fix-android-inline-styles-combining

Conversation

@hejsztynx

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes two bugs regarding inline styles on Android

  1. The inline code style was overwriting bold and italic inline styles, as it was switching to monochrome font, and resetting other inline styles by doing that
  2. When applying an inline style with the same style present two characters later, they were incorrectly merged

Test Plan

You can walk-through the test cases in the attached videos below

Screenshots / Videos

  1. bold and italics disappearing in inline code

Before:

Screen.Recording.2026-08-05.at.22.06.07.mov

After:

Screen.Recording.2026-08-05.at.21.54.11.mov
  1. inline styles incorrectly merging

Before:

Screen.Recording.2026-08-05.at.22.06.39.mov

After:

Screen.Recording.2026-08-05.at.21.54.45.mov

Compatibility

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Copilot AI review requested due to automatic review settings August 5, 2026 20:12

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.

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>
@hejsztynx hejsztynx changed the title @ksienkiewicz/fix android inline styles combining fix(android): combining inline styles Aug 5, 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.

2 participants