App icon indicating copy to clipboard operation
App copied to clipboard

[$500] IOU - Padding below total increases for unread messages on mobile devices

Open kbecciv opened this issue 1 year ago • 157 comments

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: 1.3.90.2 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: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1698067716752699

Action Performed:

  1. Open the app and login with user A
  2. Open the app with any other device and login with user B
  3. From user B, send request money to user A
  4. Open user B request money in user A and mark message as unread
  5. Observe the padding between 'total' and 'New' line
  6. Revisit the request money untill 'New' line disappears and now observe the padding between 'total' and line below total

Expected Result:

App should have equal padding below total irrespective of presence of 'New' line

Actual Result:

On mobile devices, padding between total and 'New' line is way more then padding when there is no 'New' line

Workaround:

Unknown

Platforms:

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

  • [x] Android: Native
  • [x] Android: mWeb Chrome
  • [x] iOS: Native
  • [x] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Android: Native

https://github.com/Expensify/App/assets/93399543/c423cdbb-3ac1-4eb8-af75-498b0d6250c3

Android: mWeb Chrome

https://github.com/Expensify/App/assets/93399543/b03f0f45-7820-4581-8c90-c39e124f339f

iOS: Native

https://github.com/Expensify/App/assets/93399543/6f525245-97fc-464d-a2db-70024be49c34

iOS: mWeb Safari

https://github.com/Expensify/App/assets/93399543/803f2b51-f810-4412-8294-b9ac20b7a894

MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0158fbfd6d89166dba
  • Upwork Job ID: 1717212733665116160
  • Last Price Increase: 2023-10-25
  • Automatic offers:
    • situchan | Contributor | 27456744
    • dhanashree-sawant | Reporter | 27456747

kbecciv avatar Oct 25 '23 16:10 kbecciv

Triggered auto assignment to @alexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] avatar Oct 25 '23 16:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~0158fbfd6d89166dba

melvin-bot[bot] avatar Oct 25 '23 16:10 melvin-bot[bot]

Bug0 Triage Checklist (Main S/O)

  • [ ] This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • [ ] This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • [ ] This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • [ ] This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • [ ] I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

melvin-bot[bot] avatar Oct 25 '23 16:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 25 '23 16:10 melvin-bot[bot]

Proposal

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

Padding below total increases for unread messages on mobile devices

What is the root cause of that problem?

The root cause of this problem is found in here: https://github.com/Expensify/App/blob/cc3c51c1d58ce013e444b59bd06c87e4b750e550/src/CONST.ts#L126-L131 The size of the CONTAINER_MINHEIGHT for SMALL_SCREEN is the same as the size of CONTAINER_MINHEIGHT for WIDE_SCREEN.

Furthermore, a discrepancy on the web arises when props.shouldShowHorizontalRule is set to false. The SpacerView component persists within the DOM, causing an undue gap between the unreadIndicator and the total amount.

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

  1. We need to decrease the size of the CONTAINER_MINHEIGHT from 280 to 260 for SMALL_SCREEN sizes. Which fixes the issue on small screens as we are adjusting the min height accordingly.
    The changes should look like this:
  SMALL_SCREEN: {
                IMAGE_HEIGHT: 300,
                CONTAINER_MINHEIGHT: 260, // Update this line 
                VIEW_HEIGHT: 220,
            },
  1. Amend the code snippet at MoneyReportView.js to conditionally render the SpacerView component as follows:
{props.shouldShowHorizontalRule && (
                    <SpacerView
                        shouldShow={props.shouldShowHorizontalRule}
                        style={[props.shouldShowHorizontalRule ? styles.reportHorizontalRule : {}]}
                    />
                )}

Implementing these changes will address the excessive padding issue on both mobile devices and web interfaces by adjusting CONTAINER_MINHEIGHT appropriately and rendering the SpacerView component conditionally when required.

What alternative solutions did you explore? (Optional)

NA

Results

Native

https://github.com/Expensify/App/assets/111440031/6a3e6c19-5f19-4f70-b813-dd854daf7def

Web [web.webm](https://github.com/Expensify/App/assets/111440031/2f40b5f5-8492-47e6-9270-9321b0a4d33b)

Nathan-Mulugeta avatar Oct 25 '23 16:10 Nathan-Mulugeta

Proposal

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

IOU - Padding below total increases for unread messages on mobile devices

What is the root cause of that problem?

We have 2 problems here:

  1. In MoneyRequestView, we're using getReportWelcomeContainerStyle to get the style

https://github.com/Expensify/App/blob/cd851f5f3e5f2e8389688b32b4485d9c3edd2322/src/components/ReportActionItem/MoneyRequestView.js#L163

And we fix the minHeight, in this case, it's 280px

https://github.com/Expensify/App/blob/cd851f5f3e5f2e8389688b32b4485d9c3edd2322/src/styles/StyleUtils.ts#L944

but, if we show the unread marker, the SpacerView will be hidden, so the minHeight at that time should be 260px

  1. We already have the logic to add marginBottom: 8px for the preview. But it's not correct, because we set the top of unread marker is -10px

https://github.com/Expensify/App/blob/414d5913999f69d83ab08b6ae6e03325c9ede549/src/pages/home/report/ReportActionItem.js#L610

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

Solution 1:

  1. If shouldShowHorizontalRule is false, we should minus the minHeight by 20px
            minHeight: emptyStateBackground.SMALL_SCREEN.CONTAINER_MINHEIGHT - (shouldShowHorizontalRule ? 0: 20),
  1. Change styles.mb2 in this line to {marginBottom: 10}

Solution 2:

  • We can show the SpacerView no matter the shouldShowHorizontalRule is to preserve the space, and remove borderColor (divider) if shouldShowHorizontalRule is false

  • Then remove the marginBottom logic here

  • Update top: -20 of UnreadActionIndicator when shouldShowHorizontalRule is true, otherwise top:-10

I prefer the solution 2 because, it not only preserves the space between new line and total, but also the distance between new line and money preview

Result

https://github.com/Expensify/App/assets/113963320/35ec8913-ca40-4c90-8944-bd88dd7e6d1e

tienifr avatar Oct 26 '23 09:10 tienifr

@tienifr, I’ve gone through your proposal, and it seems good overall. Regarding the second solution, my only concern is negative spacing. Generally, avoiding such styles is a good idea as they can lead to inconsistency in the future. What are your thoughts on fixing this issue by avoiding negative spacing?

ArekChr avatar Oct 26 '23 10:10 ArekChr

What are your thoughts on my proposal? @ArekChr

Nathan-Mulugeta avatar Oct 26 '23 10:10 Nathan-Mulugeta

@ArekChr you mean the top: -20 of UnreadActionIndicator? I think we have 2 cases that apply UnreadActionIndicator. The first one is below the created action, in this case, we should hide the horizontal rule -> top: -20 The second one is below the chat action -> top: -10 as what we already did here

tienifr avatar Oct 27 '23 02:10 tienifr

@ArekChr - can you review the responses when you get a chance? Thanks!

alexpensify avatar Oct 30 '23 23:10 alexpensify

@garrettmknight Hello, I am wrapping up some urgent matters today, and I will be OOO from tomorrow to Monday. Can we assign another C+ here so as not to block the task?

ArekChr avatar Oct 31 '23 12:10 ArekChr

I can take over

situchan avatar Oct 31 '23 12:10 situchan

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

melvin-bot[bot] avatar Oct 31 '23 14:10 melvin-bot[bot]

📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Oct 31 '23 14:10 melvin-bot[bot]

Thank you @ArekChr for this update!

@situchan you are assigned now. Let's keep this one moving forward.

alexpensify avatar Oct 31 '23 14:10 alexpensify

@tienifr does your solution also fix web as well?

https://github.com/Expensify/App/assets/108292595/150b26c7-e929-4b4b-8a32-c5a9096f12cc

situchan avatar Oct 31 '23 16:10 situchan

@situchan Yes, did you test my second solution? I prefer the second one, if we apply the first solution, we need to disable animation when the minHeight change. Unfortunately, I didn't find any solutions for that edge case.

I tested the second solution and it worked well (the attached video here)

tienifr avatar Nov 01 '23 02:11 tienifr

Hey @situchan ,have you got the chance to check my proposal. I would love to get a feedback on it please.

Nathan-Mulugeta avatar Nov 01 '23 03:11 Nathan-Mulugeta

@Nathan-Mulugeta your proposal doesn't make sense to me. The diff is not 80px

situchan avatar Nov 01 '23 03:11 situchan

Hello @situchan, I proposed reducing the height by 80px to align it with the Container's minimum height for reports which were not moneyReports, which effectively resolved the issue in those cases. To achieve a more precise adjustment, we could simply set it to 260px, which should work equally well. Changing the container's minimum height seems to be the comprehensive solution to address all these issues with a one line change. Do you have any thoughts or feedback on this approach?

Nathan-Mulugeta avatar Nov 01 '23 03:11 Nathan-Mulugeta

@Nathan-Mulugeta please share 4 screenshots on web/native before/after fix

situchan avatar Nov 02 '23 10:11 situchan

Here you go @situchan:

Native - Before web-before
Native - After web-before
Web - Before web-before
Web - After Web-after

Nathan-Mulugeta avatar Nov 02 '23 13:11 Nathan-Mulugeta

@situchan What do you think about this https://github.com/Expensify/App/issues/30360#issuecomment-1788327745 ?

tienifr avatar Nov 06 '23 02:11 tienifr

@situchan when you get a chance, can you share feedback here for the next steps? Thanks!

alexpensify avatar Nov 07 '23 00:11 alexpensify

@alexpensify @situchan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Nov 08 '23 13:11 melvin-bot[bot]

@Nathan-Mulugeta I meant desktop web

situchan avatar Nov 08 '23 14:11 situchan

Wanna check the padding of unread indicator vs separator line per each platform

situchan avatar Nov 08 '23 14:11 situchan

Ow I see @situchan , here you go then:

Desktop web - Before web-before
Desktop web - After web-after

The desktop web padding remains unchanged before and after the change.

Nathan-Mulugeta avatar Nov 08 '23 15:11 Nathan-Mulugeta

Triggered auto assignment to @puneetlath (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] avatar Nov 09 '23 00:11 melvin-bot[bot]

Bug0 Triage Checklist (Main S/O)

  • [ ] This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • [ ] This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • [ ] This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • [ ] This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • [ ] I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

melvin-bot[bot] avatar Nov 09 '23 00:11 melvin-bot[bot]