Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.34k stars 2.77k forks source link

[HOLD for payment 2023-12-20] [$500] Room - Long workspace name is not truncated in workspace selection page during room creation #32384

Closed lanitochka17 closed 9 months ago

lanitochka17 commented 9 months ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.7-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:

Action Performed:

Precondition: Have a long workspace name

  1. Go to staging.new.expensify.com
  2. Click + > New chat > Room
  3. Click Workspace

Expected Result:

Long workspace name will be truncated

Actual Result:

Long workspace name is not truncated

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/2efdd910-ad58-4d70-9666-3aba6be49cbc

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cf730d76f7807ef8
  • Upwork Job ID: 1730706237151584256
  • Last Price Increase: 2023-12-01
  • Automatic offers:
    • s77rt | Reviewer | 27955714
    • abzokhattab | Contributor | 27955717
melvin-bot[bot] commented 9 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01cf730d76f7807ef8

melvin-bot[bot] commented 9 months ago

Triggered auto assignment to @NicMendonca (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 9 months ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 9 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (External)

abzokhattab commented 9 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Long workspace name is not truncated in workspace selection page during room creation

What is the root cause of that problem?

  1. the workspace field uses the ValuePicker component to render items selections:

https://github.com/Expensify/App/blob/d181fd7ed23427f01d591a8302e46cb79e2dadb0/src/pages/workspace/WorkspaceNewRoomPage.js#L217-L223

  1. The ValuePicker relies on ValueSelectorModal, which, in turn, uses a selection list to render items.

https://github.com/Expensify/App/blob/d521dd6783c382297e06a429701ae1936f808041/src/components/ValuePicker/ValueSelectorModal.js#L67-L72

  1. The selection list uses BaseSelectionList with a renderItem function, which employs BaseListItem to render each item. https://github.com/Expensify/App/blob/6cf91f61cb339c984b1a97ff79af8659ccef128f/src/components/SelectionList/BaseSelectionList.js#L303-L313

  2. the BaseListItems uses RadioListItem in our case: https://github.com/Expensify/App/blob/de53c93cedbc0a261fe28909e68a1a928602052a/src/components/SelectionList/BaseListItem.js#L32

  3. The RadioListItem sets the text styles for the displayed items. https://github.com/Expensify/App/blob/d521dd6783c382297e06a429701ae1936f808041/src/components/SelectionList/RadioListItem.js#L12-L15

The problem arises because the Text component used in RadioListItem does not have the styling needed to truncate item labels.

What changes do you think we should make in order to solve the problem?

since there is no tooltip in the /settings/workspaces list page, then we dont need to enable the tooltip here, we only need to truncate the text by changing the style to:

   <Text
                style={[styles.optionDisplayName, isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText, item.isSelected && styles.sidebarLinkTextBold, styles.pre]}
                numberOfLines={1}
            >

POC:

image

Note: if we dont want to apply this truncation on every selection list then we can create a new boolean prop truncateText in the selectionList and set it to true whenever we want to truncate any list

DylanDylann commented 9 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

What is the root cause of that problem?

What alternative solutions did you explore? (Optional)

Result:

Screencast from 02-12-2023 11:08:50.webm

ishpaul777 commented 9 months ago

I reported this as bug when bugs were accepted from contributors but this was never logged to GH, @NicMendonca Can you check on slack this will be the last bug report from @ishpaul in #expensify-bugs channel and add me as reporter

s77rt commented 9 months ago

@abzokhattab Thanks for the proposal. Your RCA is correct. Limiting the number of lines (i.e. numberOfLines={1}) makes sense to me. However you also mentioned the need to change the style (adding styles.pre). Can you please elaborate why this is needed?

DylanDylann commented 9 months ago

@s77rt Should we need to display the full name once user hover over the ellipsis like we did in other sections?

s77rt commented 9 months ago

@DylanDylann Thanks for the proposal. Your RCA is correct. Regarding the tooltip, is there a specific reason to use <DIsplayNames /> instead of just <Tooltip />?

DylanDylann commented 9 months ago

@s77rt The DisplayName component have been used in a lot of sections in our app, so I think we should use it for consistency and reducing the duplicate logic

abzokhattab commented 9 months ago

However you also mentioned the need to change the style (adding styles.pre). Can you please elaborate why this is needed?

Correct the pre style is not needed to make it work but I added it to make it consistent with the DisplayNamesWithoutTooltip component:

https://github.com/Expensify/App/blob/d521dd6783c382297e06a429701ae1936f808041/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx#L17-L27

pre styling is used for border styling, background color, padding, a monospace font, and removes any margins from the top and bottom of the text block

if we are okay with that an alternative would be to use DisplayNamesWithoutTooltip, but i didn't want to change the Text component to ensure backward combinability and avoid potential regressions so again its not needed

s77rt commented 9 months ago

@DylanDylann For this issue I don't think using DisplayNames is a critical factor for proposal selection since we are still dealing with the same solution (which is to add numberOfLines prop). Also RadioListItem is a core component where it could be better not to use DisplayNames since it involves unnecessary logic. One last argument is that RadioListItem is a generic component where DisplayNames is only designed for accounts.

s77rt commented 9 months ago

@abzokhattab I think we can keep the styles.pre not to collapse multiple whitespaces and to be consist with the selected value

Selected value:

Screenshot 2023-12-02 at 8 40 01 PM

RadioListItem without styles.pre

Screenshot 2023-12-02 at 8 40 44 PM

RadioListItem with styles.pre

Screenshot 2023-12-02 at 8 44 36 PM
s77rt commented 9 months ago

We can proceed with @abzokhattab's proposal.

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed Link to proposal

melvin-bot[bot] commented 9 months ago

Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

DylanDylann commented 9 months ago

@s77rt

  1. since we are still dealing with the same solution (which is to add numberOfLines prop)

image

s77rt commented 9 months ago

@DylanDylann For the tooltip we can just use <Tooltip /> to be consist with <UserListItem />. The SearchPage will be refactored ^1 to use the SelectionList and inside we will be using UserListItem as well instead of DisplayNames.

DylanDylann commented 9 months ago

@s77rt Maybe there is a misunderstood here. I mean that we use the <DisplayName /> to handle the feature: If the text is too long, it will display as 'this is a long text ...' (a text with a elipsis ... at the end). So once user hover over this elipsis ..., it will display the full text

DylanDylann commented 9 months ago

But I see that your mean is the feature: Hovering over the text will display the text in the tooltip. Please correct me, thanks

s77rt commented 9 months ago

@DylanDylann Hovering the text would display the tooltip in the same way we do with UserListItem (currently used in Workspace invite page, and will be used on the referenced SearchPage)

DylanDylann commented 9 months ago

@s77rt No. I mean hover over the ..., not hover over the text

abzokhattab commented 9 months ago

My thinking reasoning was that there is no tooltip on the /settings/workspaces workspace list page so that's why I think we should stay consistent with it:

image
s77rt commented 9 months ago

@DylanDylann I think https://expensify.slack.com/archives/C01GTK53T8Q/p1701561828595899 answered your concern.

DylanDylann commented 9 months ago

@s77rt Yeah. Thanks for your information

s77rt commented 9 months ago

@abzokhattab Having a tooltip or not is not a blocker. We can proceed with fixing the reported bug and add a tooltip if it's needed.

iwiznia commented 9 months ago

Note: if we dont want to apply this truncation on every selection list then we can create a new boolean prop truncateText in the selectionList and set it to true whenever we want to truncate any list

Hmmmm why wouldn't we want to make this component always truncate and always have the hover text (at least when it is truncated)? Displaying a list with cut out names is not a feature we would ever want I would think, no?

s77rt commented 9 months ago

@iwiznia It will always truncate the name and if we add the tooltip it will always show up on text hover.

iwiznia commented 9 months ago

Ah ok perfect then!

melvin-bot[bot] commented 9 months ago

πŸ“£ @s77rt πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 9 months ago

πŸ“£ @abzokhattab πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] commented 9 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 9 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.11-25 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-12-20. :confetti_ball:

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 9 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

s77rt commented 9 months ago
ishpaul777 commented 9 months ago

gentle bump @NicMendonca for https://github.com/Expensify/App/issues/32384#issuecomment-1837119885, incase you missed it

NicMendonca commented 9 months ago

@lanitochka17 can you confirm this please?

@ishpaul777 this is the last bug I see reported from you in that channel

ishpaul777 commented 9 months ago

Hmm..., I am confident i reported it as bug may be a day or 2 days before bugs channel disappeared but it was not logged, Can you try searching @Ishpaul in:#expensify-bugs filter-Newest ( its set to Most relevant by default) may be, its fine if you can't find it maybe i am mistaken

NicMendonca commented 9 months ago

@ishpaul777 Are you able to search for that yourself and post it here?

I am not finding anything recent from you or related to this:

image
ishpaul777 commented 9 months ago

actually you should not search from:@ishpaul singh bugs are reported by BOT, so i believe the correct search is @ishpaul

I dont have bug channel so i cant see it :(

s77rt commented 9 months ago

I found it https://expensify.slack.com/archives/C049HHMV9SM/p1698155075411239

Screenshot 2023-12-18 at 6 56 01β€―PM
NicMendonca commented 9 months ago

@ishpaul777 can you apply to the job please? https://www.upwork.com/jobs/~01cf730d76f7807ef8

NicMendonca commented 9 months ago

@s77rt @abzokhattab - you've both been paid via Upwork

ishpaul777 commented 9 months ago

@NicMendonca Applied! Thanks πŸ˜€

NicMendonca commented 9 months ago

@ishpaul777 you've been paid

NicMendonca commented 9 months ago

we're all set here!