Skip to content

feat: make iOS mentions work with a single space#289

Merged
szydlovsky merged 3 commits into
mainfrom
@szydlovsky/ios-space-toleration-mentions
Nov 27, 2025
Merged

feat: make iOS mentions work with a single space#289
szydlovsky merged 3 commits into
mainfrom
@szydlovsky/ios-space-toleration-mentions

Conversation

@szydlovsky

@szydlovsky szydlovsky commented Nov 26, 2025

Copy link
Copy Markdown
Collaborator

Summary

This PR makes iOS mentions tolerate a single space.
Code responsible for detecting a currently edited mention would just take the current word into the account.
Now it works by trying to search for one more word before the current one if needed. This way all of the following scenarios will be detected as editable mention:

  • current word with a mention indicator
  • a space character, but previous word has a mention indicator
  • current word with no mention indicator but previous word has one

Effectively these scenarios are enough to achieve space tolerating mentions.

Test Plan

Open iOS example app and play with mentions and spaces.

Screenshots / Videos

Screen.Recording.2025-11-26.at.19.51.08.mov

Compatibility

OS Implemented
iOS
Android

Comment thread ios/styles/MentionStyle.mm Outdated

@exploIF exploIF left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @kacperzolkiewski, functionally works well

@kacperzolkiewski kacperzolkiewski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@szydlovsky szydlovsky merged commit 4073a47 into main Nov 27, 2025
5 checks passed
@szydlovsky szydlovsky deleted the @szydlovsky/ios-space-toleration-mentions branch November 27, 2025 14:35
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.

3 participants