Closed lanitochka17 closed 9 months ago
Job added to Upwork: https://www.upwork.com/jobs/~01cf730d76f7807ef8
Triggered auto assignment to @NicMendonca (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are β
)Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (External
)
Long workspace name is not truncated in workspace selection page during room creation
ValuePicker
component to render items selections: ValuePicker
relies on ValueSelectorModal
, which, in turn, uses a selection list to render items.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
the BaseListItems uses RadioListItem
in our case: https://github.com/Expensify/App/blob/de53c93cedbc0a261fe28909e68a1a928602052a/src/components/SelectionList/BaseListItem.js#L32
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.
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:
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
<DisplayNames
fullTitle={item.text}
tooltipEnabled
numberOfLines={1}
textStyles={[styles.optionDisplayName, isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText, item.isSelected && styles.sidebarLinkTextBold]}
shouldUseFullTitle
/>
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
@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?
@s77rt Should we need to display the full name once user hover over the ellipsis like we did in other sections?
@DylanDylann Thanks for the proposal. Your RCA is correct. Regarding the tooltip, is there a specific reason to use <DIsplayNames />
instead of just <Tooltip />
?
@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
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:
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
@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.
@abzokhattab I think we can keep the styles.pre
not to collapse multiple whitespaces and to be consist with the selected value
Selected value:
RadioListItem
without styles.pre
RadioListItem
with styles.pre
We can proceed with @abzokhattab's proposal.
π π π C+ reviewed Link to proposal
Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@s77rt
since we are still dealing with the same solution (which is to add numberOfLines prop)
By using DisplayName, the user can see the full workspace name once they hover over the ellipsis. I think we need to confirm with the team about this. This is the core different between my proposal and the other one
One last argument is that RadioListItem is a generic component where DisplayNames is only designed for accounts.
I don't think DisplayNames is only designed for accounts because it also used in MenuItem
Also, the DisplayName is just used to display the long text with the hoverable ellipsis, does not anchor to the particular use case
If you worry about backward combinability, we can also add the prop named shouldUseDisplayName
and just use the DislayName if shouldUseDisplayName: true
@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
.
@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
But I see that your mean is the feature: Hovering over the text will display the text in the tooltip. Please correct me, thanks
@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)
@s77rt No. I mean hover over the ...
, not hover over the text
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:
@DylanDylann I think https://expensify.slack.com/archives/C01GTK53T8Q/p1701561828595899 answered your concern.
@s77rt Yeah. Thanks for your information
@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.
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?
@iwiznia It will always truncate the name and if we add the tooltip it will always show up on text hover.
Ah ok perfect then!
π£ @s77rt π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @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 π
Reviewing
label has been removed, please complete the "BugZero Checklist".
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:
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:
gentle bump @NicMendonca for https://github.com/Expensify/App/issues/32384#issuecomment-1837119885, incase you missed it
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
@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:
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 :(
@ishpaul777 can you apply to the job please? https://www.upwork.com/jobs/~01cf730d76f7807ef8
@s77rt @abzokhattab - you've both been paid via Upwork
@NicMendonca Applied! Thanks π
@ishpaul777 you've been paid
we're all set here!
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
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