Skip to content

[$250] Table headers are misaligned when external mouse is connected #41693

Closed

Description

@luacmartins

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:
Reproducible in staging?:
Reproducible in production?:
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:
Slack conversation:

Action Performed:

Coming from this comment, table headers are misaligned with the table content when an external mouse is connected:

  1. [large screens only] Connect an external mouse to your computer
  2. Navigate to the Search page Profile > Troubleshoot > New search page
  3. Note that the table header and table content are misaligned
Screenshot 2024-05-06 at 12 25 30 PM

Note: this also happens in other views, e.g. Workspace categories, tags, etc

Expected Result:

Table header should be aligned with content

Actual Result:

Table header is not aligned with content

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01352e7296a9a4fe1c
  • Upwork Job ID: 1787872804772577280
  • Last Price Increase: 2024-05-07
  • Automatic offers:
    • ahmedGaber93 | Reviewer | 0
Issue OwnerCurrent Issue Owner: @dragnoir

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 6, 2024
  2. self-assigned this
    on May 6, 2024
  3. melvin-bot commented on May 6, 2024

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  4. bernhardoj commented on May 7, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The list header is misaligned when a scrollbar is added to the list.

    What is the root cause of that problem?

    The header isn't part of the list component, so when the list width is reduced because of the scrollbar, the header becomes misaligned.

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

    Wrap the header with a view and set the max width to the list width or 100%.

    {!headerMessage && canSelectMultiple && shouldShowSelectAll && (
    <View style={[styles.userSelectNone, styles.peopleRow, styles.ph5, styles.pb3, listHeaderWrapperStyle]}>
    <View style={[styles.flexRow, styles.alignItemsCenter]}>
    <Checkbox
    accessibilityLabel={translate('workspace.people.selectAll')}
    isChecked={flattenedSections.allSelected}
    onPress={selectAllRow}
    disabled={flattenedSections.allOptions.length === flattenedSections.disabledOptionsIndexes.length}
    />
    {!customListHeader && (
    <PressableWithFeedback
    style={[styles.userSelectNone, styles.flexRow, styles.alignItemsCenter]}
    onPress={selectAllRow}
    accessibilityLabel={translate('workspace.people.selectAll')}
    role="button"
    accessibilityState={{checked: flattenedSections.allSelected}}
    disabled={flattenedSections.allOptions.length === flattenedSections.disabledOptionsIndexes.length}
    dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
    onMouseDown={shouldPreventDefaultFocusOnSelectRow ? (e) => e.preventDefault() : undefined}
    >
    <Text style={[styles.textStrong, styles.ph3]}>{translate('workspace.people.selectAll')}</Text>
    </PressableWithFeedback>
    )}
    </View>
    {customListHeader}
    </View>
    )}
    {!headerMessage && !canSelectMultiple && customListHeader}

    <View style={{maxWidth: listWidth || '100%'}}

    We get the listWidth (state) from the section list onLayout.

    const onSectionListLayout = useCallback(
    (nativeEvent: LayoutChangeEvent) => {
    onLayout?.(nativeEvent);

  5. dragnoir commented on May 7, 2024

    @dragnoir
    Contributor

    Proposal

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

    Table headers are misaligned when external mouse is connected

    What is the root cause of that problem?

    The Search page use a component for the header => SearchTableHeader
    and another for the content.

    <SelectionList
    customListHeader={<SearchTableHeader shouldShowMerchant={shouldShowMerchant} />}

    On browsers, hte items list from SelectionList will add an extra element to the right, the scroll bar. This is not part of the browser, it's added only to the list and not the header.

    So this will move the elements list a bit to the left, and this will cause unconsistency between the header (no scroll bar) and the list (new scroll bar on the right)

    image

    As you see on the image, the red zone, the scroll bar, will decrease the space for the blue item list, and because w are using flex1 to fill the space, the position will not be the same as on the header.

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

    Add ScrollView as a container for the Search page

    + <ScrollView>
    
    	<SelectionList
    	customListHeader={<SearchTableHeader  shouldShowMerchant={shouldShowMerchant}  />}
    	ListItem={ListItem}
    	sections={[{data, isDisabled:  false}]}
    	onSelectRow={(item) => {
    	openReport(item.transactionThreadReportID);
    	}}
    	shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()}
    	listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]}
    	containerStyle={[styles.pv0]}
    	/>
    
    + </ScrollView>

    POC:

    With no mouse:
    image

    With mouse

    image

    What alternative solutions did you explore? (Optional)

    We can also remove the scroll bar with showScrollIndicator={false}

    <SelectionList
    	customListHeader={<SearchTableHeader  shouldShowMerchant={shouldShowMerchant}  />}
    	ListItem={ListItem}
    	sections={[{data, isDisabled:  false}]}
    	onSelectRow={(item) => {
    	openReport(item.transactionThreadReportID);
    	}}
    	shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()}
    	listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]}
    	containerStyle={[styles.pv0]}
    +	showScrollIndicator={false}
    />
    + </ScrollView>
  6. added
    BugSomething is broken. Auto assigns a BugZero manager.
    ExternalAdded to denote the issue can be worked on by a contributor
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 7, 2024
  7. melvin-bot commented on May 7, 2024

    @melvin-bot

    Current assignee @CortneyOfstad is eligible for the Bug assigner, not assigning anyone new.

  8. changed the title [-]Table headers are misaligned when external mouse is connected[/-] [+][$250] Table headers are misaligned when external mouse is connected[/+] on May 7, 2024
  9. melvin-bot commented on May 7, 2024

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 7, 2024
  11. 12 remaining items

  12. CortneyOfstad commented on May 15, 2024

    @CortneyOfstad
    Contributor

    PR was deployed to staging 8 hours ago 🎉

  13. CortneyOfstad commented on May 20, 2024

    @CortneyOfstad
    Contributor

    We're in a merge freeze until Wednesday so being pushed to production will take some time 👍

  14. CortneyOfstad commented on May 22, 2024

    @CortneyOfstad
    Contributor

    Merge freeze is planned to end today 🤞

  15. luacmartins commented on May 22, 2024

    @luacmartins
    ContributorAuthor

    Here's the latest on the merge freeze. I don't think it'll end today.

  16. ahmedGaber93 commented on May 31, 2024

    @ahmedGaber93
    Contributor

    @CortneyOfstad this issue is ready for payment. It deployed to production 23-5-2024 #41986 (comment)

  17. melvin-bot commented on Jun 3, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @CortneyOfstad, @dragnoir, @luacmartins, @ahmedGaber93 eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  18. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Jun 10, 2024
  19. CortneyOfstad commented on Jun 10, 2024

    @CortneyOfstad
    Contributor

    Sorry about that @ahmedGaber93! I'm not sure why the awaiting payment label was not automatically applied, but getting this sorted now!

  20. CortneyOfstad commented on Jun 10, 2024

    @CortneyOfstad
    Contributor

    @ahmedGaber93 you have been paid, so you are all set!

    @dragnoir — I sent you an offer in Upwork! Please let me know once you accept and I'll get that paid ASAP. Thanks!

  21. CortneyOfstad commented on Jun 10, 2024

    @CortneyOfstad
    Contributor

    Payment Summary

    @ahmedGaber93 — paid $250 via Upwork
    @dragnoir — paid $250 via Upwork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions