Skip to content

Suggest an org's members when you type @ in its thread - #125

Merged
simonhamp merged 1 commit into
NativePHP:mainfrom
rohitsasi720:feat/remotes-member-mentions
Oct 29, 2026
Merged

simonhamp merged 1 commit into
NativePHP:mainfrom
rohitsasi720:feat/remotes-member-mentions

Conversation

@rohitsasi720

@rohitsasi720 rohitsasi720 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Typing @ in an org thread's message field now lists the org's members above the field, as the web does, and typing on filters them. Closes #124.

How it works. The org thread devnull already sends includes its members, so, like the web's mention-textarea with members, the app filters them locally and never asks devnull. The message field reports its caret (@selectionChange), and SuggestsMentions finds the @handle right before it using the web's mentionBeforeCaretPattern, so an @ in an email address or a URL doesn't count, and neither does a selection. The ranking is the web's: exact handle, then handle prefix, then name prefix, then the rest. Within each rank, people you follow come first, then handles in order, six at most. A bare @ puts them under "Members".

Picking one replaces only the token with @handle, adding a space unless one already follows, so the text on both sides stays. It respects the 2,000-character limit the way the web does. The draft is bound with a 150ms debounce, so a pick only goes in while the draft still has the token where the caret found it. Otherwise it does nothing, rather than inserting a stale mention.

The list gets a keyed slot above the reply strip that is always there and empty when unused, like the reply and photo slots. Android then never rebuilds the field's row, and the keyboard stays up. On iOS it sits on its own glass, like the reply strip. One-to-one threads are unchanged: the caret handler returns before suggesting anything.

Things to look at:

  • Backend gap. The signed API's OrgThreadResource drops the suggests_mentions and is_followed flags that ConversationThreadQuery::org() works out for the web. Thread now reads both when present. Until the API sends them, the app leaves you out of the list but can't leave out people you've muted or blocked, or put people you follow first. A small backend PR adding those two fields to the API's members would close that.
  • Device coverage. Checked on a Pixel 9 only: the list shows on @ in a 94-member org, and picking "@ka" gives hi @KaitoMuraoka with the cursor at the end and the keyboard up. iOS is unchecked, because there was no simulator on this machine. The keyboard is down in the after shots because the screenshot command's dark-mode switch closed it.
  • Order. Handles are compared case-sensitively, as the web's JS < does, so capitalised handles sort first.

ConversationTest covers the list opening on @ and closing when the caret leaves, the ranking and the six-member cap, leaving out you and anyone devnull flags, nothing in one-to-one threads, emails, URLs and selections, insertion at the end, mid-draft after an emoji and mid-word, and a stale pick.

Screenshots

org-thread (with @ typed in the "Mobile app testers" org)

iOS light iOS dark Android light Android dark
Before
After

No iOS shots: there's no iOS simulator on this machine.

  • No visible change

Typing "@" in an org thread's message field lists the org's other members
above the field, as the web does, and typing on filters them with the web's
ranking. Tapping one puts "@handle " in place of what was typed.

Closes NativePHP#124.
@rohitsasi720
rohitsasi720 force-pushed the feat/remotes-member-mentions branch from aa963c0 to 894e459 Compare October 28, 2026 20:28
@LeonKunze

Copy link
Copy Markdown

It Works for me on IOS and here are some screenshots as well

ios-light-after ios-dark-after

@simonhamp

Copy link
Copy Markdown
Member

beautiful 🙏🏼

@simonhamp
simonhamp merged commit 1e8371f into NativePHP:main Oct 29, 2026
3 checks passed
simonhamp added a commit that referenced this pull request Oct 29, 2026
Brings in voice notes (#128) and member mentions (#125). The conflicts
were both sides adding to the same lists: Lucide icons, plugins, Composer
requirements and the end of ConversationTest. The lock is main's plus the
clipboard plugin, with mobile-ui moved one commit on to 583bbc5, the merge
of NativePHP/mobile-ui#188.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

Suggest org members when typing @ in a Remotes org thread

3 participants