Skip to content

[Resizable side panel] Basic drag logic - #106105

Merged
pecanoro merged 16 commits into
Expensify:mainfrom
software-mansion-labs:war-in/resizable-side-panel-drag
Nov 10, 2026
Merged

pecanoro merged 16 commits into
Expensify:mainfrom
software-mansion-labs:war-in/resizable-side-panel-drag

Conversation

@war-in

@war-in war-in commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

With the new web-only resizableSidePanel beta on, users can drag the Concierge side panel's left edge on wide layouts. The width goes from the default up to the widest single RHP. It snaps to the default and resets on click, and it's saved per device. The drag updates only CSS variables. The RHP handle logic moves into a shared PaneResizeHandle.

Fixed Issues

$ #105900
PROPOSAL:

Tests

Prerequisite: an account with the resizableSidePanel beta, on web.

Test 1: Docked panel

  1. Make the browser window wider than 1300px and open the Concierge side panel.
  2. Hover the panel's left edge.
  3. Verify that the cursor changes to col-resize and a green line shows just outside the panel's left border.
  4. Drag the edge left, then back right past the default width.
  5. Verify that the panel follows the pointer, the page beside it narrows and widens with it, and the panel doesn't go narrower than 375px.
  6. Drag the edge left, then back right to within 20px of the default width, and hold.
  7. Verify that the line gets thicker. Release, and verify that the panel goes back to its default width.
  8. Drag the edge left, release, then reload the page.
  9. Verify that the panel keeps the dragged width after the reload.
  10. Click the edge without dragging.
  11. Verify that the panel goes back to its default width.

Test 2: Panel over the page, and window resizing

  1. Make the browser window between 800px and 1300px wide and open the Concierge side panel.
  2. Drag the panel's left edge far to the left.
  3. Verify that the panel widens over the page, the page behind it doesn't move, and the panel stops at the widest width a single RHP can be dragged to in this window.
  4. Shrink the browser window, then widen it again.
  5. Verify that the panel narrows to fit the smaller window and returns to the dragged width when the window grows back.

Test 3: RHP next to the panel

  1. Make the browser window wider than 1300px, open the Concierge side panel, and open Account > Profile > Timezone in the RHP.
  2. With the resizableRHP beta on, drag the RHP's left edge.
  3. Verify that the RHP still resizes as before.
  4. Drag the side panel's left edge.
  5. Verify that the RHP moves left together with the page.

Offline tests

Same as tests. The width is stored only on the device, so resizing works offline.

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

Move the drag, snap, click-reset and live CSS width logic out of
RHPResizeHandle into a generic PaneResizeHandle, the persisted width
clamping into usePaneWidth, and the CSS variable helpers into
createLiveSizeVariable, so other right-docked panes can reuse them.
The pane handle constants move from RHP_RESIZE to RESIZE_HANDLE.
RHP behavior is unchanged.
Behind the new web-only resizableSidePanel beta, drag the side panel's
left edge on wide layouts to resize it, from the default width up to the
widest single RHP. Releasing near the default snaps to it and a click
resets it. The width is saved per device in the sidePanelWidth Onyx key
and clamped to the window at render.

Mid-drag the width lives in the --side-panel-width CSS variable. The page
beside a docked panel is inset by that width times --side-panel-dock-progress,
which a listener on the open/close Animated value writes, so neither the
drag nor the open animation renders the page's cards.
@codecov

codecov Bot commented Nov 5, 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 96.03% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/components/Navigation/DebugTabView.tsx 56.09% <100.00%> (+0.26%) ⬆️
src/components/ResizeHandle/getDraggedSize.ts 100.00% <ø> (ø)
.../components/SidePanel/SidePanelContextProvider.tsx 90.90% <100.00%> (+1.29%) ⬆️
...c/components/SidePanel/useSidePanelDockProgress.ts 100.00% <100.00%> (ø)
src/hooks/usePaneWidth.ts 100.00% <100.00%> (ø)
src/hooks/useSidePanelWidth.ts 100.00% <100.00%> (ø)
src/hooks/useSingleRHPWidth.ts 100.00% <100.00%> (ø)
src/libs/ExportOnyxState/masking.ts 93.45% <ø> (ø)
... and 17 more
... and 12 files with indirect coverage changes

@war-in

war-in commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@MelvinBot review
@codex review
@claude review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T16:01:02.465462Z 9afa827 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 findings

  1. [P2] Keep wide RHPs on-screen when enlarging Concierge. getSidePanelWidthBounds.ts:14–16 allows an 885px panel at a 1440px viewport. An adjacent wide expense RHP remains 925px wide and is shifted left by the panel width, pushing its left edge roughly 384px off-screen. The existing RHP shrink logic only shrinks super-wide RHPs. Cap the effective docked panel width while a wide RHP is open, preserving the saved preference for when it closes. Add coverage for opening an expense after saving a large panel width, too.

  2. [P2] Provide keyboard access to the new resize/reset control. PaneResizeHandle.tsx:152–163 renders a non-focusable, unnamed div with only pointer handlers. The newly introduced Concierge resizing and click-to-reset actions are therefore unavailable to keyboard and screen-reader users. Expose a named, focusable separator with width bounds/current value, keyboard resizing, and a keyboard reset action. This limitation existed in the old RHP handle, but this PR introduces it to Concierge.

Validation: Both targeted Jest suites passed: 18 tests total. Findings are based on code tracing; browser behavior was not verified.


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: 7404e60faf

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

- Merge SidePanelWidth and SingleRHPWidth actions into PaneWidth
- Share one PaneWidthBounds type across both panes
- Let PaneResizeHandle save and reset through an Onyx key, and key its shared drag by the LiveSizeVariable
- Expose the side panel width and beta from the side panel context so consumers stop re-checking the beta
- Move dock-progress CSS syncing into useSidePanelDockProgress
- Let SidePanelResizeHandle gate itself on beta and layout
While a wide or super-wide RHP is open beside a docked panel, cap the
panel's width so the RHP card still fits in the window. The cap is
applied at render, so the dragged width comes back once the RHP closes.
The resize handle reads the same capped bounds from the side panel context.
A width that changed while the panel was hidden, or while it slid out,
left the panel waiting off-screen at the old width, so the next open
started partly on screen or stayed hidden for part of the animation.
@war-in
war-in marked this pull request as ready for review November 5, 2026 15:41
@war-in
war-in requested review from a team as code owners November 5, 2026 15:41
@melvin-bot
melvin-bot Bot requested review from ikevin127 and removed request for a team November 5, 2026 15:41
@melvin-bot

melvin-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

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

@war-in

war-in commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@ikevin127 I think @Krishna2323 will take this one as he already worked on resizable RHP and table columns, but we're waiting for confirmation. Sorry for the confusion 🙏

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Assigned this PR to Krishna because he's working on the project and I forgot to assign them to the issue.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

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

NAB: Test 1 step 5 says the panel "doesn't go narrower than its default width", but with the 400px default the panel can still be dragged down to 375px (variables.sidePanelWidth), which matches the issue. Could you update the step to say it doesn't go narrower than 375px, so QA doesn't flag that as a bug?

Comment thread src/hooks/useSingleRHPWidth.ts Resolved
@Krishna2323

Copy link
Copy Markdown
Contributor

At max width, the docked panel leaves almost no room for the chat beside it. The max width reuses the single RHP's limit (885px), but the RHP floats over the page while the docked panel pushes it aside. This means the page has to fit within windowWidth - 885.

At a ~1490px window width, the chat is only ~180px wide, and the composer wraps one letter per line. Near the 1300px docking breakpoint, it's even worse.

This gets worse as more features roll out. With the flatNav beta enabled, the wide layout replaces the 72px icon bar with the 232px flat navigation bar, leaving the chat with only ~20px at the same window width. With a resizable RHP open on top, the visible page strip beside it is only ~210px wide.

cc @Expensify/design: Should the docked panel have a minimum width for the page beside it?

Monosnap.screencast.2026-11-10.06-32-07.mp4

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

cc @Expensify/design: Should the docked panel have a minimum width for the page beside it?

Yeah good shout. I wouldn't expect the main content to go smaller than 400 or so!? With that we at least ensure that the mobile sizes we design for works, but curious what @Expensify/design thinks too

@shawnborton

Copy link
Copy Markdown
Contributor

Yup, totally agree there, and Jon's suggestion sounds reasonable to me.

Copy link
Copy Markdown
Contributor

Sounds great to me too. Let's get it updated.

@war-in

war-in commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

All suggestions applied, @Krishna2323 PR's all yours

@Krishna2323

Krishna2323 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

@war-in With the 400px floor, the chat no longer collapses, but the central pane still uses its wide-layout styles at 400px. The duplicate banner wraps one word per line, table columns get cut off.

shouldUseNarrowLayout only considers the window width or RHP membership (src/hooks/useResponsiveLayout/index.ts:73), not the pane's actual width.

I think this should be handled in a follow-up issue rather than here. @JS00001 WDYT?

cc @Expensify/design: Would it make sense for the central pane to switch to narrow (mobile) styles once it gets this narrow, using the breakpoints we already have?

image

@shawnborton

Copy link
Copy Markdown
Contributor

Would it make sense for the central pane to switch to narrow (mobile) styles once it gets this narrow, using the breakpoints we already have?

Yes, it would - assuming we can pull it off with a smooth transition.

@war-in

war-in commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

I think this should be handled in a follow-up issue rather than here. @JS00001 WDYT?

Agree with @Krishna2323 that this doesn't belong here. This issue already exists on prod, though a little bit less visible. We can handle it in a followup 😄

Image

@Krishna2323

Copy link
Copy Markdown
Contributor

@MelvinBot please create a follow-up issue and assign it to @Krishna2323, @war-in and @JS00001.

When the docked side panel (or the LHN) leaves the central pane narrow, the pane continues using its wide-layout styles. For example, at ~400px, the duplicate banner wraps one word per line and the report table columns get cut off.

shouldUseNarrowLayout only considers the window width or RHP membership (src/hooks/useResponsiveLayout/index.ts:73), never the pane's actual width. This already happens in production near the 1300px docking breakpoint, and the resizable side panel from #106105 makes it easier to reproduce.

Expected: The central pane should switch to narrow (mobile) styles once it gets narrow enough, with a smooth transition.

image

@MelvinBot

Copy link
Copy Markdown
Contributor

Created Web - Central pane retains wide-layout styles when narrowed by docked side panel or LHN and assigned it to Krishna2323, war-in, and JS00001.

Included reproduction steps, screenshot, technical context, and the smooth-transition requirement.


view run

@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

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

@melvin-bot

melvin-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #105900 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 pecanoro November 10, 2026 13:28
@pecanoro
pecanoro merged commit 67b062e into Expensify:main Nov 10, 2026
37 of 40 checks passed
@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

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

@github-actions

Copy link
Copy Markdown
Contributor

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/pecanoro in version: 9.5.36-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed — side-panel resizing remains behind the resizableSidePanel beta, and the remaining changes are internal refactoring and layout fixes that don't make existing guidance incorrect.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor

Created Update FullStory for E/A#106105 Resizable Concierge side panel drag and reset, labeled Weekly and assigned to JmillsExpensify and war-in.

Recommended one custom element for the Concierge resize/reset handle (high confidence). No additional events, user properties, masking, or page-view changes are needed.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀

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.

9 participants