-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for mentions doc] Add "handle" next to display name in report actions #15993
Comments
I don't think the front-end knows whether the domain is a public domain. So I'll need to have the back-end return that in the personal details. |
Actually, that's not true. It's in the |
Hey @puneetlath I can work on a proposal for this issue |
Sounds great @ArekChr! I've updated the mockups and made some slight tweaks to the described behavior based on the discussion in this thread. |
Hey, @puneetlath, I assume this feature is only about displaying handles? Edit: |
Hey @ArekChr that's correct, that will be a separate feature that's currently in planning. For now, we just want to display the handles in the chat header here. |
ProposalPlease re-state the problem that we are trying to solve in this issue.As discussed, we must add a "handle" next to the user's display name in chat messages. The handle should only be displayed when it differs from the user's display name. We must ensure the handle is displayed correctly based on the user's primary login. What changes do you think we should make in order to solve the problem?I propose creating a reusable component called UserHandle that will contain the necessary logic to display the handle. This component will accept a user object and return the formatted user name with the handle. To summarize, I will use the following logic for displaying the handle:
|
Job added to Upwork: https://www.upwork.com/jobs/~01901c3233ac120b6f |
Triggered auto assignment to Contributor Plus for review of internal employee PR - @Santhosh-Sellavel ( |
@ArekChr given that the handle is just text, why create a component rather than just a function that returns the text for the handle? Not opposed to a component, just want to understand the reasoning. |
@puneetlath, I assumed that this component would be designed for reuse in both the chat message body and header sections, with a component as its main building block. This would allow for different styles to be applied using a single property, such as the "variant" property, which could take values like "chat", "profile", and more. For instance, if the "chat" variant were used, the handle would have a blue background, while the "profile" variant would make it grey. This approach offers a simpler component from the outside since styling does not need to be set externally when reusing it. Instead, it is defined once inside and can be easily reused with different styles by passing the appropriate variant as a property. For example: Alternatively, I could create a function that returns the handle string, which would require passing the string inside a component and styling it externally using StyleUtils. However, this approach would require us to remember to use both the StyleUtils and the function that generates the handle each time it is used in the code. An additional advantage of the first reusable component is that it allows for separate testing of the function that generates the handle, the component that displays the specific element, and the colours for particular variants. In both cases, the handle still needs to be passed into the text component because it will always have different styles to distinguish it from the rest of the text (in a chat message or next to the display name). That's why I assumed it could be a component which has more advantages, IMO. What do you think about these options? |
Got it! I think you are right that this will be a better approach when we are using the handle in more places. However, our general approach is to go with the simplest solution for our needs now, then refactor to make it more DRY as more use-cases come up. So I think it's better for us to go with a function that returns text for now. And then when we figure out where else we want to display the handle, we can evaluate creating a component and moving the function's logic there. |
Sure, I will go with the general approach! Can I start working on PR? |
Yes, go ahead! |
How's this one going @ArekChr? |
Hey, @puneetlath, I didn't get a chance to focus on the handle last week as I had other things that needed my attention. However, I am available and ready to continue working on this task. |
Hey @puneetlath, I will PR is almost ready. I will do a self-review and improve the code, plus I will also include more test cases, and then I will open this PR. |
Hey, from Callstack - expert contributor group, I can continue since @ArekChr is on sick leave |
@gedu sounds good. We had actually put this PR on hold and were discussing in this design doc. Would you mind responding to the comment I tagged you in? |
Sorry, I think I missed the notification, we are discussing internally and will back to you if I will take it |
I'm going to go ahead and close this for now. I'll open a fresh issue when the design doc has been updated and we're ready to implement. |
As discussed here, we would like to add "handles" next to the display name in chat messages. It is the
@amy
style text that is to the right ofAmy Evans
name in the mockup.The handles would be displayed with the following logic:
The general logic for how we want to display the handle is laid out in pseudocode here:
In words:
@
symbol@9765473456
)@[email protected]
)@[email protected]
)@bob
)Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: