-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[$500] Chat - Scroll bar appears in the suggestion list when only one emoji is in the suggestion list #31001
Comments
Job added to Upwork: https://www.upwork.com/jobs/~018b10f4eb010b9828 |
Triggered auto assignment to @garrettmknight ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @robertKozik ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Scrollbar shows even when the emoji suggestion is only one (it's also scrollable). What is the root cause of that problem?The list is scrollable because the View that wraps the list has a smaller height.
The height style comes from the Each emoji suggestion has a height of 40. The suggestion component has a vertical padding of 8. If we look at the implementation of Lines 997 to 1010 in cbfd424
So, the total height would be 56. However, they seem to forget that the suggestion component also has a border (or maybe the border is added recently?). The suggestion border width is 1, so we should add 2 * 1 to the height and the correct total height would be 58. What changes do you think we should make in order to solve the problem?Add the border width to the calculation of the suggestion view height. const borderWidth = 2;
-const height = itemsHeight + 2 * CONST.AUTO_COMPLETE_SUGGESTER.SUGGESTER_INNER_PADDING;
+const height = itemsHeight + 2 * CONST.AUTO_COMPLETE_SUGGESTER.SUGGESTER_INNER_PADDING + borderWidth; |
ProposalPlease re-state the problem that we are trying to solve in this issue.Chat - Scroll bar appears in the suggestion list when only one emoji is in the suggestion list What is the root cause of that problem?We calculate the height for suggestion container but do not include the border width Line 1001 in cbfd424
-> The height of container is smaller than the inner one, that cause the scroll bar appears What changes do you think we should make in order to solve the problem?Add borderWidth to height
Result |
ProposalPlease re-state the problem that we are trying to solve in this issue.Chat - Scroll bar appears in the suggestion list when only one emoji is in the suggestion list What is the root cause of that problem?We are calculating
What changes do you think we should make in order to solve the problem?Move + const actualHeight = measureHeightOfSuggestionRows(props.suggestions.length, props.isSuggestionPickerLarge);
useEffect(() => {
- rowHeight.value = withTiming(measureHeightOfSuggestionRows(props.suggestions.length, props.isSuggestionPickerLarge), {
+ rowHeight.value = withTiming(actualHeight, {
// in <FlatList
- showsVerticalScrollIndicator={innerHeight > rowHeight.value}
+ showsVerticalScrollIndicator={innerHeight > actualHeight} If wanted we can also update the height here, but only updating the height would still show the scrollbar while animating, so we need to use the above solution. |
Unable to reproduce on v1.3.96-15 via chrome or v1.3.95-9 MacOS. Closing - @lanitochka17 please reopen if you can get it to show. |
Hi @garrettmknight, In other platforms where the scrollbar is non-floating by default, you can see it without scrolling. |
@garrettmknight, Also in MacOS when using a mouse instead of the trackpad the scrollbar will be visible by default, so it will be visible even without scrolling. |
Hi @garrettmknight @lanitochka17, |
I was also able to reproduce ithe issue. @bernhardoj I can reproduce your solution, it solves the problem, however it seems that the emoji and the suggestion are not vertically aligned, the emoji is not in the center I guess. Does it make sense or is it normal behavior? Thanks. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Redundant scroll bar appears in the suggestion list when only one emoji is in the list What is the root cause of that problem?In the What changes do you think we should make in order to solve the problem?Even though we still need to keep in the Solution Video: |
📣 @derekops333! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
@garrettmknight, @robertKozik Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Sorry for the delay on my end. I'll go through the proposals asap 👀 |
Hi all! Once more sorry for that delay on this issue 🙇🏼 After checking all proposals I believe we should go with the solution from @bernhardoj proposal. It offers easy to implement fix which covers the issue. It's also the first proposal on github issue timeline which suggests this approach (edit of the proposal is just cosmetic, it adds the code diff section only) 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Hi @robertKozik, I've tried @bernhardoj's proposal, it'll cause a regression, it makes the scrollbar visible while the suggestion list is animating, check the video below, where the scrollbar flashes for a quick second. 2023-11-14.02-37-34.mp4Regarding your concerns,
I've also mentioned about fixing the From my proposal
The |
@robertKozik To test it, you may try enabling the scrollbar while using a MacOS with a trackpad. |
I think it's technically make sense that the scrollbar is shown when the list height is animating. The animation starts from a small height that of course will make the content scrollable. At the end, we need to fix the wrong calculation of the height. |
@bernhardoj, 2023-11-14.09-45-29.mp4 |
Hi @robertKozik,
The issue you mentioned above was not because of my solution, it was already present, if we fix the Also, implementing @bernhardoj's proposal will make the issue #18112 reappear again. |
Thanks for linking the issue, as it sheds a new light on our issue. Let me get more familiar with it first and I'lll get back here soon 😉 I agree that your changes would marginally affect the performance. What I meant when writing the reasoning why I prefered other proposal over yours @DrLoopFall was that ideally I opt for omitting recalculating any value every render, if thats possible of course |
Solution that was proposed by the @DrLoopFall is a common React anti-pattern. It calls an expensive calculation inside a render function which blocks rendering of the component content and decreases the app performances. |
@derekops333,
For your reference, this is how const measureHeightOfSuggestionRows = (numRows, isSuggestionPickerLarge) => {
if (isSuggestionPickerLarge) {
if (numRows > CONST_VARIABLE) {
return CONST_VARIABLE * CONST_VARIABLE;
}
return numRows * CONST_VARIABLE;
}
if (numRows > 2) {
return CONST_VARIABLE * CONST_VARIABLE;
}
return numRows * CONST_VARIABLE;
}; Do you even realize that your proposed solution is the most expensive among all the proposals here, because you literally proposed using Do you even have any idea, how much expensive is to rerender? |
FlatList component (inside of the |
@derekops333, Currently, the component
In my proposed solution the animation is working fine, check my proposal again for more details. |
@robertKozik, after considering @DrLoopFall's comments about a possible regression, what do you think about the proposals, especially the one you initially chose? |
@garrettmknight @lakchote @robertKozik this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
This is dupe of #27866 |
Thanks for pointing it out @0xmiroslav if this is a dupe, I think we should close this issue then as suggested above |
Cool, closing! |
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.3.96-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:
Expected Result:
There is no scroll bar on the right of the list since there is only one emoji in the suggestion list
Actual Result:
There is a scroll bar on the right of the list when only one emoji is in the suggestion list
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6267321_1699361414740.bandicam_2023-11-07_20-38-23-117.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: