Skip to content

[Payment due @ZhenjaHorbach] fix(DynamicForm): Give every input the same spacing as its neighbors - #105382

Merged
grgia merged 4 commits into
Expensify:mainfrom
software-mansion-labs:dariusz-biela/fix/dynamic-form-spacing
Nov 2, 2026
Merged

grgia merged 4 commits into
Expensify:mainfrom
software-mansion-labs:dariusz-biela/fix/dynamic-form-spacing

Conversation

@dariusz-biela

@dariusz-biela dariusz-biela commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

A quick fix for the extra space between fields in DynamicForm, reported in #104741 (comment) (the gap between the phone number and the address in the business representative form). DynamicForm already spaces every row by itself, but some shared inputs it renders add their own outer margin on top of that. This PR removes those margins inside DynamicForm only.

In the app

  • In every DynamicForm, a date field, an address (including its city), and a tabs selector now sit 16px from their neighbors, the same as any other text input. Before, the date picker was 24px from its neighbors, the street started 40px below a text input (48px below a date field), and the city sat 24px below the street.
  • The tabs selector lines up with the input edges. It no longer adds a 20px side inset or extra bottom padding, and its prompt label now sits 12px above the tabs instead of touching them.
  • The address and wallet additional details forms that are outside DynamicForm look the same as before (screenshots below are pixel-identical).

In the code

  • AddressFormFields no longer puts a top margin on the street field. AddressStep and AdditionalDetailsStep pass that margin as containerStyles instead, so they keep their current look. A new cityContainerStyles prop keeps the city 24px below the street by default, and DynamicForm sets it to 16px.
  • The DynamicForm date renderer sets wrapperStyle={styles.mv0} on DatePicker, and adjusts the push row picker margins to match other push rows.
  • TabsAdapter drops its own bottom margin and clears the TabSelectorBase content padding with contentContainerStyles.
  • DynamicFormFieldRow adds the bottom margin under a prompt label only when the row is not a menu row.

Quick fix, not the full solution

  • This PR only touches DynamicForm and the AddressFormFields margin it needed. The root cause is wider: many shared form inputs (address fields, date picker, tab selector, radio buttons) set their own outer margins, so every form that uses them has to fight those margins.
  • refactor(forms): give every form one vertical spacing rhythm #105377 fixes that for every form in the app by giving forms one vertical spacing rhythm owned by layout gaps. At some point the form components across the whole app should be fixed that way, and the overrides added here can then go away.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/696486
PROPOSAL:

Tests

The flow needs an account on the wiseReimbursements beta with an eligible bank account (USD, business, open, not on Corpay).

Please expand this if you don't have access to such an account:

Without an account on the beta

Paste this in the browser console (web) or run it through the JS debugger (native):

Onyx.merge('betaOverrides', {wiseReimbursements: true});
Onyx.merge('bankAccountList', {'9053192': {accountType: 'bankAccount', bankCurrency: 'USD', bankCountry: 'US', title: 'Boulder Development Inc.', description: 'Account ending in 1234', methodID: 9053192, accountData: {bankAccountID: 9053192, addressName: 'Boulder Development Inc.', accountNumber: 'XXXX1234', state: 'OPEN', type: 'BUSINESS', additionalData: {currency: 'USD', country: 'US'}}}});
  1. Fill Profile > Private with a legal name, phone number, date of birth and address
  2. Go to Account > Wallet and press Get started on the "Pay people worldwide" banner, then Get started on the intro page
  3. On the representative page, verify that the phone number, date of birth, SSN, address street and city fields are spaced the same as any other two inputs, with no extra space above the date of birth, the address street or the city
  4. Type 123456789 as the SSN, upload an image as the ID and press Next
  5. Verify that the business info page looks the same as on main
  6. Go to Account > Wallet > Enable wallet and reach the Additional details page, and verify that the address fields look the same as on main
  7. In Storybook, open the Components/DynamicForm stories and verify that the date, address, tabs and amount with currency fields are spaced the same as the other inputs, and that the tabs line up with the input edges
  • Verify that no errors appear in the JS console

Offline tests

N/A - this PR only changes styles, there are no API or Onyx changes.

QA Steps

Same as tests

  • 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 verified any copy / text that was added to the app 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 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 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

Storybook stories on web (Chrome).

Changed

Business representative form (reported in the comment)
Before After
Tabs, radio buttons and amount
Before After
All field types
Before After
Bank account flow
Before After
Flat fields flow
Before After
Amount with currency
Before After

Unchanged (pixel-identical)

Business onboarding flow
Before After
Yes / No question
Before After
Owners list
Before After
`AddressStep` (outside DynamicForm)
Before After
Wallet additional details (outside DynamicForm)
Before After

The field rows already space inputs 16px apart, but some inputs added their
own outer margins on top of that. The street address input carried 24px from
AddressFormFields, so an address sat 40-48px below the field above it.
DatePicker added 8px on each side. TabSelector kept the bottom and side
padding it uses at the top of a page, which pushed the tabs 20px in from the
input edges, and the tab question touched the tabs.

AddressFormFields no longer puts a margin above the street. Its two other
callers pass the same margin as containerStyles, so they look the same.
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

AddressFormFields put the city 24px below the street, while every other pair
of inputs in DynamicForm is 16px apart. The city margin is now a prop that
DynamicForm sets to 16px. AddressStep and AdditionalDetailsStep keep the 24px
default, so they look the same.
@dariusz-biela
dariusz-biela marked this pull request as ready for review October 29, 2026 17:00
@dariusz-biela
dariusz-biela requested review from a team as code owners October 29, 2026 17:00
@melvin-bot
melvin-bot Bot requested review from ZhenjaHorbach and removed request for a team October 29, 2026 17:00
@melvin-bot

melvin-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

@ZhenjaHorbach 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]

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T17:21:25.838162Z fe3ea9b 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.

@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and removed request for a team October 29, 2026 17:00
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@ZhenjaHorbach

ZhenjaHorbach commented Oct 30, 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 any copy / text that was added to the app 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 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
    • 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
    • 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 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).
  • 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-30.at.12.09.39.mov
Android: mWeb Chrome
Screen.Recording.2026-10-30.at.12.06.28.mov
iOS: HybridApp
Screen.Recording.2026-10-30.at.12.09.39.mov
iOS: mWeb Safari
Screen.Recording.2026-10-30.at.12.06.28.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-30.at.12.02.26.mov

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

It's not a bug
But looks a bit annoying that we have different paddings between Country - Social number input and State - zip code input

But since the Social number input is another block
I think it's okay

Screenshot 2026-10-30 at 11 58 38

@melvin-bot
melvin-bot Bot requested a review from grgia October 30, 2026 11:10
@melvin-bot melvin-bot Bot changed the title fix(DynamicForm): Give every input the same spacing as its neighbors [Payment due @ZhenjaHorbach] fix(DynamicForm): Give every input the same spacing as its neighbors Oct 30, 2026
@melvin-bot

melvin-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

🎯 @ZhenjaHorbach, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - https://www.github.com/Expensify/Expensify/issues/696486.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

But LGTM

@grgia grgia 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.

LGTM, going to add @dubielzyk-expensify

@dariusz-biela

Copy link
Copy Markdown
Contributor Author

It's not a bug
But looks a bit annoying that we have different paddings between Country - Social number input and State - zip code input

But since the Social number input is another block
I think it's okay

Thank you, I didn't notice it, but for now I'd skip it. Especially since we ultimately want to replace it with regular input select elements with dropdowns https://github.com/Expensify/Expensify/issues/696389.

@joekaufmanexpensify joekaufmanexpensify 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.

LGTM

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

What's going on at 0:24 in this video. Is the footer button not fixed? It seems to kinda just appear.

Also for all the storybook screenshots in the original post, none of them are using the right font I think?

If these are all expected, then continue on :)

@ZhenjaHorbach

ZhenjaHorbach commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What's going on at 0:24 in this video. Is the footer button not fixed? It seems to kinda just appear.

More like a freezing of the video 😅

@grgia

grgia commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

merge main for performance tests?

@dariusz-biela

Copy link
Copy Markdown
Contributor Author

@grgia I think it is ready for merge

What's going on at 0:24 in #105382 (comment). Is the footer button not fixed? It seems to kinda just appear.

More like a freezing of the video 😅

I think so too. Just to be on the safe side, I went through the entire flow, and nothing alarming happened.

@grgia
grgia merged commit ec63fdf into Expensify:main Nov 2, 2026
35 checks passed
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #105382 with the pinned Mobile-Expensify submodule.

Android 🤖 iOS 🍎
https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-android-Adhoc-ec63fdfb-9e12557-c766f9b7418f67c36d5e913c815bd1c9dbf4448a/index.html ❌ FAILED ❌
Android The QR code can't be generated, because the iOS build failed
Web 🕸️
https://105382.pr-testing.expensify.com
Web

👀 View the workflow run that generated this build 👀

@OSBotify OSBotify mentioned this pull request Nov 3, 2026
99 tasks done
@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/grgia in version: 9.5.31-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed — this PR only fixes form spacing and alignment; it adds no workflow, changes no labels, and makes no existing article sentence incorrect.

@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/grgia in version: 9.5.31-0 🚀

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

@OSBotify

OSBotify commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.5.31-4 🚀

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants