Repository navigation
Description
Summary
In an org (group) Remotes thread on the web, typing @ in the message field lists the org's members to mention, and typing more filters them. The app's message field has nothing: you have to type the whole handle yourself.
Seen on Android (Pixel 9) on current main. iOS draws the same view.
Reproduction
- Open an org thread in Remotes.
- Tap into the message field and type
@, then a few letters of a member's handle or name. - No suggestions appear.
How the web does it
resources/js/components/mention-textarea.tsx, with members passed in from the org thread, filters those members locally, without asking the server:
- The token is the
@handleright before the caret:/(?:^|[^\p{L}\p{N}_./@-])@([A-Za-z0-9][A-Za-z0-9-]{0,38}|)$/u. An@inside an email address or URL doesn't count. - It keeps members whose handle or name contains the query, ranked: exact handle, then handle prefix, then name prefix, then the rest. Within each rank, people you follow come first, then handles alphabetically. It shows at most 6.
- A bare
@lists the members under a "Members" heading. - Picking one replaces only the token with
@handle, adding a space unless one already follows. - Only members with
suggests_mentionsare listed: never yourself, and nobody you've muted or blocked.
What the app has
The org thread the app loads (GET /api/v1/remotes/orgs/{org}) already includes members, so the app can do this locally as the web does. No new endpoint is needed (unlike #78, which needs one for the post and reply composer).
One gap: the signed API's OrgThreadResource drops the suggests_mentions and is_followed flags that ConversationThreadQuery::org() works out for the web. Until it sends them, the app can leave you out of the list itself, but it can't leave out people you've muted or blocked, or put people you follow first. A small backend companion should add those two fields to the API's members.
Expected
- Typing
@in an org thread's message field lists the org's members above the field, and typing more filters the list, following the web's rules above. - Tapping a member puts
@handlein place of what you typed, keeping the text on both sides, the reply target and any attached photos. - Moving the caret away from the token, or deleting it, closes the list.
- One-to-one threads are unchanged.
Related: #78 (mentions in the post and reply composer, which excludes Remotes).
Activity
Suggest an org's members when you type @ in its thread
Suggest an org's members when you type @ in its thread (NativePHP#125)