App
App copied to clipboard
[$500] IOU - Padding below total increases for unread messages on mobile devices
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:
- Open the app and login with user A
- Open the app with any other device and login with user B
- From user B, send request money to user A
- Open user B request money in user A and mark message as unread
- Observe the padding between 'total' and 'New' line
- 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
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
Triggered auto assignment to @alexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Job added to Upwork: https://www.upwork.com/jobs/~0158fbfd6d89166dba
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
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ArekChr (External
)
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?
- We need to decrease the size of the
CONTAINER_MINHEIGHT
from280
to260
forSMALL_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,
},
- 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)
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:
- 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
- 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:
- If shouldShowHorizontalRule is false, we should minus the minHeight by 20px
minHeight: emptyStateBackground.SMALL_SCREEN.CONTAINER_MINHEIGHT - (shouldShowHorizontalRule ? 0: 20),
- 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
ofUnreadActionIndicator
when shouldShowHorizontalRule is true, otherwisetop:-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, 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?
What are your thoughts on my proposal? @ArekChr
@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
@ArekChr - can you review the responses when you get a chance? Thanks!
@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?
I can take over
📣 @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 📖
📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!
Thank you @ArekChr for this update!
@situchan you are assigned now. Let's keep this one moving forward.
@tienifr does your solution also fix web as well?
https://github.com/Expensify/App/assets/108292595/150b26c7-e929-4b4b-8a32-c5a9096f12cc
@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)
Hey @situchan ,have you got the chance to check my proposal. I would love to get a feedback on it please.
@Nathan-Mulugeta your proposal doesn't make sense to me. The diff is not 80px
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 please share 4 screenshots on web/native before/after fix
Here you go @situchan:
Native - Before
Native - After
Web - Before
Web - After
@situchan What do you think about this https://github.com/Expensify/App/issues/30360#issuecomment-1788327745 ?
@situchan when you get a chance, can you share feedback here for the next steps? Thanks!
@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!
@Nathan-Mulugeta I meant desktop web
Wanna check the padding of unread indicator vs separator line per each platform
Ow I see @situchan , here you go then:
Desktop web - Before
Desktop web - After
The desktop web padding remains unchanged before and after the change.
Triggered auto assignment to @puneetlath (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
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