Page MenuHomePhabricator

[native] Replace chat name with raw chat mention
ClosedPublic

Authored by patryk on Aug 22 2023, 5:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 11:13 PM
Unknown Object (File)
Sun, Dec 15, 6:26 PM
Unknown Object (File)
Sun, Dec 15, 6:26 PM
Unknown Object (File)
Sun, Dec 15, 6:26 PM
Unknown Object (File)
Sun, Dec 15, 6:26 PM
Unknown Object (File)
Sun, Dec 15, 6:26 PM
Unknown Object (File)
Sun, Dec 15, 6:26 PM
Unknown Object (File)
Sun, Dec 15, 6:26 PM
Subscribers

Details

Summary

Solution for ENG-4553 and ENG-4555.

This diff adds support for chats in mentionTypeaheadTooltipActions . Chat entry is encoded in the following convention:

@[[chat_id:default_text]]

Depends on D8908.

Test Plan

Tested later in the stack.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

patryk held this revision as a draft.
patryk edited the test plan for this revision. (Show Details)
patryk added reviewers: tomek, inka, rohan.
patryk edited the summary of this revision. (Show Details)
patryk edited the test plan for this revision. (Show Details)
native/chat/chat-input-bar.react.js
502–517

Needed to refactor this code, because of flow.

599–602

RelativeMemberInfo is wrapped into object, because we need to distinguish user and chat suggestions.

item:
  | { type: 'user', user: RelativeMemberInfo }
  | { type: 'chat', chat: ResolvedThreadInfo },

Will introduce new type, which will be reused in getMentionTypeahead(User/Chat)Suggestions.

Rebase and match new refactored component style

otherwise default_text is rendered.

Can you explain what this means, and point me to where it is done?

In D8909#265267, @inka wrote:

otherwise default_text is rendered.

Can you explain what this means, and point me to where it is done?

It is done by our markdown rules. Second to last sentence in summary is a little bit confusing regarding this diff. Will delete it!

Add read-only type

This revision is now accepted and ready to land.Sep 6 2023, 2:12 AM
native/utils/typeahead-utils.js
71–73 ↗(On Diff #30562)

As mentioned https://phab.comm.dev/D8945#inline-58298 we should extract this to a function

76–87 ↗(On Diff #30562)

Can we avoid duplicating the code?

Extract mention text to separate function and apply DRY rule