Skip to content

Add collapsible Spend sidebar#91974

Merged
blimpich merged 15 commits into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/91553-spend-sidebar-collapse
Jun 5, 2026
Merged

Add collapsible Spend sidebar#91974
blimpich merged 15 commits into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/91553-spend-sidebar-collapse

Conversation

@KJ21-ENG

@KJ21-ENG KJ21-ENG commented May 28, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds the desktop Spend sidebar collapse/expand behavior behind the Spend search page. The sidebar now starts expanded, can be collapsed to a 76px icon rail, temporarily peeks open on hover over the collapsed rail, keeps section accordions available when expanded, and shifts the main Spend content only for the persisted expanded/collapsed state.

Fixed Issues

$ #91553
PROPOSAL: #91553 (comment)

Tests

  1. Open the desktop web app and sign in with an account that has the Spend module available.
  2. Navigate to Spend > Expenses.
  3. Verify the Spend sidebar starts expanded and the Expenses content appears to the right of it.
  4. Click the sidebar collapse button.
  5. Verify the sidebar collapses to the 76px icon rail, labels are hidden, and section headers render as dividers.
  6. Hover over the collapsed Spend sidebar.
  7. Verify the sidebar temporarily expands over the content while hovered.
  8. Move the cursor away from the sidebar.
  9. Verify the sidebar returns to the collapsed icon rail.
  10. Click the expand button.
  11. Verify the sidebar remains expanded and the Expenses content is laid out to the right of the expanded sidebar.
  • Verify that no errors appear in the JS console

Offline tests

N/A. This is a desktop layout-only change for the Spend sidebar and does not add or change network-dependent behavior.

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 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

N/A - desktop-only Spend sidebar behavior.

Android: mWeb Chrome

N/A - desktop-only Spend sidebar behavior.

iOS: Native

N/A - desktop-only Spend sidebar behavior.

iOS: mWeb Safari

N/A - desktop-only Spend sidebar behavior.

MacOS: Chrome / Safari
Screen.Recording.2026-05-29.at.3.08.50.AM.mov

@codecov

codecov Bot commented May 28, 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 93.79% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/components/Navigation/TopBar.tsx 100.00% <100.00%> (ø)
src/libs/actions/SignInRedirect.ts 73.07% <100.00%> (+0.52%) ⬆️
src/styles/index.ts 59.06% <ø> (ø)
src/styles/variables.ts 100.00% <ø> (ø)
src/libs/actions/SearchSidebar.ts 0.00% <0.00%> (ø)
src/pages/Search/SearchPageWide.tsx 0.00% <0.00%> (ø)
src/pages/Search/SearchTypeMenuWide.tsx 0.00% <0.00%> (ø)
...ponents/Search/SearchList/BaseSearchList/index.tsx 0.00% <0.00%> (ø)
... and 5 more
... and 428 files with indirect coverage changes

@KJ21-ENG KJ21-ENG force-pushed the KJ21-ENG/91553-spend-sidebar-collapse branch from d814ac4 to da13d13 Compare May 28, 2026 21:34
@KJ21-ENG KJ21-ENG changed the title [WIP] Add collapsible Spend sidebar Add collapsible Spend sidebar May 28, 2026
@KJ21-ENG KJ21-ENG marked this pull request as ready for review May 28, 2026 21:44
@KJ21-ENG KJ21-ENG requested review from a team as code owners May 28, 2026 21:44
@melvin-bot melvin-bot Bot requested review from eVoloshchak and heyjennahay May 28, 2026 21:44
@melvin-bot

melvin-bot Bot commented May 28, 2026

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown
Contributor

🚧 @dubielzyk-expensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

This is a wonderful start and work quite well. Great job on this so far.

There's a jump in the table that happens when we collapse. Can you help get rid of this?

CleanShot.2026-05-29.at.12.12.57.mp4

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

There's also a question if we should store some sort of NVP to keep your choice of collapsing persistent across sessions. I think it'd be nice, but not sure if it's crucial. Curious if @trjExpensify or @Expensify/design has any opinions here

@trjExpensify

Copy link
Copy Markdown
Contributor

I think that would be nice, as it doesn't survive a page refresh which is a bit annoying.

@trjExpensify

Copy link
Copy Markdown
Contributor

P.S - we seem to be missing the saved search icon in the collapsed state:

image image

@trjExpensify

Copy link
Copy Markdown
Contributor

When I try to interact with the button to expand/collapse, I feel like I'm chasing it because on hover the side pane moves. I wonder if we should have that hover area over the icon remain static? Might be a terrible idea... but here's me on the chase:

2026-05-29_03-27-44.mp4

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

I get this feeling. I had it during prototype. It's the nature of the peeking functionality.

Do you mean that we shouldn't collapse it until you hover out of the sidebar? Or do you mean that there's an invisible button that allows you to click the same spot to expand it?

I think the reality is that people aren't gonna turn it off and on all the time, but I still feel you on this feedback cause it does feel a bit off.

Another solution could be that when it's in the collapsed state and you peek, then it only collapses again on a tiny bit of a delay. That way if you hover over the edge and back again it doesn't instantly go away.

@shawnborton

Copy link
Copy Markdown
Contributor

Re: the chasing feeling, I think I agree, and one idea could be to move the icon to the left of the word Spend? This way the icon never actually moves. That might not look as good though, but it would solve the problem.

@shawnborton

Copy link
Copy Markdown
Contributor

Are we able to fix the animation that happens when the table is shrinking/growing? Note that in this case it looks like the table gets too wide and goes off the screen, whereas the table header stays perfectly fixed as we'd want it to be:
CleanShot 2026-05-29 at 10 51 04@2x

@eVoloshchak

Copy link
Copy Markdown
Contributor

@KJ21-ENG, this doesn't look right, the list doesn't fit the entire screen.
This must be a result of recent changes, it wasn't present in #91974 (comment)

Screen.Recording.2026-06-04.at.09.45.20.mov

@KJ21-ENG

KJ21-ENG commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Looking into it ASAP 👀

@eVoloshchak

Copy link
Copy Markdown
Contributor

We hide the sidebar icon if the corresponding section is collapsed, which means it looks like this when all of the sections are collapsed

Screenshot 2026-06-04 at 09 48 46 Screenshot 2026-06-04 at 09 48 53
Screen.Recording.2026-06-04.at.09.45.20.mov

@shawnborton, @dubielzyk-expensify, does this look like expected?

@shawnborton

Copy link
Copy Markdown
Contributor

We hide the sidebar icon if the corresponding section is collapsed, which means it looks like this when all of the sections are collapsed

Yup, I actually do think that's expected.

@KJ21-ENG

KJ21-ENG commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@KJ21-ENG, this doesn't look right, the list doesn't fit the entire screen.
This must be a result of recent changes, it wasn't present in #91974 (comment)

Looking into it ASAP 👀

@eVoloshchak fixed the list width regression and pushed the update.

We already had this resize behavior working earlier by keeping the width: '100%' constraint at the FlashList cell level. While addressing the review cleanup, I moved that width constraint down into TransactionListItemWide, but that turned out not to be behaviorally equivalent: the row content was full-width, but FlashList's measured cell could still lag during the sidebar resize animation.

To fix it, I restored the cell-level CellRendererComponent width wrapper in BaseSearchList and removed the redundant row-level styles.w100. This brings back the previously working resize behavior while keeping the other review cleanups intact. Please re-check when you get a chance.
Screenshot 2026-06-04 at 2 42 09 PM

Screen.Recording.2026-06-04.at.2.41.46.PM.mov

@eVoloshchak

eVoloshchak commented Jun 4, 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

N/A, sidebar is not visible on narrow layout

Android: mWeb Chrome

N/A, sidebar is not visible on narrow layout

iOS: HybridApp

N/A, sidebar is not visible on narrow layout

iOS: mWeb Safari

N/A, sidebar is not visible on narrow layout

MacOS: Chrome / Safari
Screen.Recording.2026-06-05.at.01.17.41.mov

Comment thread src/components/Search/SearchList/BaseSearchList/index.tsx Outdated

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

Besides a tiny correction at #91974 (comment)

@melvin-bot melvin-bot Bot requested a review from blimpich June 4, 2026 23:44
@blimpich

blimpich commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@codex review please

@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: 5e9b796a1b

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

Comment thread src/components/Search/SearchList/BaseSearchList/index.tsx Outdated

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

Two items before this is good to merge, both small — details inline. #1 may just need confirmation that local-only persistence is intentional; #2 is a quick DRY cleanup. Everything else looks solid and CI is green.

– written by Claude on Ben's behalf

Comment thread src/libs/actions/SearchSidebar.ts
Comment thread src/pages/Search/SearchTypeMenuAccordion.tsx Outdated
@KJ21-ENG KJ21-ENG requested a review from blimpich June 5, 2026 08:01
@blimpich blimpich merged commit adcebd5 into Expensify:main Jun 5, 2026
34 checks passed
@KJ21-ENG

KJ21-ENG commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Implemented the remaining local-persistence case in bc0c3f6.

What was already working with the existing local Onyx NVP_SEARCH_SIDEBAR storage:

  • page refresh
  • opening another normal tab/window in the same browser profile

What was not covered before: sign-out/sign-in, because redirectToSignIn() clears Onyx and NVP_SEARCH_SIDEBAR was not in that preserve list.

The new commit adds only ONYXKEYS.NVP_SEARCH_SIDEBAR to the sign-out preserve list, so the Spend sidebar collapsed state now survives sign-out/sign-in while staying local-only. I intentionally did not change this to setNameValuePair / API-backed persistence, since cross-device sync is not needed here.

ezyZip.8.mp4

@OSBotify

OSBotify commented Jun 5, 2026

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

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/blimpich in version: 9.4.0-0 🚀

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

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — no docs changes required

I reviewed this PR against the help articles under App/docs/articles and no help site updates are needed, so I did not open a draft docs PR.

Why: This is a desktop-only, layout-only enhancement. It lets the Spend sidebar collapse to a 76px icon rail (with hover-to-peek) and expand again. It does not add, remove, or change any user-facing workflow, setting, or capability that the help site documents — the same sections, searches, and actions remain reachable whether the sidebar is expanded or collapsed. Collapsible panels of this kind are self-explanatory UI affordances that our help articles intentionally don't document.

What I checked
  • Navigating-New-Expensify.md — describes the top-level navigation tabs and what the Spend tab is for. Its stated scope is the primary navigation tabs and action buttons, not the secondary in-screen Spend sidebar, so the collapse/expand behavior is out of scope and the article remains accurate.
  • Using-Reports-in-New-Expensify.md:128 — "Go to the Saved section in the left-hand sidebar." Still accurate: the Saved section lives in the same place, and the new collapse behavior doesn't move or hide it (it's reachable when expanded or by peeking).
  • Searched all of App/docs/articles for sidebar, collapse/expand, and LHN/left-hand navigation references tied to the Spend screen — no article describes the Spend sidebar's layout in a way this change would make inaccurate.

If you'd still like an article (or a short FAQ entry) added to call out the collapsible Spend sidebar, reply with @MelvinBot please add docs for the collapsible Spend sidebar and I'll draft one.

@KJ21-ENG, I did not create a help site PR because no documentation changes are required for this layout-only change. Please confirm you agree with this assessment, or let me know if you'd like a docs article drafted anyway.

@mitarachim

Copy link
Copy Markdown

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

@lanitochka17

Copy link
Copy Markdown

Deploy Blocker ##92819 was identified to be related to this PR

@OSBotify

OSBotify commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.0-7 🚀

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

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.