Skip to content

Fix uneven spacing between the Date and Report fields on the expense form - #103366

Merged
jasperhuangg merged 2 commits into
mainfrom
claude-fixDateReportFieldSpacing
Oct 20, 2026
Merged

jasperhuangg merged 2 commits into
mainfrom
claude-fixDateReportFieldSpacing

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

On the bordered expense forms (Manual, Scan, Distance, Per Diem, Time), the gap between the Date field and the next row was 24px instead of 16px. DatePicker already adds 8px of vertical margin, and each bordered ExpenseFieldRow adds its own 8px. The Date wrapper's extra mb2 added a third 8px.

This change drops the wrapper's mb2 only when shouldUseDropdownRows is true. The invoice form still uses rows without margins, so it keeps the mb2 and its spacing doesn't change.

This re-lands the DateField half of #102640, which was reverted. The revert was caused by that PR's ScanFooter change (the To-to-receipt gap jumping after "Show more"). This PR doesn't touch ScanFooter.

Fixed Issues

$ #102791
PROPOSAL:

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Go to ND
  2. Click + Create expense > manual
  3. Verify: Space between the date and report field in the Create expense flow should be 16px instead of 24px
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

…orms

Co-authored-by: truph01 <truph01@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team October 7, 2026 17:42
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Oct 7, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-fixDateReportFieldSpacing
git checkout -b claude-fixDateReportFieldSpacing upstream/claude-fixDateReportFieldSpacing
git push -u origin claude-fixDateReportFieldSpacing

Then you can close this PR and open a new one from your fork.

@MelvinBot

MelvinBot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ✅ pass

On the Manual expense form, the gap between the Date row and the Report row is 42px (16dp), the same as every other gap between rows. No larger gap remains below Date. The PR's Tests section is empty, so I used the steps from the linked issue.
Manual expense confirmation form with evenly spaced Date and Report rows

Step Status
Sign in and confirm the account has a workspaceAfter sign-in and onboarding, the Workspaces tab shows one Default workspace owned by the test account.
Workspaces list showing one Default workspace owned by the test account
✅
+ > Create expense > Manual > enter amount > confirmation form shows Date and Report fieldsEntered an amount of 25. The form shows Amount, Merchant, Description, Category, Date (2026-10-07), Report (New report), and Reimbursable rows.
Manual expense confirmation form with evenly spaced Date and Report rows
✅
Gap between Date and Report matches the gaps between other rowsRow bounds from the UI hierarchy (420dpi, 2.625px per dp): Amount→Merchant 42px, Merchant→Description 42px, Description→Category 42px, Category→Date 42px, Date→Report 42px. All gaps are 16dp. None is 63px (24dp).
Manual expense confirmation form with evenly spaced Date and Report rows
✅

view run · view recording

@MelvinBot

MelvinBot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

On the Manual expense form, the gap below Date looks the same as the other row gaps, with no enlarged gap. I couldn't measure the exact pixel gap or read the JS console on web, so those two steps are visual and indirect checks only.
Manual expense confirmation form showing Category, Date, Report, and Reimbursable rows

Step Status
Account has a workspaceOnboarding created a Collect workspace, shown on the Workspace Overview page.
Workspace Overview page showing the auto-created workspace
✅
+ > Create expense > Manual > enter amount > confirmation form shows Date and Report fieldsThe form shows Amount, Merchant, Description, Category, Date, Report, and Reimbursable rows. Report only appears once the workspace already has a draft report, so this was the second test expense.
Manual expense confirmation form showing Category, Date, Report, and Reimbursable rows
✅
Gap between Date and Report is 16px and matches the other row gapsAll row gaps look the same in the screenshot, with no larger gap below Date. The web test tool can't read element positions, so I didn't confirm the exact 16px value.
Manual expense confirmation form showing Category, Date, Report, and Reimbursable rows
⚠️
No errors in the JS consoleThe web test tool can't read console logs. Every network request in the flow returned 200, and no error screens appeared.
⚠️

view run · view recording

@truph01

truph01 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Merge main and mark this PR as ready

…ieldSpacing

Co-authored-by: truph01 <truph01@users.noreply.github.com>
@MelvinBot
MelvinBot marked this pull request as ready for review October 12, 2026 12:32
@MelvinBot
MelvinBot requested a review from a team as a code owner October 12, 2026 12:32
@melvin-bot
melvin-bot Bot requested a review from truph01 October 12, 2026 12:32
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I merged main into this branch and marked the PR as ready for review.

  • The merge had no conflicts. It was pushed as commit 2cb54a4.

@melvin-bot
melvin-bot Bot requested review from garrettmknight and removed request for a team October 12, 2026 12:32
@melvin-bot

melvin-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

@truph01 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team October 12, 2026 12:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T12:34:46.169927Z 2cb54a4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing check is unrelated to this PR, so I didn't push a fix.

Analysis: test (job 7) fails in IOURequestStepConfirmationPageTest › Report selection guard tests › should use the transaction report when it is allowed, even if it differs from the route. The test expected requestMoney to get report 202 but got undefined. This PR only removes a bottom margin in DateField.tsx. That change can't affect which report is passed to requestMoney.

Evidence
  • Files changed: only src/components/MoneyRequestConfirmationList/sections/DateField.tsx (one style change).
  • Failure location: tests/ui/components/IOURequestStepConfirmationPageTest.tsx:1691, a report-selection assertion.
  • This branch, before merging main: the Jest workflow passed on commit 658b6196 with the same DateField change.
  • After merging main: it failed on 2cb54a4d.
  • Another PR failed in the same test block at the same time: the fix-distance-preview-header-mismatch-100188 branch failed on Report selection guard tests › should fallback to route report when transaction report matches the route and is not usable.

Next step: re-run the failed job. If it still fails, the report-selection tests are broken or flaky on main and need a separate fix.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing test (job 7) check is a flaky test, not a problem in this PR. I didn't push a fix because no code change is needed.

What to do: re-run the failed job from the run page. I tried, but I don't have permission to re-run jobs in this environment.

Evidence the test is flaky
  • Failing test: IOURequestStepConfirmationPageTest › Report selection guard tests › should use the transaction report when it is allowed, even if it differs from the route.
  • This PR's change: one style change in DateField.tsx. It passed Jest on Oct 7 and failed only after main was merged in.
  • Another PR, same test block: the fix-distance-preview-header-mismatch-100188 branch failed a sibling test on commit 898418ab. Its next commit, 19b66237, only fixed a lint error in TransactionUtils/index.ts. Jest then passed without any change to the test or report-selection code.
  • No fix on main: nothing has changed the test file or IOURequestStepConfirmation.tsx since Oct 8.

@truph01

truph01 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained """"why"""" the code was doing something instead of only explaining """"what"""" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-10-13.at.15.27.37.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-13.at.15.13.59.mov

@melvin-bot

melvin-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #102791 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

@melvin-bot
melvin-bot Bot requested a review from jasperhuangg October 13, 2026 08:28
@truph01

truph01 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Fill out the QA test section in your checklist

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing check is still unrelated to this PR, so I didn't push a fix. Re-running the failed job should clear it.

Analysis: test (job 7) still shows the same failed run from yesterday. That run failed on IOURequestStepConfirmationPageTest › Report selection guard tests › should use the transaction report when it is allowed, even if it differs from the route. This PR only changes a margin in DateField.tsx, which can't affect which report is passed to requestMoney.

Evidence
  • Same failure on an unrelated PR today: the perf/header-view-stable-report branch failed the exact same test this morning.
  • This branch passed before merging main: the Jest workflow passed on 658b6196 with the same DateField change.
  • No fix on main yet: the test file is unchanged between this PR's head (2cb54a4d) and current main, so merging main won't help.

Next step: re-run the failed job here. I don't have permission to trigger re-runs from this session. If the test keeps failing across PRs, it needs a separate fix on main.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I filled out the QA Steps section in the PR description. The steps cover:

  • The Date-to-Report gap on the Manual, Scan, Distance, Per diem, and Time confirmation pages. It should now be 16px instead of 24px.
  • Regression checks for the Scan Show more spacing and the invoice form. Both should match production.

I left the Tests section and the author checklist for you to complete, because they record testing you ran yourself.

@truph01

truph01 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Update QA tests to:

1. Go to ND
2. Click + Create expense > manual
3. Verify: Space between the date and report field in the Create expense flow should be 16px instead of 24px

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I updated the QA Steps in the PR description to:

  1. Go to ND
  2. Click + Create expense > manual
  3. Verify: Space between the date and report field in the Create expense flow should be 16px instead of 24px

I kept the "Verify that no errors appear in the JS console" checkbox. I removed the old Scan, Distance, Per diem, Time, and invoice steps.

@garrettmknight garrettmknight left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from a product perspective.

@truph01

truph01 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

@jasperhuangg All yours

@jasperhuangg
jasperhuangg merged commit f6f2504 into main Oct 20, 2026
55 of 58 checks passed
@jasperhuangg
jasperhuangg deleted the claude-fixDateReportFieldSpacing branch October 20, 2026 18:59
@github-actions

Copy link
Copy Markdown
Contributor

🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.5.15-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update is needed. This PR only reduces the spacing below the Date field on the expense forms, a visual fix that doesn't change any feature, label, or step described in the help articles.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.5.15-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants