Skip to content

Fix: blank space below referral banner on manual expense participants page#94754

Open
MelvinBot wants to merge 4 commits into
mainfrom
claude-referralBannerEdgeToEdgePadding
Open

Fix: blank space below referral banner on manual expense participants page#94754
MelvinBot wants to merge 4 commits into
mainfrom
claude-referralBannerEdgeToEdgePadding

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

The manual-expense participant ("To") page showed a blank gap below the referral banner on Android, caused by double bottom safe-area padding.

#94539 added addBottomSafeAreaPadding to the SelectionListWithSections on this page so the banner's FixedFooter reserves the bottom inset. But this page is wrapped by StepScreenWrapper, which renders ScreenWrapper in legacy mode (no enableEdgeToEdgeBottomSafeAreaPadding), so the screen container already reserves the bottom inset. With both the container and the footer applying the inset, the result is an inset-sized blank gap under the banner.

The sibling NewChatPage renders the same banner + prop correctly because its ScreenWrapper is edge-to-edge (includeSafeAreaPaddingBottom becomes false), so the SelectionList is the single owner of the bottom inset.

This PR makes the IOU participants screen match that pattern: it adds an optional enableEdgeToEdgeBottomSafeAreaPadding prop to StepScreenWrapper and sets it only on IOURequestStepParticipants. The container stops reserving the inset and the SelectionList owns it — via the FixedFooter when a footer is present, or via the list content-container padding when it isn't. Scoping the prop to this one screen leaves all other StepScreenWrapper usages on the legacy path unchanged (zero blast radius).

Fixed Issues

$ #94744
PROPOSAL: #94744 (comment)

Tests

// TODO: The human co-author must fill out the tests they ran before marking this PR as "ready for review".

Suggested verification (Android device with a 3-button navigation bar):

  1. Launch the app and open FAB > Create expense > Manual.
  2. Enter an amount and tap Next to reach the participant ("To") page.
  3. Verify the referral banner sits directly above the navigation bar with no blank gap below it, and is not hidden behind the navigation bar.
  4. Repeat with device navigation set to gestures and confirm the banner still renders correctly.
  • Verify that no errors appear in the JS console

Offline tests

N/A — layout-only change.

QA Steps

// TODO: The human co-author must fill out the QA steps before marking this PR as "ready for review".

Suggested QA (Android device with the navigation set to bar, not gestures):

  1. Launch the Expensify app and open FAB > Create expense > Manual.
  2. Enter an amount and tap Next to reach the participant ("To") page.
  3. Verify the referral banner appears fully above the navigation bar with no blank space below it.
  • 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 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 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 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 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.
  • 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

… IOU participants page

Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>
@thelullabyy

Copy link
Copy Markdown
Contributor

@MelvinBot Replace all [ ] by [x] in PR description. Then, open PR for review

@MelvinBot MelvinBot marked this pull request as ready for review June 27, 2026 03:12
@MelvinBot MelvinBot requested a review from a team as a code owner June 27, 2026 03:12
@melvin-bot melvin-bot Bot requested review from Eskalifer1 and trjExpensify June 27, 2026 03:12
@melvin-bot

melvin-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Eskalifer1 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 request for a team June 27, 2026 03:12
@thelullabyy

thelullabyy commented Jun 27, 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
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari

Old flow:

Screen.Recording.2026-06-27.at.00.28.52.mov

New flow:

Screen.Recording.2026-06-27.at.00.30.20.mov

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f36f22b8ce

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// The participant list's SelectionList footer (referral banner / Next button) owns the bottom
// safe area inset via `addBottomSafeAreaPadding`. Opt into edge-to-edge so the screen container
// doesn't also reserve the inset, which would double-pad and leave a blank gap below the banner.
enableEdgeToEdgeBottomSafeAreaPadding

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve space for the offline indicator without a footer

In the dismissed-banner/no-selection state, ParticipantSearchResults passes no footerContent, so the list only adds bottom safe-area padding; opting the wrapper into edge-to-edge mode also makes ScreenWrapper render the mobile offline indicator as a sticky absolute element. If the user is offline in this state, the offline bar overlays the bottom of the participant list, whereas the previous legacy wrapper laid the indicator out below the content. Please either keep the non-sticky offline behavior for this screen or add an offline-indicator offset when the footer is absent.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked this — the concern is valid in mechanism, though it's a narrow cosmetic edge case rather than a functional break.

What's real: Opting StepScreenWrapper into edge-to-edge mode flips the mobile offline indicator from in-flow layout to an absolutely-positioned sticky bar (position: absolute; bottom: 0), via ScreenWrapper/index.tsx#L175ScreenWrapperOfflineIndicators.tsx#L95 (styles.stickToBottom). When a footer is present, FixedFooter reserves OFFLINE_INDICATOR_HEIGHT so content clears the sticky bar. But in the no-footer state (banner dismissed + no selection, ParticipantSearchResults.tsx#L418) the list's bottom padding comes from safeAreaPaddingBottomStyle, which reserves only the inset and not the indicator height (BaseSelectionListWithSections.tsx#L89). So when offline in that exact state, the sticky bar overlays the last ~25px of the list — whereas legacy mode laid it out below content.

Why the bot caught it: The sibling NewChatPage (already edge-to-edge, same dismissed-banner pattern) avoids this by not rendering the sticky indicator on its wrapper — NewChatPage/index.tsx#L476-L477 passes disableOfflineIndicatorSafeAreaPadding + shouldShowOfflineIndicator={false} (its parent owns the indicator). This page keeps StepScreenWrapper's default shouldShowOfflineIndicator = true, so it does render the sticky bar and inherits the overlap.

Severity: Only triggers when all of: mobile + offline + banner dismissed + zero participants selected. The bar is translucent and sits at the bottom of a scrollable list, so the impact is cosmetic. Real regression vs. legacy, but minor.

Suggested fix (lowest risk): Mirror NewChatPage — pass shouldShowOfflineIndicator={false} (and optionally disableOfflineIndicatorSafeAreaPadding) through StepScreenWrapper for this screen, since the SelectionList already owns the bottom padding. The broader alternative (making the no-footer branch of BaseSelectionListWithSections reserve OFFLINE_INDICATOR_HEIGHT when offline) would touch all SelectionList consumers and is riskier.

Worth a quick Android emulator repro (offline + dismissed banner + no selection) to confirm the visual impact before deciding whether to address it in this PR or fast-follow.

Want me to implement the shouldShowOfflineIndicator={false} fix? Reply @MelvinBot implement this and I'll push it to the branch.

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.

Bug exists, @MelvinBot implement this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Implemented in 104b4cc.

Mirrored NewChatPage exactly for this screen:

  • IOURequestStepParticipants.tsx now passes shouldShowOfflineIndicator={false} + disableOfflineIndicatorSafeAreaPadding, so the SelectionList is the sole owner of the bottom padding and the sticky bar can no longer overlap the last rows in the no-footer state.
  • StepScreenWrapper didn't forward disableOfflineIndicatorSafeAreaPadding, so I added it as an optional pass-through prop (StepScreenWrapper.tsx). It defaults to undefined, so every other StepScreenWrapper usage is unchanged.

I added disableOfflineIndicatorSafeAreaPadding in addition to shouldShowOfflineIndicator={false} so the footer doesn't reserve OFFLINE_INDICATOR_HEIGHT for an indicator that's no longer rendered (which would otherwise reintroduce a small gap below the banner while offline).

Verification: prettier, npm run typecheck-tsgo, lint, and the React Compiler compliance check all pass. This is a layout-only change; a quick Android emulator repro (offline + dismissed banner + no selection) is still worth doing to confirm the sticky bar no longer overlaps the list.

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.

@MelvinBot Your fix doesn't work, please revert all changes in your PR and apply only my changes below. It should work

--- a/src/pages/iou/request/ParticipantSearchResults.tsx
+++ b/src/pages/iou/request/ParticipantSearchResults.tsx
@@ -1,5 +1,5 @@
 import lodashPick from 'lodash/pick';
-import React, {useEffect} from 'react';
+import React, {useContext, useEffect} from 'react';
 import type {Ref} from 'react';
 import type {GestureResponderEvent} from 'react-native';
 import {RESULTS} from 'react-native-permissions';
@@ -7,6 +7,7 @@ import ContactPermissionModal from '@components/ContactPermissionModal';
 import EmptySelectionListContent from '@components/EmptySelectionListContent';
 import MenuItem from '@components/MenuItem';
 import {usePersonalDetails} from '@components/OnyxListItemProvider';
+import ScreenWrapperStatusContext from '@components/ScreenWrapper/ScreenWrapperStatusContext';
 import InviteMemberListItem from '@components/SelectionList/ListItem/InviteMemberListItem';
 import SelectionListWithSections from '@components/SelectionList/SelectionListWithSections';
 import type {Section, SelectionListWithSectionsHandle} from '@components/SelectionList/SelectionListWithSections/types';
@@ -147,6 +148,12 @@ function ParticipantSearchResults({
     const reportAttributesDerived = useReportAttributes();
     const privateIsArchivedMap = usePrivateIsArchivedMap();
 
+    // When the surrounding ScreenWrapper runs in edge-to-edge mode (e.g. the new manual expense flow's ParticipantPicker),
+    // it does not apply bottom safe area padding itself, so the fixed footer must consume it. Otherwise the footer
+    // (referral banner / Next button) renders behind the system navigation bar.
+    const screenWrapperStatusContext = useContext(ScreenWrapperStatusContext);
+    const addBottomSafeAreaPadding = !(screenWrapperStatusContext?.isSafeAreaBottomPaddingApplied ?? false);
+
     // Policy and billing data — owned here, used for getValidOptionsConfig and billing gate in onSelectRow
     const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID);
     const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
@@ -514,6 +521,7 @@ function ParticipantSearchResults({
                     />
                 }
                 footerContent={footerContent}
+                addBottomSafeAreaPadding={addBottomSafeAreaPadding}
                 listEmptyContent={EmptySelectionListContentWithPermission}
                 shouldShowLoadingPlaceholder={shouldShowLoadingPlaceholder}
                 shouldShowTextInput

@thelullabyy

Copy link
Copy Markdown
Contributor

@Eskalifer1 Sorry, please ignore this PR. It is my regression, I will review it

@thelullabyy

Copy link
Copy Markdown
Contributor

@MelvinBot Could you please check this comment? #94754 (comment)

… overlap

Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team as a code owner June 27, 2026 03:58
@melvin-bot melvin-bot Bot requested review from Pujan92 and puneetlath June 27, 2026 03:58
@melvin-bot

melvin-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Pujan92 @puneetlath One of you needs to 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 June 27, 2026 03:58
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/pages/iou/request/ParticipantSearchResults.tsx 0.65% <0.00%> (-0.01%) ⬇️
... and 12 files with indirect coverage changes

…m ScreenWrapperStatusContext in ParticipantSearchResults

Reverts the changes to IOURequestStepParticipants and StepScreenWrapper and
instead lets the participant SelectionList footer own the bottom safe area
inset by reading isSafeAreaBottomPaddingApplied from ScreenWrapperStatusContext.

Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>
@thelullabyy

Copy link
Copy Markdown
Contributor

@MelvinBot Test failed but it doesn't related to our changes, let's re-run the test (if you don't have permission, let's push another commit to delete the code comment so that the test is re-run

    // When the surrounding ScreenWrapper runs in edge-to-edge mode (e.g. the new manual expense flow's ParticipantPicker),
    // it does not apply bottom safe area padding itself, so the fixed footer must consume it. Otherwise the footer
    // (referral banner / Next button) renders behind the system navigation bar.

Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>

@thelullabyy thelullabyy 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

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.

2 participants