Closed lanitochka17 closed 7 months ago
Triggered auto assignment to @laurenreidexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Job added to Upwork: https://www.upwork.com/jobs/~01085ff3847931e9ee
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (External
)
Category & Tag - No scroll bar in Category and Tag list
We are not passing shouldAllowScrollingChildren
to OptionsSelector
in tag picker and category picker
We should be passing shouldAllowScrollingChildren
true to OptionsSelector
in tag picker and category picker
But additionally we need to fix BaseOptionsSelector
too b/c now it doesn't have a scroll support when shouldTextInputAppearBelowOptions
is false
https://github.com/Expensify/App/blob/599c005849cd065a53d35e015991b637c768f2da/src/components/OptionsSelector/BaseOptionsSelector.js#L646-L662
So we should add a scroll view when shouldAllowScrollingChildren
is true when shouldTextInputAppearBelowOptions
is false same as when shouldTextInputAppearBelowOptions
is true as in here
https://github.com/Expensify/App/blob/599c005849cd065a53d35e015991b637c768f2da/src/components/OptionsSelector/BaseOptionsSelector.js#L632-L642
We should change it to
{/*
* The OptionsList component uses a SectionList which uses a VirtualizedList internally.
* VirtualizedList cannot be directly nested within ScrollViews of the same orientation.
* To work around this, we wrap the OptionsList component with a horizontal ScrollView.
*/}
{this.props.shouldAllowScrollingChildren && (
<ScrollView contentContainerStyle={[this.props.themeStyles.flexGrow1]}>
<ScrollView
horizontal
bounces={false}
contentContainerStyle={[this.props.themeStyles.flex1, this.props.themeStyles.flexColumn]}
>
{this.props.shouldTextInputAppearBelowOptions ? (
optionsAndInputsBelowThem
) : (
<>
<View style={this.props.shouldUseStyleForChildren ? [this.props.themeStyles.ph5, this.props.themeStyles.pb3] : []}>
{this.props.children}
{this.props.shouldShowTextInput && textInput}
{Boolean(this.props.textInputAlert) && (
<FormHelpMessage
message={this.props.textInputAlert}
style={[this.props.themeStyles.mb3]}
isError={false}
/>
)}
</View>
{optionsList}
</>
)}
</ScrollView>
</ScrollView>
)}
{!this.props.shouldAllowScrollingChildren &&
(this.props.shouldTextInputAppearBelowOptions ? (
optionsAndInputsBelowThem
) : (
<>
<View style={this.props.shouldUseStyleForChildren ? [this.props.themeStyles.ph5, this.props.themeStyles.pb3] : []}>
{this.props.children}
{this.props.shouldShowTextInput && textInput}
{Boolean(this.props.textInputAlert) && (
<FormHelpMessage
message={this.props.textInputAlert}
style={[this.props.themeStyles.mb3]}
isError={false}
/>
)}
</View>
{optionsList}
</>
))}
No scrollbar for category and tag list.
The list simply uses BaseOoptionsList that has a default value of false for showsVerticalScrollIndicator
and we didn't pass it as true for both tag and category list, so the scroll is not visible.
https://github.com/Expensify/App/blob/e6b07616db3a818574d60acf1d9ebaf1cb26bf02/src/components/OptionsList/BaseOptionsList.js#L279
I don't know what is the rule to decide which page should show a scrollbar or not because this happens on many pages, but the solution is just to pass showScrollIndicator
to the list component (OptionsSelector), or make it default to true if we want to show the scroll on all pages.
Scroll bar is not visible for Category and Tag list
We do not pass the prop showScrollIndicator
in BaseOptionsSelector
component and hence we do not see the scrollbar by default in Category as well as Tag list (As well as all the places where OptionSelector
is used)
We just need to update the main BaseOptionsSelector
component in OptionsSelector and pass showScrollIndicator
prop (Default value of this prop is true and can be overwritten where ever requried).
<BaseOptionsSelector
showScrollIndicator
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
ref={ref}
shouldTextInputInterceptSwipe
/>
Screencast from 01-19-2024 11:39:17 AM.webm
N/A
After reviewing all proposals, I recommend moving forward with @bernhardoj's proposal which contains a simple and straightforward solution.
@bernhardoj Let's try to identify all the list views in the Request money flow and apply the changes there.
@FitseTLT When making significant edits to your proposal, please follow the guidelines and create an updated post in the thread, irrespective of the fact that there is already another proposal posted or not. This makes things easier to keep track of. There is also a lengthy code diff without a clear explanation of what the change does.
πππ C+ reviewed.
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
The recommended proposal makes technical sense to me but I'd like an opinion from @Expensify/design regarding when the scroll bar should and shouldn't be displayed in the App. I'm not sure if it's intentional that the scroll bar isn't shown for these lists...
@shawnborton do we ever purposely hide scrollbars in the app? I guess I had just assumed we display them whenever they're present.
(I'm always on Mac and iOS where scrollbars are always invisible until you're using themβso it's totally possible I've missed some scrollbar-related details.)
Hmm great question. I was under the same impression - we basically just follow platform conventions there, and indeed, on Mac I think they are basically hidden by default.
So I would say this isn't a bug and we can just close this one out.
So I would say this isn't a bug and we can just close this one out.
I believe the bug here is that the scrollbars are not displayed at all even when scrolling.
Ah, got it, that makes sense. But that being said, whatever proposal we accept, we should make it so that the scroll behavior here matches the same scroll behavior elsewhere - we shouldn't just always show the scrollbar by default in this view, but rather, only when scrolling (if that's what the platform convention is of course).
Considering the above conversation here is my updated proposal, : here
Ah, got it, that makes sense. But that being said, whatever proposal we accept, we should make it so that the scroll behavior here matches the same scroll behavior elsewhere - we shouldn't just always show the scrollbar by default in this view, but rather, only when scrolling (if that's what the platform convention is of course).
I have updated it to implement the scrollbar globally and not just for the mentioned view.
@akinwale, @MariaHCD
Can we confirm that proposal won't just force scrollbars to show on Mac even when scrolling is not happening?
Yes, there are components like timezoneSelectPage
which currently use the same prop and things work fine on Macbooks :)
No scroll bar in Category and Tag list
We are actually missing a scroll indicator in many areas of the app:
This is because, these lists in App are rendered by OptionsList and SelectionList. Both these lists have a prop showScrollIndicator
that shows scroll bar (only when list is scrolling). But we turn these off by default:
In BaseOptionsList
:
https://github.com/Expensify/App/blob/616d75f2e49be00f9bb0234cf2eb2cacf1522211/src/components/OptionsList/BaseOptionsList.tsx#L36
In BaseSelectionList
:
https://github.com/Expensify/App/blob/616d75f2e49be00f9bb0234cf2eb2cacf1522211/src/components/SelectionList/BaseSelectionList.js#L55
This then requires us to manually turn on the scroll bar (which hasn't been done for many lists). This is the root cause.
We should turn both these props here and here to true
by default:
showScrollIndicator = true,
This will have the effect to show a scroll bar when a list is scrolling. Note that the scroll bar will not be visible when scroll is not happening.
This prop can be turned off for specific components if need be.
Since this prop is not turned on by default, we will remove it from being passed explicitly as passing for true would be unnecessary.
https://github.com/Expensify/App/assets/64629613/0ba26f32-0f1b-4e1c-bb6a-b77200ec4780
@neonbhai A proposal has already been selected.
@bernhardoj When testing, please take the comments in https://github.com/Expensify/App/issues/34762#issuecomment-1904827362 into consideration, especially regarding matching platform behaviour on macOS.
@MariaHCD I believe we can move forward here.
π£ @akinwale π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @bernhardoj π 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 π
PR is ready
cc: @akinwale
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.33-5 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 2024-02-07. :confetti_ball:
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:
Payment Summary:
Contributor: $500 @bernhardoj paid in Upwork C+ review: $500 @akinwale paid in Upwork
remaining steps before closing: @akinwale to complete checklist and confirm re: regression testing
- [x] [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
- [x] [@akinwale] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [x] [@akinwale] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
Not a regression. Scrollbars for the list items were not being displayed previously.
- [x] [@akinwale] Determine if we should create a regression test for this bug.
- [x] [@akinwale] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
Regression Test Steps
Do we agree π or π?
@laurenreidexpensify Payment received. Thanks.
I have completed the checklist.
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.27-1 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: User is an employee of Collect workspace that has categories and tags
Expected Result:
There will be scroll bar when the list is long
Actual Result:
There is no scroll bar when the list is long
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/7d713b74-7d8a-4972-a718-746977301530
View all open jobs on GitHub
Upwork Automation - Do Not Edit