ui-common: Ignore mention suggestions that start with whitespace#6526
ui-common: Ignore mention suggestions that start with whitespace#6526gpunto wants to merge 1 commit into
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesTyping suggester whitespace handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
andremion
left a comment
There was a problem hiding this comment.
LGTM!
One thing on cross-SDK parity: No iOS SDK has this leading-whitespace guard. Looks like the same bug exists on iOS. Should we file equivalent fixes on iOS so the behavior stays aligned?
Minor, not blocking: the Android check uses isWhitespace() (covers tabs and other Unicode whitespace), while iOS only treats " " and "\n" as separators. That difference is pre-existing, just noting it in case we want the platforms to classify edge inputs the same way.



Goal
In the message composer, typing
@followed by spaces keeps the mention suggestion active with a whitespace-only query, which makes the group/role lookup return everything.TypingSuggester.typingSuggestionlets a suggestion token start with whitespace, so@produces a" "query that is forwarded to the lookup. The fix rejects suggestions that start with whitespace, while still allowing internal spaces so multi-word names (e.g.@John Doe) remain searchable.Closes AND-1268
Implementation
TypingSuggesternow returns no suggestion when the token starts with whitespace. Internal and trailing spaces are still part of the token, so multi-word names keep working.Testing
TypingSuggesterTest: empty token, single-word and mid-text tokens, multi-word and trailing-space tokens, and the leading-whitespace cases that now produce no suggestion.Summary by CodeRabbit