You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-05-05] [$250] mweb-card-Delete modal have extra bottom margin in card feed page #60019
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
Version Number: V9.1.26-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): Slottwo1 dooriya1@gmail.com Issue reported by: Applause Internal Team Device used: Redminote 10s android 13 App Component: Other
Please re-state the problem that we are trying to solve in this issue.
mweb-card-Delete modal have extra bottom margin in card feed page
What is the root cause of that problem?
The ConfirmModal uses the BOTTOM_DOCKED type when isSmallScreenWidth is true. By default, shouldAddBottomSafeAreaPadding is set to true for BOTTOM_DOCKED, which results in extra bottom.
Please re-state the problem that we are trying to solve in this issue.
Delete card modal has extra spaces on mobile web.
What is the root cause of that problem?
This actually happens to every bottom-docked modal. shouldAddBottomSafeAreaPadding is true for bottom-docked modal and on mobile web, the inset is 0, so it fallbacks to padding top.
This doesn't happen on native because there is an inset value there. The fallback logic was added in #17376 to add extra padding at the bottom of the modal. But adding it based on whether the platform has a bottom inset or not makes it inconsistent.
What changes do you think we should make in order to solve the problem?
We have 2 choices. Add the padding bottom to all platforms by padding the padding bottom here
changed the title [-]mweb-card-Delete modal have extra bottom margin in card feed page[/-][+][$250] mweb-card-Delete modal have extra bottom margin in card feed page[/+]on Apr 10, 2025
Please re-state the problem that we are trying to solve in this issue.
There is an unexpected extra bottom margin appearing in the modal on the card feed page, causing incorrect spacing in the layout.
What is the root cause of that problem?
I took a look at your current implementation, and I believe the unexpected margin issue in the modal may be occurring because you're using Dimensions.get('window') from the variables object, which returns static dimensions that do not update when the screen changes (e.g., device rotation or resizing).
This can cause incorrect layout calculations leading to extra spacing or margins.
React Native provides the built-in hook useWindowDimensions, which automatically updates dimensions and triggers re-renders when window dimensions change, ensuring responsive layouts remain accurate across different devices or orientations.
It seems you are already using this hook in other places, but not here.
What changes do you think we should make in order to solve the problem?
Replace the use of the static Dimensions.get('window') calls with the React-provided hook useWindowDimensions().
Update the component logic to depend on dynamic values from this hook, ensuring consistent behavior and layout calculations.
This should immediately resolve the extra margin issue you're seeing, especially if it's related to dynamic window dimension changes.
I've implemented similar responsive solutions extensively in my own React Native applications, and this fix should be straightforward, effective, and maintainable.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Verify that the modal displays correct margins on different device sizes (small, medium, and large screens).
Test device rotation (portrait to landscape) to confirm that margins stay consistent after dimension changes.
Simulate dynamic resizing (especially on web and tablet layouts) and ensure no extra margins appear.
What alternative solutions did you explore? (Optional)
An alternative approach could be to manually add event listeners for dimension changes and force updates manually, but using useWindowDimensions() is the cleaner, more reliable, and standard approach in React Native.
📣 @inwake! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
⚠️@inwake Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] 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:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: not critical minor UI issue
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. No need minor spacing issue blocks no functionality
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
Activity
melvin-bot commentedon Apr 10, 2025
Triggered auto assignment to @maddylewis (
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.linhvovan29546 commentedon Apr 10, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
mweb-card-Delete modal have extra bottom margin in card feed page
What is the root cause of that problem?
The
ConfirmModaluses theBOTTOM_DOCKEDtype whenisSmallScreenWidthis true. By default,shouldAddBottomSafeAreaPaddingis set totrueforBOTTOM_DOCKED, which results in extra bottom.App/src/components/ConfirmModal.tsx
Line 163 in 248f253
App/src/styles/utils/generators/ModalStyleUtils.ts
Line 215 in 248f253
What changes do you think we should make in order to solve the problem?
We should conditionally set shouldAddBottomSafeAreaPadding to false on MWeb(or only for mobile chrome):
App/src/styles/utils/generators/ModalStyleUtils.ts
Line 215 in 248f253
Note: On iOS MWeb, there’s also a slight extra bottom margin, so we can use
isMobile()for consistency mweb.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None, UI bug
What alternative solutions did you explore? (Optional)
https://github.com/Expensify/App/blob/main/src/components/ConfirmModal.tsx#L163
bernhardoj commentedon Apr 10, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Delete card modal has extra spaces on mobile web.
What is the root cause of that problem?
This actually happens to every bottom-docked modal.
shouldAddBottomSafeAreaPaddingis true for bottom-docked modal and on mobile web, the inset is 0, so it fallbacks to padding top.App/src/styles/utils/index.ts
Lines 606 to 613 in bf6f3d6
App/src/styles/utils/generators/ModalStyleUtils.ts
Lines 197 to 215 in bf6f3d6
This doesn't happen on native because there is an inset value there. The fallback logic was added in #17376 to add extra padding at the bottom of the modal. But adding it based on whether the platform has a bottom inset or not makes it inconsistent.
What changes do you think we should make in order to solve the problem?
We have 2 choices. Add the padding bottom to all platforms by padding the padding bottom here
App/src/styles/utils/generators/ModalStyleUtils.ts
Lines 197 to 215 in bf6f3d6
Or remove the fallback bottom padding.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
[-]mweb-card-Delete modal have extra bottom margin in card feed page[/-][+][$250] mweb-card-Delete modal have extra bottom margin in card feed page[/+]melvin-bot commentedon Apr 10, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021910415189943815409
melvin-bot commentedon Apr 10, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ishpaul777 (
External)inwake commentedon Apr 10, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-10 21:22:27 UTC.
Contributor details
Expensify account email: vitaliy@inwake.io
Upwork Profile Link: https://www.upwork.com/freelancers/vitaliyd33
Proposal
Please re-state the problem that we are trying to solve in this issue.
There is an unexpected extra bottom margin appearing in the modal on the card feed page, causing incorrect spacing in the layout.
What is the root cause of that problem?
I took a look at your current implementation, and I believe the unexpected margin issue in the modal may be occurring because you're using
Dimensions.get('window')from the variables object, which returns static dimensions that do not update when the screen changes (e.g., device rotation or resizing).This can cause incorrect layout calculations leading to extra spacing or margins.
React Native provides the built-in hook
useWindowDimensions, which automatically updates dimensions and triggers re-renders when window dimensions change, ensuring responsive layouts remain accurate across different devices or orientations.It seems you are already using this hook in other places, but not here.
What changes do you think we should make in order to solve the problem?
Dimensions.get('window')calls with the React-provided hookuseWindowDimensions().This should immediately resolve the extra margin issue you're seeing, especially if it's related to dynamic window dimension changes.
I've implemented similar responsive solutions extensively in my own React Native applications, and this fix should be straightforward, effective, and maintainable.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
An alternative approach could be to manually add event listeners for dimension changes and force updates manually, but using
useWindowDimensions()is the cleaner, more reliable, and standard approach in React Native.melvin-bot commentedon Apr 10, 2025
📣 @inwake! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
github-actions commentedon Apr 10, 2025
27 remaining items
maddylewis commentedon May 1, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
maddylewis commentedon May 1, 2025
Payment Summary + Final To-Dos
bernhardoj commentedon May 2, 2025
Requested in ND.
melvin-bot commentedon May 5, 2025
Payment Summary
Upwork Job
BugZero Checklist (@maddylewis)
JmillsExpensify commentedon May 5, 2025
$250 approved for @bernhardoj
ishpaul777 commentedon May 7, 2025
will fill checklist today
melvin-bot commentedon May 8, 2025
@maddylewis Whoops! This issue is 2 days overdue. Let's get this updated quick!
ishpaul777 commentedon May 8, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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/17495/files#r2080307755
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: not critical minor UI issue
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. No need minor spacing issue blocks no functionality
melvin-bot commentedon May 12, 2025
@maddylewis 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
garrettmknight commentedon Jun 3, 2025
$250 approved for @ishpaul777