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)
Mon, Oct 14, 6:13 PM
Unknown Object (File)
Mon, Oct 14, 12:33 AM
Unknown Object (File)
Sun, Oct 13, 11:39 PM
Unknown Object (File)
Tue, Oct 1, 3:59 AM
Unknown Object (File)
Fri, Sep 27, 6:27 PM
Unknown Object (File)
Fri, Sep 27, 6:27 PM
Unknown Object (File)
Fri, Sep 27, 6:27 PM
Unknown Object (File)
Fri, Sep 27, 6:27 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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #30215)

Needed to refactor this code, because of flow.

599–602 ↗(On Diff #30215)

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