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

[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
1 of 6 tasks
m-natarajan opened this issue Jul 10, 2024 · 28 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Jul 10, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

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.

@devguest07
Copy link
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?

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jul 10, 2024

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jul 10, 2024

@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

@shawnborton
Copy link
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

@Krishna2323
Copy link
Contributor

Proposal Updated

  • Added alternative

@isabelastisser isabelastisser added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Jul 11, 2024
@melvin-bot melvin-bot bot 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 Jul 11, 2024
Copy link

melvin-bot bot commented Jul 11, 2024

Job added to Upwork: https://www.upwork.com/jobs/~019496a7990ed69c3c

Copy link

melvin-bot bot commented Jul 11, 2024

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

@dominictb
Copy link
Contributor

Proposal

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

  • 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.

What is the root cause of that problem?

  • Basically, we have three types of row:
  1. Row when transactions.length is 1. See component.

  2. Header row when transactions.length > 1. See component.

  3. Child row when transactions.length > 1. See component.

  • Our bug is related to row 3. With the row 1 and row 2, we already have a logic to get their color style based on the isSelected and isFocus state:

For row 1:

const listItemPressableStyle = [styles.selectionListPressableItemWrapper, styles.pv3, styles.ph3, item.isSelected && styles.activeComponentBG, isFocused && styles.sidebarLinkActive];

For row 2:

const listItemPressableStyle = [styles.selectionListPressableItemWrapper, styles.pv3, item.isSelected && styles.activeComponentBG, isFocused && styles.sidebarLinkActive];

  • As we can see, both of them have background color style isSelected && styles.activeComponentBG, isFocused && styles.sidebarLinkActive, but the row 3 is not.

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

  • We can create a function to get the color style for the row:
    const getRowColorStyle = (isSelected: boolean, isFocused: boolean) => {
        return [isSelected && styles.activeComponentBG, isFocused && styles.sidebarLinkActive];
    };

and we can use it for all the row types to keep the consistency among them and make sure we DRY the logic.

                    <View style={[...getRowColorStyle(transaction.isSelected ?? false, false), styles.ph4, styles.pv2]}>
                        <TransactionListItemRow
                            item={transaction}
                            showTooltip={showTooltip}
                            onButtonPress={() => {
                                openReportInRHP(transaction);
                            }}
                            onCheckboxPress={() => onCheckboxPress?.(transaction as unknown as TItem)}
                            showItemHeaderOnNarrowLayout={false}
                            isChildListItem
                            isDisabled={!!isDisabled}
                            canSelectMultiple={!!canSelectMultiple}
                            isButtonSelected={item.isSelected}
                        />
                    </View>
  • Then, update the row 1 and row 2 to use the getRowColorStyle as well.
  • With the above change, add theisLargeScreenWidth check to make sure the UI is not changed in !isLargeScreenWidth device.

What alternative solutions did you explore? (Optional)

@isabelastisser
Copy link
Contributor

Hey @ishpaul777, can you please review the proposals above? Thanks!

@ishpaul777
Copy link
Contributor

ishpaul777 commented Jul 12, 2024

i was on it already : ) will give a proposal recommendation in few minutes

@ishpaul777
Copy link
Contributor

ishpaul777 commented Jul 12, 2024

@Krishna2323's Alternative Proposal Looks most complete (referencing mockup here) and good to me 👍

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jul 12, 2024

Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 12, 2024
Copy link

melvin-bot bot commented Jul 12, 2024

📣 @ishpaul777 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Jul 12, 2024

📣 @Krishna2323 🎉 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 📖

@isabelastisser isabelastisser added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 18, 2024
Copy link

melvin-bot bot commented Jul 18, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 18, 2024
@isabelastisser
Copy link
Contributor

I will be OOO tomorrow and next week, so I am reassigning this until I return on July 29. Thanks, @sakluger!

Status: PR Review/merge.

@isabelastisser isabelastisser self-assigned this Jul 18, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 26, 2024
@melvin-bot melvin-bot bot changed the title [$250] Individually selected expense rows in grouped reports don't have a background color applied to them [HOLD for payment 2024-08-02] [$250] Individually selected expense rows in grouped reports don't have a background color applied to them Jul 26, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 26, 2024
Copy link

melvin-bot bot commented Jul 26, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jul 26, 2024

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:

Copy link

melvin-bot bot commented Jul 26, 2024

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:

@isabelastisser
Copy link
Contributor

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Aug 1, 2024
@Krishna2323
Copy link
Contributor

@isabelastisser, can you please process the payments 🙏🏻

@melvin-bot melvin-bot bot removed the Overdue label Aug 5, 2024
@isabelastisser
Copy link
Contributor

The payments were processed in Upwork.

@isabelastisser
Copy link
Contributor

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

@ishpaul777
Copy link
Contributor

ishpaul777 commented Aug 5, 2024

[@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

@isabelastisser
Copy link
Contributor

All set!

@github-project-automation github-project-automation bot moved this from Release 1: Spring 2024 (May) to Done in [#whatsnext] #wave-collect Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: Done
Development

No branches or pull requests

9 participants