Skip to content
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

Item in report list is not highlighted and list cannot be navigated with keyboard #37081

Conversation

ZhenjaHorbach
Copy link
Contributor

@ZhenjaHorbach ZhenjaHorbach commented Feb 22, 2024

Details

Fixed Issues

$ #35843
PROPOSAL: #35843 (comment)

Tests

  • User is an employee of Collect workspace
  • The Collect workspace has dropdown field set up in "Report and Invoice Fields" on Old Dot
  1. Go to workspace chat
  2. Create a request
  3. Go to expense report
  4. Click on the report field with the selection list set up from Old Dot
  5. Select an item
  6. Click on the field
  7. Use keyboard to navigate through the list
  8. Verify that Item in report list is highlighted and list can be navigated with keyboard

In addition to EditReportField in this PR, changes were made on other screens related to navigate between elements with keyboard for lists on:

  • YearPicker

  • StateSelector

  • NewChat

  • BusinessTypeSelector

  • ReportParticipants

  • RoomInvite

  • RoomMembers

  • Search

  • WorkspaceSwitcher

  • RequestStepCurrency

  • MoneyRequestParticipantsSelector

  • BaseShareLogList

  • CountrySelection

  • TimezoneSelect

  • TaskAssigneeSelector

  • WorkspaceInvite

  • WorkspaceMembers

  • WorkspaceCategories

  • WorkspaceMemberDetailsRoleSelection

  • WorkspaceAutoReportingMonthlyOffset

  • WorkspaceWorkflowsApprover

  • Verify that no errors appear in the JS console

Offline tests

  • User is an employee of Collect workspace
  • The Collect workspace has dropdown field set up in "Report and Invoice Fields" on Old Dot
  1. Go to workspace chat
  2. Create a request
  3. Go to expense report
  4. Click on the report field with the selection list set up from Old Dot
  5. Select an item
  6. Click on the field
  7. Use keyboard to navigate through the list
  8. Verify that Item in report list is highlighted and list can be navigated with keyboard

In addition to EditReportField in this PR, changes were made on other screens related to navigate between elements with keyboard for lists on:

  • YearPicker
  • StateSelector
  • NewChat
  • BusinessTypeSelector
  • ReportParticipants
  • RoomInvite
  • RoomMembers
  • Search
  • WorkspaceSwitcher
  • RequestStepCurrency
  • MoneyRequestParticipantsSelector
  • BaseShareLogList
  • CountrySelection
  • TimezoneSelect
  • TaskAssigneeSelector
  • WorkspaceInvite
  • WorkspaceMembers
  • WorkspaceCategories
  • WorkspaceMemberDetailsRoleSelection
  • WorkspaceAutoReportingMonthlyOffset
  • WorkspaceWorkflowsApprover

QA Steps

  • User is an employee of Collect workspace
  • The Collect workspace has dropdown field set up in "Report and Invoice Fields" on Old Dot
  1. Go to workspace chat
  2. Create a request
  3. Go to expense report
  4. Click on the report field with the selection list set up from Old Dot
  5. Select an item
  6. Click on the field
  7. Use keyboard to navigate through the list
  8. Verify that Item in report list is highlighted and list can be navigated with keyboard

In addition to EditReportField in this PR, changes were made on other screens related to navigate between elements with keyboard for lists on:

  • YearPicker

  • StateSelector

  • NewChat

  • BusinessTypeSelector

  • ReportParticipants

  • RoomInvite

  • RoomMembers

  • Search

  • WorkspaceSwitcher

  • RequestStepCurrency

  • MoneyRequestParticipantsSelector

  • BaseShareLogList

  • CountrySelection

  • TimezoneSelect

  • TaskAssigneeSelector

  • WorkspaceInvite

  • WorkspaceMembers

  • WorkspaceCategories

  • WorkspaceMemberDetailsRoleSelection

  • WorkspaceAutoReportingMonthlyOffset

  • WorkspaceWorkflowsApprover

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
android.mov
Android: mWeb Chrome
android.mov
iOS: Native
Screen.Recording.2024-02-22.at.15.11.19.mov
iOS: mWeb Safari
Screen.Recording.2024-02-22.at.15.07.03.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
Screen.Recording.2024-02-22.at.14.58.55.mov

@ZhenjaHorbach ZhenjaHorbach requested a review from a team as a code owner February 22, 2024 12:22
@melvin-bot melvin-bot bot removed the request for review from a team February 22, 2024 12:22
Copy link

melvin-bot bot commented Feb 22, 2024

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

@melvin-bot melvin-bot bot requested a review from mananjadhav February 22, 2024 12:23
Copy link

melvin-bot bot commented Feb 22, 2024

@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@ZhenjaHorbach
Copy link
Contributor Author

@mananjadhav
Hello )
PR is ready )

@mananjadhav
Copy link
Collaborator

@ZhenjaHorbach Could we have not updated this at one place? I think we could've iterated inside the OptionsSelector?

@ZhenjaHorbach
Copy link
Contributor Author

@ZhenjaHorbach Could we have not updated this at one place? I think we could've iterated inside the OptionsSelector?

That's exactly what I did )
Actually In this PR we have only two important changes
Inside BaseOptionsSelector and BaseSelectionList(Since the component has the same implementation as BaseOptionsSelector for indexOffset)

Other changes related only with unnecessary code which we must remove because it is no longer needed

@@ -377,6 +377,11 @@ function BaseSelectionList<TItem extends ListItem>(
isActive: !disableKeyboardShortcuts && isFocused,
});

const sectionsWithIndexOffset = sections.map((section, index) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to a util, as the same code is repeated earlier?

@@ -92,6 +92,7 @@ function EditReportFieldDropdownPage({fieldName, onSubmit, fieldID, fieldValue,
textInputLabel={translate('common.search')}
boldStyle
sections={sections}
focusedIndex={0}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this have to be set to 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly the screen where the bug was found
This is needed for searching
So that during the search the first element is selected

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put that in a comment to make this very clear?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain the why in the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has already been fixed)

Copy link
Collaborator

@mananjadhav mananjadhav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments.

@ZhenjaHorbach
Copy link
Contributor Author

Minor comments.

Thanks for review
I will update PR today or tomorrow

@ZhenjaHorbach
Copy link
Contributor Author

@mananjadhav
Hello )
I updated PR )

@mananjadhav
Copy link
Collaborator

@ZhenjaHorbach I am still testing this but we've got merge conflicts. Can you please resolve them?

@mananjadhav
Copy link
Collaborator

@ZhenjaHorbach I am still testing this but we've got merge conflicts now. Also I think the app crashes when I try to do a search on the custom field. Can you please take a look?


https://github.com/Expensify/App/assets/3069065/4562e6d6-4846-421d-98aa-f395cfd924ec


Uncaught Invariant Violation: scrollToIndex out of range: requested index 6 is out of 0 to 4
    at invariant (webpack-internal:///./node_modules/fbjs/lib/invariant.js:40:15)
    at VirtualizedList.scrollToIndex (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js:663:65)
    at VirtualizedSectionList.scrollToLocation (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/VirtualizedSectionList/index.js:204:21)
    at SectionList.scrollToLocation (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/SectionList/index.js:122:30)
    at eval (webpack-internal:///./src/components/OptionsSelector/BaseOptionsSelector.js:358:21)
    at eval (webpack-internal:///./src/components/OptionsSelector/BaseOptionsSelector.js:460:5)
    at commitHookEffectListMount (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:23044:26)
    at commitPassiveMountOnFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24816:11)
    at commitPassiveMountEffects_complete (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24776:9)
    at commitPassiveMountEffects_begin (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24763:7)
react-dom.development.js:18572 The above error occurred in the <BaseOptionsSelector> component:

    at BaseOptionsSelector (webpack-internal:///./src/components/OptionsSelector/BaseOptionsSelector.js:87:90)
    at BaseOptionsSelectorWithRef
    at OptionsSelector
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at PickerAvoidingView (webpack-internal:///./node_modules/react-native-picker-select/src/PickerAvoidingView/index.js:22:23)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at KeyboardAvoidingView (webpack-internal:///./src/components/KeyboardAvoidingView/index.tsx:17:24)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at SafeAreaConsumer (webpack-internal:///./src/components/SafeAreaConsumer/index.tsx:18:23)
    at ScreenWrapper (webpack-internal:///./src/components/ScreenWrapper.tsx:56:36)
    at EditReportFieldDropdownPage (webpack-internal:///./src/pages/EditReportFieldDropdownPage.tsx:30:24)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/withOnyx.js:70:17)
    at EditReportFieldPage (webpack-internal:///./src/pages/EditReportFieldPage.tsx:37:20)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/withOnyx.js:70:17)
    at StaticContainer (webpack-internal:///./node_modules/@react-navigation/core/lib/module/StaticContainer.js:13:16)
    at EnsureSingleNavigator (webpack-internal:///./node_modules/@react-navigation/core/lib/module/EnsureSingleNavigator.js:17:5)
    at SceneView (webpack-internal:///./node_modules/@react-navigation/core/lib/module/SceneView.js:22:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at CardSheet (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardSheet.js:18:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at eval (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:35:90)
    at Dummy (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/GestureHandler.js:14:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at eval (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:35:90)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at Card (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js:54:1)
    at CardContainer (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardContainer.js:28:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at NativeScreen (webpack-internal:///./node_modules/react-native-screens/lib/module/index.js:58:1)
    at eval (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:35:90)
    at MaybeScreen (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Screens.js:32:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at MaybeScreenContainer (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Screens.js:20:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at Background (webpack-internal:///./node_modules/@react-navigation/elements/lib/module/Background.js:15:5)
    at CardStack (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js:191:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at SafeAreaProviderCompat (webpack-internal:///./node_modules/@react-navigation/elements/lib/module/SafeAreaProviderCompat.js:40:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at StackView (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/StackView.js:34:1)
    at PreventRemoveProvider (webpack-internal:///./node_modules/@react-navigation/core/lib/module/PreventRemoveProvider.js:43:5)
    at NavigationContent (webpack-internal:///./node_modules/@react-navigation/core/lib/module/useComponent.js:10:5)
    at eval (webpack-in
Screenshot 2024-02-29 at 1 28 02 AM

@ZhenjaHorbach
Copy link
Contributor Author

@ZhenjaHorbach I am still testing this but we've got merge conflicts now. Also I think the app crashes when I try to do a search on the custom field. Can you please take a look?


https://github.com/Expensify/App/assets/3069065/4562e6d6-4846-421d-98aa-f395cfd924ec


Uncaught Invariant Violation: scrollToIndex out of range: requested index 6 is out of 0 to 4
    at invariant (webpack-internal:///./node_modules/fbjs/lib/invariant.js:40:15)
    at VirtualizedList.scrollToIndex (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js:663:65)
    at VirtualizedSectionList.scrollToLocation (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/VirtualizedSectionList/index.js:204:21)
    at SectionList.scrollToLocation (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/SectionList/index.js:122:30)
    at eval (webpack-internal:///./src/components/OptionsSelector/BaseOptionsSelector.js:358:21)
    at eval (webpack-internal:///./src/components/OptionsSelector/BaseOptionsSelector.js:460:5)
    at commitHookEffectListMount (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:23044:26)
    at commitPassiveMountOnFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24816:11)
    at commitPassiveMountEffects_complete (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24776:9)
    at commitPassiveMountEffects_begin (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24763:7)
react-dom.development.js:18572 The above error occurred in the <BaseOptionsSelector> component:

    at BaseOptionsSelector (webpack-internal:///./src/components/OptionsSelector/BaseOptionsSelector.js:87:90)
    at BaseOptionsSelectorWithRef
    at OptionsSelector
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at PickerAvoidingView (webpack-internal:///./node_modules/react-native-picker-select/src/PickerAvoidingView/index.js:22:23)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at KeyboardAvoidingView (webpack-internal:///./src/components/KeyboardAvoidingView/index.tsx:17:24)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at SafeAreaConsumer (webpack-internal:///./src/components/SafeAreaConsumer/index.tsx:18:23)
    at ScreenWrapper (webpack-internal:///./src/components/ScreenWrapper.tsx:56:36)
    at EditReportFieldDropdownPage (webpack-internal:///./src/pages/EditReportFieldDropdownPage.tsx:30:24)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/withOnyx.js:70:17)
    at EditReportFieldPage (webpack-internal:///./src/pages/EditReportFieldPage.tsx:37:20)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/withOnyx.js:70:17)
    at StaticContainer (webpack-internal:///./node_modules/@react-navigation/core/lib/module/StaticContainer.js:13:16)
    at EnsureSingleNavigator (webpack-internal:///./node_modules/@react-navigation/core/lib/module/EnsureSingleNavigator.js:17:5)
    at SceneView (webpack-internal:///./node_modules/@react-navigation/core/lib/module/SceneView.js:22:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at CardSheet (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardSheet.js:18:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at eval (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:35:90)
    at Dummy (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/GestureHandler.js:14:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at eval (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:35:90)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at Card (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js:54:1)
    at CardContainer (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardContainer.js:28:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at NativeScreen (webpack-internal:///./node_modules/react-native-screens/lib/module/index.js:58:1)
    at eval (webpack-internal:///./node_modules/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:35:90)
    at MaybeScreen (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Screens.js:32:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at MaybeScreenContainer (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Screens.js:20:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at Background (webpack-internal:///./node_modules/@react-navigation/elements/lib/module/Background.js:15:5)
    at CardStack (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js:191:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at SafeAreaProviderCompat (webpack-internal:///./node_modules/@react-navigation/elements/lib/module/SafeAreaProviderCompat.js:40:5)
    at div
    at eval (webpack-internal:///./node_modules/react-native-web/dist/exports/View/index.js:52:25)
    at StackView (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/StackView.js:34:1)
    at PreventRemoveProvider (webpack-internal:///./node_modules/@react-navigation/core/lib/module/PreventRemoveProvider.js:43:5)
    at NavigationContent (webpack-internal:///./node_modules/@react-navigation/core/lib/module/useComponent.js:10:5)
    at eval (webpack-in
Screenshot 2024-02-29 at 1 28 02 AM

Weird
I can't reproduce this
Can you please check it on main?

@mananjadhav
Copy link
Collaborator

I checked on staging I wasn't able to reproduce. I'll check on main. Meanwhile can you please merge the branch? I think I'll need your support to keep the branch updated. I am taking more time to test as it affects multiple screens.

@ZhenjaHorbach
Copy link
Contributor Author

did a quick round of QA on Web and Desktop. But we've got conflicts again. @ZhenjaHorbach Can you please resolve, and then @cead22 we can marge?

I fixed conflicts )

@mananjadhav
Copy link
Collaborator

quick bump @cead22

@cead22
Copy link
Contributor

cead22 commented Mar 25, 2024

Sorry, I was OOO on Friday and we have conflicts again. Please resolve them and I'll review ASAP

@ZhenjaHorbach
Copy link
Contributor Author

@cead22

Hello )
I resolved conflicts

Copy link
Contributor

@cead22 cead22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Do we need both Section and SectionWithIndex types? If so, why?
  • If not, can we get rid of withIndexOffset/WithIndexOffset in every type, var and function name?

Comment on lines +138 to +139
// eslint-disable-next-line @typescript-eslint/naming-convention
const getItemLayout = (_data: OptionsListDataWithIndexOffset[] | null, flatDataArrayIndex: number) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we need to violation this lint rule, or can we do something like this?

Suggested change
// eslint-disable-next-line @typescript-eslint/naming-convention
const getItemLayout = (_data: OptionsListDataWithIndexOffset[] | null, flatDataArrayIndex: number) => {
const getItemLayout = (data: OptionsListDataWithIndexOffset[] | null, flatDataArrayIndex: number) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-03-25 at 22 31 31

In this case we get ts error

type OptionsListData = SectionListData<OptionData, Section>;
type OptionsListDataWithIndexOffset = SectionListData<OptionData, SectionWithIndexOffset>;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -92,6 +92,7 @@ function EditReportFieldDropdownPage({fieldName, onSubmit, fieldID, fieldValue,
textInputLabel={translate('common.search')}
boldStyle
sections={sections}
focusedIndex={0}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain the why in the comment

@ZhenjaHorbach
Copy link
Contributor Author

ZhenjaHorbach commented Mar 25, 2024

  • Do we need both Section and SectionWithIndex types? If so, why?
  • If not, can we get rid of withIndexOffset/WithIndexOffset in every type, var and function name?

I think we need it
Because we use Section as a type for the parameters that we get in which there is no index

But inside BaseOptionsList we upgrade our Section for using indexOffset and in this case, we use SectionWithIndexOffset

@cead22
Copy link
Contributor

cead22 commented Mar 26, 2024

Because we use Section as a type for the parameters that we get in which there is no index

But do we need to use it, or can we have a single Section type that we use everywhere?

@ZhenjaHorbach
Copy link
Contributor Author

Because we use Section as a type for the parameters that we get in which there is no index

But do we need to use it, or can we have a single Section type that we use everywhere?

I don't think it makes sense to delete this
Moreover, we have places where we use this type outside BaseList

For example

type MembersSection = SectionListData<MemberForList, Section<MemberForList>>;

@cead22
Copy link
Contributor

cead22 commented Mar 26, 2024

I don't think it makes sense to delete this

Can you share your reasoning please? Sorry if it's obvious, but I'm curious why we can't or shouldn't consolidate these types, and use them even on the places outside of BaseList

@ZhenjaHorbach
Copy link
Contributor Author

I don't think it makes sense to delete this

Can you share your reasoning please? Sorry if it's obvious, but I'm curious why we can't or shouldn't consolidate these types, and use them even on the places outside of BaseList

Sorry if I didn't give enough details)

Since indexOffset is a required parameter inside BaseList
But outside of BaseList we don’t need it

So if we use a type with index offset everywhere
Then we will get many errors related to the fact that we did not pass the parameter

@cead22
Copy link
Contributor

cead22 commented Mar 28, 2024

Can we make it optional and/or default its value to 0?

@ZhenjaHorbach
Copy link
Contributor Author

Can we make it optional and/or default its value to 0?

In that case, we will return to this comment )
#37081 (comment)

I think this will make the code more dirty
Since we will be able to pass a parameter that is not used anywhere

@cead22
Copy link
Contributor

cead22 commented Mar 29, 2024

Alright, sorry for the delay, there's conflicts again. I'll merge after they're fixed

@ZhenjaHorbach
Copy link
Contributor Author

Alright, sorry for the delay, there's conflicts again. I'll merge after they're fixed

Hello )
I fixed conflicts )

@cead22 cead22 merged commit 54c669f into Expensify:main Mar 29, 2024
15 checks passed
@melvin-bot melvin-bot bot added the Emergency label Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

@cead22 looks like this was merged without a test passing. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@cead22 cead22 removed the Emergency label Mar 29, 2024
@cead22
Copy link
Contributor

cead22 commented Mar 29, 2024

This is not an emergency change, but we're skipping one check and that's making it so we add the label. We're discussing this on slack

@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Apr 2, 2024

🚀 Deployed to staging by https://github.com/cead22 in version: 1.4.59-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Apr 8, 2024

🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.60-13 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants