Skip to content

[Resizable RHP] Basic drag logic - #104573

Merged
JS00001 merged 19 commits into
Expensify:mainfrom
software-mansion-labs:war-in/resizable-rhp-drag
Oct 27, 2026
Merged

JS00001 merged 19 commits into
Expensify:mainfrom
software-mansion-labs:war-in/resizable-rhp-drag

Conversation

@war-in

@war-in war-in commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Behind the resizableRHP beta, users can drag the single RHP's left edge on wide web layouts to resize it (380px to the wide RHP width minus 40px). Mid-drag the width is written to a scoped --rhp-width CSS variable, so nothing re-renders. On release it's saved to Onyx (singleRHPWidth). The drag lifecycle and size math are now shared with resizable table columns.

Fixed Issues

$ #103561
PROPOSAL:

Tests

  1. Enable the resizableRHP beta. On a wide web window, go to Account > Profile and open Timezone in the RHP.
  2. Hover the RHP's left edge.
  3. Verify that the cursor changes to col-resize and a green line shows just outside the card's left border.
  4. Drag the edge left, then right, past both limits.
  5. Verify that the card and the page inside it follow the pointer, stopping at 380px and at the wide RHP width minus 40px.
  6. Drag the edge left and release the pointer over the LHN.
  7. Verify that the RHP stays open at the new width.
  8. Close and reopen the RHP, then reload the page.
  9. Verify that the RHP opens at the dragged width both times.
  10. Shrink the browser window, then widen it again.
  11. Verify that the RHP narrows to fit the smaller window and returns to the dragged width when the window grows back.

  1. With the resizableRHP beta enabled, open an expense report in the RHP (a wide or super-wide RHP).
  2. Verify that no resize handle shows and the RHP keeps its usual width.
  3. From that expense, open a field page (a single RHP stacked on the wide one).
  4. Verify that it opens at the default width with no resize handle.
  5. Disable the beta and open any single RHP.
  6. Verify that there is no resize handle and the RHP has its default width.

  1. Enable the resizableTableColumns beta and open a table with resizable columns (for example, Workspace > Members).
  2. Drag a column's right edge.
  3. Verify that the grip and the indicator line show as before, the column resizes, and the new width is kept after a reload.

Offline tests

  1. Go offline.
  2. With the resizableRHP beta enabled, open a single RHP and drag its left edge to a new width.
  3. Close and reopen the RHP.
  4. Verify that the RHP resizes and keeps its width while offline. The width is stored locally, so no request is queued.

QA Steps

Same as tests

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

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

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/index.ts 95.90% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/components/Modal/BaseModal.tsx 97.39% <100.00%> (+0.04%) ⬆️
src/components/ResizeHandle/getDraggedSize.ts 100.00% <100.00%> (ø)
...onents/Table/columnResize/useColumnResize/index.ts 100.00% <100.00%> (+2.38%) ⬆️
src/hooks/useIsResizableSingleRHP.ts 100.00% <100.00%> (ø)
src/hooks/useSingleRHPWidth.ts 100.00% <100.00%> (ø)
src/libs/ExportOnyxState/masking.ts 80.95% <ø> (ø)
.../AppNavigator/Navigators/getRHPFrameStyle/index.ts 100.00% <100.00%> (ø)
...tion/AppNavigator/useModalCardStyleInterpolator.ts 46.87% <100.00%> (+4.93%) ⬆️
... and 15 more
... and 10 files with indirect coverage changes

@war-in

war-in commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@MelvinBot review
@claude review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-22T09:08:29.967471Z d6788ab 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

Review

I found two issues to fix before merge. The drag logic, the usePointerDrag extraction, and the live CSS-variable approach look correct.

1. A failing CI test comes from this PR. test (job 7) fails in MoneyRequestReportTransactionsNavigationTest with useWideRHPState is not a function. BaseModal now calls useIsResizableSingleRHP() (BaseModal.tsx:259), which calls useWideRHPState(). The test's mock of @components/WideRHPContextProvider only defines useWideRHPActions (MoneyRequestReportTransactionsNavigationTest.tsx:90-92). To fix it, add useWideRHPState: () => ({wideRHPRouteKeys: [], superWideRHPRouteKeys: []}) to that mock.

2. The resizable width also applies when the beta is off. useSingleRHPWidth doesn't check the beta (useSingleRHPWidth.ts:30). Three callers use its width with no beta check:

This causes two visible effects for users without the beta:

  • Every user, at 801–813px windows: max is windowWidth - 374, which falls below the 440px default. For example, a 805px window gets a 431px RHP instead of 440px.
  • Users whose beta is removed from the account: the saved singleRHPWidth stays in Onyx. The RHP keeps that width with no handle to change it. clearSingleRHPWidth only runs from the beta override page (DynamicBetaOverridesPage.tsx:58).

To fix both, have useSingleRHPWidth return variables.rhpWidth when RESIZABLE_RHP is off. The override-page clear then becomes optional.

The other non-passing checks are Check independent approval, which doesn't depend on the code, and typecheck, which is still pending.


view run

@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: 66d9d7f61b

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

@war-in
war-in marked this pull request as ready for review October 22, 2026 08:48
@war-in
war-in requested review from a team as code owners October 22, 2026 08:48
@melvin-bot
melvin-bot Bot requested review from Krishna2323 and removed request for a team October 22, 2026 08:48
@melvin-bot

melvin-bot Bot commented Oct 22, 2026

Copy link
Copy Markdown

@Krishna2323 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 requested review from flaviadefaria and removed request for a team October 22, 2026 08:48

@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: d6788ab063

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

@mountiny
mountiny self-requested a review October 22, 2026 20:33
@mountiny

Copy link
Copy Markdown
Contributor

@Krishna2323 how is this looking?

Comment thread src/libs/actions/SingleRHPWidth.ts Resolved
@Krishna2323

Copy link
Copy Markdown
Contributor

NAB: Enabling/Disabling beta opens up "Validate your account" RHP:

Monosnap.screencast.2026-10-26.03-05-50.mp4

@Krishna2323 Krishna2323 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 to me, apart from the NABs above.

Monosnap.screencast.2026-10-26.03-05-50.mp4

@war-in

war-in commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

@Krishna2323 all reported issues should be addressed!

@Krishna2323

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
web_chrome.mp4

…drag

# Conflicts:
#	src/CONST/index.ts
#	src/components/Table/columnResize/useColumnResize/index.ts
#	src/libs/Navigation/AppNavigator/ModalStackNavigators/useModalStackScreenOptions.ts
#	src/libs/Navigation/AppNavigator/useRHPScreenOptions.ts

@Krishna2323 Krishna2323 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!

@war-in please resolve conflicts when you get a chance. Thanks!

@war-in

war-in commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Main merged! I think the failing perf test is just flaky and unrelated to the branch

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

reviewed & approving at marcins request since vit is out

@JS00001

JS00001 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@war-in I reran the perf tests a few times, could you double check its not related please?

@war-in

war-in commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@JS00001 merging main helped 😄

@JS00001
JS00001 merged commit b8be199 into Expensify:main Oct 27, 2026
34 checks passed
@JS00001

JS00001 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

looks like we are good!

@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.24-1 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. The resizable RHP is gated behind the new resizableRHP beta (isBetaEnabled(CONST.BETAS.RESIZABLE_RHP)), and the shared drag logic for table columns is an internal refactor with no user-facing change.


view run

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #105269 was identified to be related to this PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.5.24-8 🚀

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