Skip to content

Fix stuck Spend sidebar after deleting saved search#92832

Merged
blimpich merged 9 commits into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/92816-spend-sidebar-stuck-peek
Jun 17, 2026
Merged

Fix stuck Spend sidebar after deleting saved search#92832
blimpich merged 9 commits into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/92816-spend-sidebar-stuck-peek

Conversation

@KJ21-ENG

@KJ21-ENG KJ21-ENG commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

This PR prevents the collapsed Spend search sidebar from staying expanded after a saved search is deleted from the peeked sidebar.

When the sidebar is collapsed and temporarily expanded by hover, opening the saved-search overflow menu and delete-confirmation modal can prevent the sidebar's normal hover-out path from firing. The peek state can then remain active even after the modal closes and the pointer is no longer over the sidebar.

To keep the existing hover behavior intact while handling modal flows, this change:

  • keeps a ref to the rendered search sidebar element
  • tracks whether any modal is active
  • avoids ending peek while a modal is active
  • re-checks whether the pointer is still over the sidebar after a modal closes
  • also ends peek on the next pointer move when the pointer is outside the sidebar

Fixed Issues

$ #92816
PROPOSAL: #92816 (comment)

Tests

  1. Open New Expensify and sign in.
  2. Go to Spend > Expenses.
  3. Apply any filter.
  4. Click Save > Save view, enter a name, and save it.
  5. Click the sidebar collapse button.
  6. Hover over the collapsed Spend sidebar so it peeks open.
  7. Click the three-dot menu next to the saved search.
  8. Click Delete, then confirm Delete in the modal.
  9. Keep the pointer outside the sidebar and move it slightly.
  10. Verify the sidebar auto-collapses and does not remain stuck expanded.
  11. Verify the normal sidebar hover-peek behavior still works after the saved search is deleted.
  12. Verify clicking the collapse/expand button still hard-collapses and expands the sidebar normally.
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests. This change only affects local pointer/hover state for the sidebar and does not introduce any 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)
    • N/A - I verified the offline behavior is the same as the online behavior because this change only updates local sidebar hover/peek state and does not depend on network requests.
    • N/A - this deploy-blocker fix only changes local pointer/modal handling for the Spend sidebar and does not change data loading or API usage.
  • I included screenshots or videos for the affected MacOS Chrome / Safari hover flow. Other platforms are N/A for this desktop hover deploy blocker.
  • I ran the tests on the affected platform and verified they passed on:
    • Android: Native - N/A for desktop hover deploy blocker
    • Android: mWeb Chrome - N/A for desktop hover deploy blocker
    • iOS: Native - N/A for desktop hover deploy blocker
    • iOS: mWeb Safari - N/A for desktop hover deploy blocker
    • 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.
  • N/A - this is a desktop hover/modal interaction covered by the manual regression steps and uploaded screen recording.
  • N/A - main was not merged into this PR after review.

Screenshots/Videos

Android: Native

N/A - the reported deploy blocker is MacOS Chrome/Safari hover behavior.

Android: mWeb Chrome

N/A - the reported deploy blocker is MacOS Chrome/Safari hover behavior.

iOS: Native

N/A - the reported deploy blocker is MacOS Chrome/Safari hover behavior.

iOS: mWeb Safari

N/A - the reported deploy blocker is MacOS Chrome/Safari hover behavior.

MacOS: Chrome / Safari
ezyZip.13.mp4

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/pages/Search/SearchTypeMenuWide.tsx 0.00% <0.00%> (ø)
src/pages/Search/SuggestedSearchSkeleton.tsx 43.75% <25.00%> (+1.81%) ⬆️
src/pages/Search/SavedSearchItemThreeDotMenu.tsx 0.00% <0.00%> (ø)
... and 801 files with indirect coverage changes

@KJ21-ENG KJ21-ENG marked this pull request as ready for review June 5, 2026 21:34
@KJ21-ENG KJ21-ENG requested review from a team as code owners June 5, 2026 21:34
@melvin-bot melvin-bot Bot requested a review from eVoloshchak June 5, 2026 21:34
@melvin-bot

melvin-bot Bot commented Jun 5, 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]

Comment thread src/components/Navigation/SearchSidebar.tsx Outdated
Comment thread src/components/Navigation/SearchSidebar.tsx Outdated
trjExpensify
trjExpensify previously approved these changes Jun 8, 2026

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

Minor bug fix for the new collapsable sidebar 👍

@KJ21-ENG

KJ21-ENG commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@eVoloshchak Kind ping here. Thanks!

@eVoloshchak

eVoloshchak commented Jun 9, 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
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
1.mov

@eVoloshchak

Copy link
Copy Markdown
Contributor
  1. Go to Spend > Expenses.
  2. Apply any filter.
  3. Click Save > Save view, enter a name, and save it.
  4. Click the sidebar collapse button.
  5. Hover over the collapsed Spend sidebar so it peeks open.
  6. Click the three-dot menu next to the saved search.
  7. Click on Rename
  8. Rename the filter, click save
  9. Notice the modal closing animation is choppy (it looks proper when pressing "Share", but with "Rename" it looks different, like there are two stages to the animation)
Screen.Recording.2026-06-09.at.14.44.18.mov

@KJ21-ENG

KJ21-ENG commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@eVoloshchak pushed a follow-up for the rename case. The sidebar now waits for the modal close animation before auto-ending hover peek, so the RHP close and sidebar collapse should not overlap.

ezyZip.27.mp4

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@eVoloshchak Kind ping here. Thanks!

Comment thread src/components/Navigation/SearchSidebar.tsx
Comment thread src/components/Navigation/SearchSidebar.tsx Outdated
@eVoloshchak

Copy link
Copy Markdown
Contributor

@KJ21-ENG, now both "Delete" and "Rename" animations are choppy

Screen.Recording.2026-06-12.at.12.42.31.mov

@eVoloshchak

Copy link
Copy Markdown
Contributor

Found another bug

  1. Go to Account -> Troubleshoot
  2. Enable "Force offline"
  3. Press "Clear cache and restart"
  4. Go to Spend
  5. Collapse the sidebar
  6. Open "Testing preferences" menu, go back online
  7. Notice the loading skeleton inside the collapsed sidebar, it doesn't look right
Screen.Recording.2026-06-12.at.12.46.58.mov

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@KJ21-ENG, now both "Delete" and "Rename" animations are choppy

Screen.Recording.2026-06-12.at.12.42.31.mov

Yep, already working on it.

Found another bug

  1. Go to Account -> Troubleshoot
  2. Enable "Force offline"
  3. Press "Clear cache and restart"
  4. Go to Spend
  5. Collapse the sidebar
  6. Open "Testing preferences" menu, go back online
  7. Notice the loading skeleton inside the collapsed sidebar, it doesn't look right

Screen.Recording.2026-06-12.at.12.46.58.mov

Interesting, NW i will look into it as well. 👍

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@KJ21-ENG, now both "Delete" and "Rename" animations are choppy

Screen.Recording.2026-06-12.at.12.42.31.mov

@eVoloshchak I replaced the previous modal/RHP-coupled workaround with a sidebar-owned approach. The RHP is back to baseline, and the sidebar now manages peek cleanup based on pointer/click state. The skeleton change follows the existing isVisuallyCollapsed pattern already used by other search sidebar children.

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

Found another bug

  1. Go to Account -> Troubleshoot
  2. Enable "Force offline"
  3. Press "Clear cache and restart"
  4. Go to Spend
  5. Collapse the sidebar
  6. Open "Testing preferences" menu, go back online
  7. Notice the loading skeleton inside the collapsed sidebar, it doesn't look right

Screen.Recording.2026-06-12.at.12.46.58.mov

@eVoloshchak For the collapsed-sidebar skeleton case, there are two possible UX directions here:

  1. Hide the expanded skeleton while the sidebar is visually collapsed.
  2. Add a new collapsed-specific skeleton variant with compact/icon-sized placeholders.

I went with option 1 as the minimal fix for now as creating a new collapsed loading state feels more like a design decision. I think it would be good to get input from design (maybe from @dubielzyk-expensify @shawnborton) on whether the collapsed sidebar should show a compact skeleton at all, and if so, what that should look like.

cc: @eVoloshchak @trjExpensify @dubielzyk-expensify @shawnborton

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

I'd love if we could do 2 and just remove the labels on the skeletons here:

CleanShot 2026-06-15 at 12 39 27@2x

@KJ21-ENG

KJ21-ENG commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@dubielzyk-expensify Does this looks good to you ? 👀

ezyZip.43.mp4
image

@shawnborton

Copy link
Copy Markdown
Contributor

Maybe we update these section header skeletons too to just be the thin border line:
CleanShot 2026-06-15 at 09 51 07@2x

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

Maybe we update these section header skeletons too to just be the thin border line: CleanShot 2026-06-15 at 09 51 07@2x

@shawnborton Can you please share an image agian, as i am not able to understand concept from this 😅. Thanks!

@KJ21-ENG KJ21-ENG requested a review from eVoloshchak June 15, 2026 13:00
@shawnborton

Copy link
Copy Markdown
Contributor

Haha sorry! I meant, let's use lines like these when collapsed so they are all consistent:
CleanShot 2026-06-15 at 15 31 37@2x

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@shawnborton Does this look good to you ?

Screen.Recording.2026-06-16.at.2.43.50.AM.mov
image

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

That's looking great 👍

@shawnborton

Copy link
Copy Markdown
Contributor

Yup, agree!

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@eVoloshchak Looking for your feedback here. Thanks!

@KJ21-ENG KJ21-ENG requested a review from trjExpensify June 17, 2026 13:10

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

Good polish 👍

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

@melvin-bot melvin-bot Bot requested a review from blimpich June 17, 2026 17:54

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

Nice job! This looks really slick!

@blimpich blimpich merged commit d60a59d into Expensify:main Jun 17, 2026
33 of 34 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify

Copy link
Copy Markdown
Contributor

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

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required.

I reviewed the changes in this PR against the help-site articles under App/docs/articles. This is a UI interaction bug fix — it prevents the collapsed Spend search sidebar from staying stuck in its peeked/expanded state after a saved search is deleted, and adjusts the loading skeleton when the sidebar is collapsed.

The changes are limited to internal hover/peek state management and skeleton rendering:

  • SavedSearchItemThreeDotMenu.tsx — ends the peek when an overflow-menu item is selected
  • SearchTypeMenuWide.tsx — passes the collapsed state into the loading skeleton
  • SuggestedSearchSkeleton.tsx — hides labels / renders a collapsed divider while the sidebar is collapsed

No user-facing copy, feature names, tab names, settings labels, buttons, or documented workflows changed. The collapse/peek hover behavior of the Spend sidebar isn't described in any help article, so there's nothing to add or correct. No draft PR was created.

@KJ21-ENG, please confirm you agree no help-site updates are needed here. If you believe a documented flow is affected, let me know which article and I'll open a draft PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.15-3 🚀

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.

8 participants