Skip to content

Fix: Web - RHP - Create expense RHP misalignment when quickly creating per diem expense - #97754

Open
annaweber830 wants to merge 3 commits into
Expensify:mainfrom
annaweber830:fix/91610-perdiem-pager-scrollleft
Open

Fix: Web - RHP - Create expense RHP misalignment when quickly creating per diem expense#97754
annaweber830 wants to merge 3 commits into
Expensify:mainfrom
annaweber830:fix/91610-perdiem-pager-scrollleft

Conversation

@annaweber830

@annaweber830 annaweber830 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds a patch-package patch to react-native-tab-view@4.3.0 that pins the pager's overflow: hidden clip container scrollLeft to 0 on web (via a scroll listener, cleaned up on unmount).

How it addresses the issue: Selecting the Per Diem tab auto-focuses the Destination search input. On web, that focus scrolls the pager container horizontally, leaving a stray scrollLeft. Because the pager positions its pages with translateX and never with scroll, that leftover offset shifts the active page left and clips its first column (the RHP misalignment in the issue). Pinning scrollLeft to 0 removes the offset, so the page stays aligned.

Fixed Issues

$ #91610
PROPOSAL: #91610 (comment)

Tests

  1. Open the NewDot app, log in as a new user
  2. Select " Manage My Team " -> Per Diem
  3. Go to Workspace and import the Per Diem file
  4. Click FAB -> Create expense -> Per Diem -> Create a per diem expense
  5. Then quickly click FAB
  6. Create expense RHP should display normally
  • Verify that no errors appear in the JS console

Offline tests

Same as test

QA Steps

  1. Open the NewDot app, log in as a new user
  2. Select " Manage My Team " -> Per Diem
  3. Go to Workspace and import the Per Diem file
  4. Click FAB -> Create expense -> Per Diem -> Create a per diem expense
  5. Then quickly click FAB
  6. Create expense RHP should display normally
  • 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.
  • 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
Screen.Recording.2026-08-03.at.9.20.33.PM.mp4

The react-native-tab-view pager clip container picked up a stray
scrollLeft from the auto-focused Search input while the RHP was
translated wide, shifting the active per-diem page left and clipping the
first letters of country names. Pin the pager scrollLeft to 0 on web.
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@annaweber830
annaweber830 marked this pull request as ready for review August 4, 2026 04:37
@annaweber830
annaweber830 requested a review from a team as a code owner August 4, 2026 04:37
@melvin-bot
melvin-bot Bot requested a review from mananjadhav August 4, 2026 04:38
@melvin-bot

melvin-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

@mananjadhav 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 August 4, 2026 04:38

@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: 6dccd5f1f8

ℹ️ 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".

+ // is translated wide, leaving a persistent scrollLeft that shifts the active page left and clips its
+ // first column. Pin scrollLeft at 0.
+ React.useEffect(() => {
+ if (Platform.OS !== 'web') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Import Platform before using it in the patch

When this patch is applied, every TabView mount will run this effect and evaluate Platform.OS, but the hunk does not add Platform to TabView.js's React Native import. Since Platform is not otherwise defined in this module, the app will throw a ReferenceError as soon as any patched tab view mounts instead of just fixing the web scroll offset.

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.

This one's a false positive I think — TabView.js already imports Platform up top (line 4, import { I18nManager, Platform, StyleSheet, View } from 'react-native') and already uses it elsewhere in the file, like the RTL check around line 36. So the patch is just adding another Platform.OS check where it's already in scope, no ReferenceError.

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.

1 participant