Skip to content

[HOLD for payment 2024-08-02] [$250] Individually selected expense rows in grouped reports don't have a background color applied to them #45190

Closed

Description

@m-natarajan

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: 9.0.6-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: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1720629341208869

Action Performed:

Precondition: User have some shared group expenses in a report

  1. Go to staging.new.expensify.com
  2. Click Search in bottom navigation
  3. Click "Shared" > Click check box on any one of the grouped expenses

Expected Result:

Selected expense in a group, should get a background color the same way that it does if it's a single expense row that isn't grouped is selected.

Actual Result:

When you select an expense in a group, it doesn't get a background color the same way that it does if it's a single expense row that isn't grouped.

Workaround:

Unknown

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

CleanShot 2024-07-10 at 18 34 51@2x

CleanShot 2024-07-10 at 18 37 50@2x

Recording.309.mp4

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019496a7990ed69c3c
  • Upwork Job ID: 1811217903802904544
  • Last Price Increase: 2024-07-11
  • Automatic offers:
    • ishpaul777 | Reviewer | 103099448
    • Krishna2323 | Contributor | 103099449
Issue OwnerCurrent Issue Owner: @sakluger / @isabelastisser

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 10, 2024
  2. melvin-bot commented on Jul 10, 2024

    @melvin-bot

    Triggered auto assignment to @isabelastisser (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.

  3. devguest07 commented on Jul 10, 2024

    @devguest07
    Contributor

    Proposal

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

    In grouped expense reports, individually selected rows lack a consistent background color, impacting visual clarity and user experience.

    What is the root cause of that problem?

    The current implementation applies a background color only to the ReceiptCell when a row is selected, as seen in the TransactionListItemRow component:

    const backgroundStyles = transactionItem.isSelected ? StyleUtils.getBackgroundColorStyle(theme.buttonHoveredBG) : StyleUtils.getBackgroundColorStyle(theme.border);

    However, this styling is not applied to the entire row, leading to inconsistent visual feedback.

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

    1. Extend the selection styling to the entire row:

    2. Enhance small screen compatibility:

      • Apply the same selection styling logic to small screen row components.
      • Adjust the row component structure to ensure the background color covers the entire row area.
    3. Refine component structure:

      • Review and potentially refactor the component hierarchy to facilitate consistent background application across all row elements.
    4. Implement responsive design:

      • Ensure the selection styling adapts smoothly to different screen sizes and orientations.

    What alternative solutions did you explore?

  4. Krishna2323 commented on Jul 10, 2024

    @Krishna2323
    Contributor

    Proposal

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

    Individually selected expense rows in grouped reports don't have a background color applied to them

    What is the root cause of that problem?

    TransactionListItemRow is rendered without any styling and wrapper and item.isSelected is provided to isButtonSelected prop instead of transaction.isSelected

    <TransactionListItemRow
    item={transaction}
    showTooltip={showTooltip}
    onButtonPress={() => {
    openReportInRHP(transaction);
    }}
    onCheckboxPress={() => onCheckboxPress?.(transaction as unknown as TItem)}
    showItemHeaderOnNarrowLayout={false}
    containerStyle={styles.mt3}
    isChildListItem
    isDisabled={!!isDisabled}
    canSelectMultiple={!!canSelectMultiple}
    isButtonSelected={item.isSelected}
    />

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

    We need to make several changes:

    1. We should wrap the TransactionListItemRow's in a View and use gap for spacing in between and remove margin top from containerStyle prop.
    2. For isButtonSelected prop we should pass transaction.isSelected.
    3. We should use containerStyle prop to style each item when transaction.isSelected is true.
    <View style={{gap: 12, marginTop: 12}}>
        {reportItem.transactions.map((transaction) => (
            <TransactionListItemRow
                item={transaction}
                showTooltip={showTooltip}
                onButtonPress={() => {
                    openReportInRHP(transaction);
                }}
                onCheckboxPress={() => onCheckboxPress?.(transaction as unknown as TItem)}
                showItemHeaderOnNarrowLayout={false}
                containerStyle={transaction.isSelected && styles.activeComponentBG}
                isChildListItem
                isDisabled={!!isDisabled}
                canSelectMultiple={!!canSelectMultiple}
                isButtonSelected={transaction.isSelected}
            />
        ))}
    </View>

    What alternative solutions did you explore? (Optional)

    1. We can remove horizontal padding from parent container BaseListItem and apply it to child items (ExpenseItemHeaderNarrow, TransactionListItemRow and View containing the report details, List item separtor).
    2. Use transaction.isSelected to apply styles.activeComponentBG in TransactionListItemRow.

    There also some minor changes required like removing padding from parent component and applying only padding top, adding styles.overflowHidden, to listItemPressableStyle but I believe this can be handle in the PR phase.

                        {reportItem.transactions.map((transaction) => (
                            <TransactionListItemRow
                                item={transaction}
                                showTooltip={showTooltip}
                                onButtonPress={() => {
                                    openReportInRHP(transaction);
                                }}
                                onCheckboxPress={() => onCheckboxPress?.(transaction as unknown as TItem)}
                                showItemHeaderOnNarrowLayout={false}
                                containerStyle={[transaction.isSelected && styles.activeComponentBG, styles.ph3, styles.pv2]}
                                isChildListItem
                                isDisabled={!!isDisabled}
                                canSelectMultiple={!!canSelectMultiple}
                                isButtonSelected={transaction.isSelected}
                            />
                        ))}

    Result

    fixed_row_updated.mp4
  5. Krishna2323 commented on Jul 10, 2024

    @Krishna2323
    Contributor

    @shawnborton, what do you think about inner padding when a list item is selected?

    fixed_row.mp4

    We can remove padding from parent container and apply it to child items. Is this the expected behaviour?

    remove_parent_padding_2.1.mp4
  6. shawnborton commented on Jul 10, 2024

    @shawnborton
    Contributor

    We can remove padding from parent container and apply it to child items.

    Yup, I agree with this - we'd want it to look like this mockup here:
    image

  7. Krishna2323 commented on Jul 10, 2024

    @Krishna2323
    Contributor

    Proposal Updated

    • Added alternative
  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 11, 2024
  9. changed the title [-]Individually selected expense rows in grouped reports don't have a background color applied to them[/-] [+][$250] Individually selected expense rows in grouped reports don't have a background color applied to them[/+] on Jul 11, 2024
  10. melvin-bot commented on Jul 11, 2024

    @melvin-bot
  11. melvin-bot commented on Jul 11, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @ishpaul777 (External)

  12. 32 remaining items

  13. melvin-bot commented on Jul 26, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.12-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2024-08-02. 🎊

    For reference, here are some details about the assignees on this issue:

  14. melvin-bot commented on Jul 26, 2024

    @melvin-bot

    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:

    • [@ishpaul777] The PR that introduced the bug has been identified. Link to the PR:
    • [@ishpaul777] 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:
    • [@ishpaul777] 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:
    • [@ishpaul777] Determine if we should create a regression test for this bug.
    • [@ishpaul777] 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.
    • [@sakluger / @isabelastisser] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  15. isabelastisser commented on Jul 29, 2024

    @isabelastisser
    Contributor

    I'm back, taking this. Thanks, @sakluger !

  16. Krishna2323 commented on Aug 5, 2024

    @Krishna2323
    Contributor

    @isabelastisser, can you please process the payments 🙏🏻

  17. isabelastisser commented on Aug 5, 2024

    @isabelastisser
    Contributor

    The payments were processed in Upwork.

  18. isabelastisser commented on Aug 5, 2024

    @isabelastisser
    Contributor

    @ishpaul777, can you please complete the BZ checklist before we can close this issue? Thanks!

  19. ishpaul777 commented on Aug 5, 2024

    @ishpaul777
    Contributor

    [@ishpaul777] The PR that introduced the bug has been identified. Link to the PR:
    #44385
    [@ishpaul777] 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: https://github.com/Expensify/App/pull/44385/files#r1704375865
    [@ishpaul777] 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: No need
    [@ishpaul777] Determine if we should create a regression test for this bug. - no this was just design changes
    [@ishpaul777] 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. - N/A

  20. isabelastisser commented on Aug 6, 2024

    @isabelastisser
    Contributor

    All set!

  21. moved this from Release 1: Spring 2024 (May) to Done in [#whatsnext] #wave-collecton Aug 6, 2024
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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions