Skip to content

[hold] Add "Edit filters" to saved views#94547

Open
mukhrr wants to merge 30 commits into
Expensify:mainfrom
mukhrr:fix/92770
Open

[hold] Add "Edit filters" to saved views#94547
mukhrr wants to merge 30 commits into
Expensify:mainfrom
mukhrr:fix/92770

Conversation

@mukhrr

@mukhrr mukhrr commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #92770
PROPOSAL: #92770 (comment)

Tests

Preconditions:

  • Have a saved view: open Spend, apply a filter, click Save, name it "View A".
  1. Hover View A in the LHN Saved list, open its 3-dot menu, and verify Edit filters appears between Rename and Share.
  2. Click Edit filters and verify the filters popover opens pre-populated with View A's filters.
  3. Without changing anything, footer buttons: Cancel · Save as new view · Save edits are invisible.
  4. Change a filter (e.g. Type or Status) and verify the table updates live and footer buttons are visible.
  5. Click Save edits and verify View A is updated in place — one LHN entry, same name, new filters (no duplicate created).
  6. Open Edit filters again, change a filter, click Save as new view, name it "View B", Save — verify View A is unchanged and View B is added.
  7. Open Edit filters, change a filter, click Cancel — verify the changes are discarded and View A's original results return.
  8. Open Edit filters, change a filter, click outside the popover — verify it closes, filters got reverted the same as Cancel.
  9. Open Edit filters, close it (Cancel or outside click), then open Edit filters on the same view again — verify the popover re-opens.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

The 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • 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
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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
android_app.mp4
Android: mWeb Chrome
android_web.mp4
iOS: Native
ios_app.mp4
iOS: mWeb Safari
ios_web.mp4
MacOS: Chrome / Safari
REC-20260625182235.mp4

@mukhrr mukhrr requested review from a team as code owners June 25, 2026 06:22
@melvin-bot

melvin-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@melvin-bot melvin-bot Bot requested review from FitseTLT and trjExpensify and removed request for a team June 25, 2026 06:22
@melvin-bot

melvin-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

@FitseTLT Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot Bot removed the request for review from a team June 25, 2026 06:22
@mukhrr

mukhrr commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@trjExpensify can you pls trigger translations here?

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/index.ts 94.81% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/components/Search/SavedViewEditFooter.tsx 100.00% <100.00%> (ø)
src/hooks/usePopstateListener/index.native.ts 100.00% <100.00%> (ø)
src/hooks/useSearchTypeMenuSections.ts 83.63% <100.00%> (+0.30%) ⬆️
src/setup/index.ts 100.00% <ø> (ø)
src/libs/SearchUIUtils.ts 63.12% <88.88%> (+0.24%) ⬆️
src/components/PopoverMenu/index.tsx 90.62% <60.00%> (-0.87%) ⬇️
...c/components/Search/hooks/useUpdateFilterQuery.tsx 43.75% <60.00%> (-2.41%) ⬇️
src/pages/Search/SearchTypeMenuNarrow.tsx 75.00% <25.00%> (+0.28%) ⬆️
... and 9 more
... and 14 files with indirect coverage changes

@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: 08f70e2061

ℹ️ 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/FilterDropdowns/SearchAdvancedFiltersPopup/index.tsx Outdated
Comment thread src/pages/Search/SavedSearchList.tsx Outdated
@FitseTLT

Copy link
Copy Markdown
Contributor

Is this ready for my review? @mukhrr

@mukhrr

mukhrr commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Is this ready for my review? @mukhrr

@FitseTLT I think no #92770 (comment)

@mukhrr mukhrr marked this pull request as draft June 25, 2026 12:40
@trjExpensify

Copy link
Copy Markdown
Contributor

Running translations for you. I'm also going to switch @flaviadefaria on for the product review here, as she's been running this one. 👍

@trjExpensify trjExpensify requested review from flaviadefaria and removed request for trjExpensify June 25, 2026 20:00
@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 72935d43be9..28965d95e44 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -8431,9 +8431,9 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
         groupColumns: 'Spalten gruppieren',
         expenseColumns: 'Spalten für Ausgaben',
         saveView: 'Ansicht speichern',
-        editFilters: 'Edit filters',
-        saveEdits: 'Save edits',
-        saveAsNewView: 'Save as new view',
+        editFilters: 'Filter bearbeiten',
+        saveEdits: 'Änderungen speichern',
+        saveAsNewView: 'Als neue Ansicht speichern',
         deleteSavedSearch: 'Gespeicherte Suche löschen',
         deleteSavedSearchConfirm: 'Möchtest du diese Suche wirklich löschen?',
         searchName: 'Namen suchen',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 3b55b9c0cd9..87a1834c74f 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -8465,9 +8465,9 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
         groupColumns: 'Regrouper les colonnes',
         expenseColumns: 'Colonnes de dépenses',
         saveView: 'Enregistrer la vue',
-        editFilters: 'Edit filters',
-        saveEdits: 'Save edits',
-        saveAsNewView: 'Save as new view',
+        editFilters: 'Modifier les filtres',
+        saveEdits: 'Enregistrer les modifications',
+        saveAsNewView: 'Enregistrer comme nouvelle vue',
         deleteSavedSearch: 'Supprimer la recherche enregistrée',
         deleteSavedSearchConfirm: 'Voulez-vous vraiment supprimer cette recherche ?',
         searchName: 'Rechercher un nom',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index db83018ccba..268f26c5c9e 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -8420,9 +8420,9 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
         groupColumns: 'Raggruppa colonne',
         expenseColumns: 'Colonne spese',
         saveView: 'Salva vista',
-        editFilters: 'Edit filters',
-        saveEdits: 'Save edits',
-        saveAsNewView: 'Save as new view',
+        editFilters: 'Modifica filtri',
+        saveEdits: 'Salva modifiche',
+        saveAsNewView: 'Salva come nuova vista',
         deleteSavedSearch: 'Elimina ricerca salvata',
         deleteSavedSearchConfirm: 'Sei sicuro di voler eliminare questa ricerca?',
         searchName: 'Cerca nome',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index c9d5b2813e4..3c5c971ee73 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -8319,9 +8319,9 @@ ${reportName}`,
         groupColumns: '列をグループ化',
         expenseColumns: '経費列',
         saveView: 'ビューを保存',
-        editFilters: 'Edit filters',
-        saveEdits: 'Save edits',
-        saveAsNewView: 'Save as new view',
+        editFilters: 'フィルターを編集',
+        saveEdits: '編集を保存',
+        saveAsNewView: '新しいビューとして保存',
         deleteSavedSearch: '保存した検索を削除',
         deleteSavedSearchConfirm: 'この検索を削除してもよろしいですか?',
         searchName: '名前を検索',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 7d2f38818ec..6787d830231 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -8387,9 +8387,9 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
         groupColumns: 'Kolommen groeperen',
         expenseColumns: 'Onkostencolommen',
         saveView: 'Weergave opslaan',
-        editFilters: 'Edit filters',
-        saveEdits: 'Save edits',
-        saveAsNewView: 'Save as new view',
+        editFilters: 'Filters bewerken',
+        saveEdits: 'Wijzigingen opslaan',
+        saveAsNewView: 'Opslaan als nieuwe weergave',
         deleteSavedSearch: 'Opgeslagen zoekopdracht verwijderen',
         deleteSavedSearchConfirm: 'Weet je zeker dat je deze zoekopdracht wilt verwijderen?',
         searchName: 'Zoeknaam',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 0c3a8051c93..bc9c740e638 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -8380,9 +8380,9 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
         groupColumns: 'Grupuj kolumny',
         expenseColumns: 'Kolumny wydatków',
         saveView: 'Zapisz widok',
-        editFilters: 'Edit filters',
-        saveEdits: 'Save edits',
-        saveAsNewView: 'Save as new view',
+        editFilters: 'Edytuj filtry',
+        saveEdits: 'Zapisz zmiany',
+        saveAsNewView: 'Zapisz jako nowy widok',
         deleteSavedSearch: 'Usuń zapisaną wyszukiwanie',
         deleteSavedSearchConfirm: 'Na pewno chcesz usunąć to wyszukiwanie?',
         searchName: 'Wyszukaj nazwę',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index d590a9b5202..6800db8f7b0 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -8378,9 +8378,9 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
         groupColumns: 'Agrupar colunas',
         expenseColumns: 'Colunas de despesas',
         saveView: 'Salvar visualização',
-        editFilters: 'Edit filters',
-        saveEdits: 'Save edits',
-        saveAsNewView: 'Save as new view',
+        editFilters: 'Editar filtros',
+        saveEdits: 'Salvar edições',
+        saveAsNewView: 'Salvar como nova visualização',
         deleteSavedSearch: 'Excluir pesquisa salva',
         deleteSavedSearchConfirm: 'Tem certeza de que deseja excluir esta pesquisa?',
         searchName: 'Pesquisar nome',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index f5fa8793aba..f2f9129f285 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -8149,9 +8149,9 @@ ${reportName}`,
         groupColumns: '分组列',
         expenseColumns: '报销列',
         saveView: '保存视图',
-        editFilters: 'Edit filters',
-        saveEdits: 'Save edits',
-        saveAsNewView: 'Save as new view',
+        editFilters: '编辑筛选条件',
+        saveEdits: '保存编辑',
+        saveAsNewView: '另存为新视图',
         deleteSavedSearch: '删除已保存的搜索',
         deleteSavedSearchConfirm: '确定要删除此搜索吗?',
         searchName: '搜索名称',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@mukhrr mukhrr marked this pull request as ready for review June 26, 2026 09:28

@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: 02a3327616

ℹ️ 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/libs/actions/Search.ts Outdated
* edits change the query we pass the old hash as previousHash and the backend overrides it, keeping a single LHN entry.
*/
function saveSavedViewEdits({queryJSON, name, previousHash}: {queryJSON: Readonly<SearchQueryJSON>; name: string; previousHash: number}) {
saveSearch({queryJSON, newName: name, previousHash});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve auto-named views when saving edited filters

When the edited view was auto-named (name === original query) and the filters change, this always sends the original query string as newName. saveSearch then stores {name: oldQuery, query: newQuery}, and SavedSearchList only derives a readable title when item.name === item.query, so the saved view starts displaying the stale old query as a custom name after Save edits. Keep the auto-name case by using the edited query/default name when the original name matched the original query.

Useful? React with 👍 / 👎.

<HeaderWithBackButton title={translate('search.filtersHeader')} />
<HeaderWithBackButton
title={translate('search.filtersHeader')}
onBackButtonPress={isEditingSavedView ? cancelEdits : undefined}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear edit mode when the filters modal is dismissed

On narrow screens this only wires the header back button to cancelEdits. If the fullscreen filters route is dismissed via Android hardware back, browser back, or an iOS swipe gesture, neither this handler nor the footer Cancel runs, leaving SEARCH_EDITING_SAVED_VIEW set; subsequent search navigation can keep the old saved view highlighted and reopen filters in edit mode. Add an unmount/beforeRemove cleanup for the edit state.

Useful? React with 👍 / 👎.

@mukhrr mukhrr Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is wrong. I tested. BUt I think it's harmless and safe to implement this

@mukhrr

mukhrr commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@FitseTLT I think this is ready. can you pls review?! thanks!

@FitseTLT

FitseTLT commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What are the failings?

@mukhrr

mukhrr commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@FitseTLT It's okay now

flaviadefaria
flaviadefaria previously approved these changes Jul 7, 2026
@FitseTLT

FitseTLT commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@mukhrr can u pls give me an explanation on your recent changes? one the opening mechanism and the other pop state mechanism. What problems you are trying to fix, as some of the code looks a bit more complex and few timeout workarounds.

handleRef?: RefObject<FilterPopupButtonHandle | null>;

/** Called whenever the popover closes (click-outside, Cancel, Save or browser back) so the caller can leave any associated edit mode */
onOverlayClose?: (reason?: 'browserBack') => void;

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.

So we can replace reason with a boolean param right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's binary (for now) — used a literal so the call site reads onOverlayClose?.('browserBack') instead of (true), and a new close reason wouldn't change the signature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

want me update to boolean?

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.

We are fixing a specific case here, we don't know the future cases. It should definitely be an is... boolean

@mukhrr

mukhrr commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@mukhrr can u pls give me an explanation on your recent changes? one the opening mechanism and the other pop state mechanism. What problems you are trying to fix, as some of the code looks a bit more complex and few timeout workarounds.

@FitseTLT Recent changes came after this bug #94547 (comment).

Both fix the same root problem: opening the popup was driven by persisted state (onyx flag + requestID + latches), and stale state kept replaying it — Edit filters sometimes didn't open, and browser back reopened the popup (wide) / the filters page (narrow).

Opening: each Edit filters click now leaves one consumable open request. Once the view's search is active, the button consumes it (returns true exactly once) and opens the popup through the same path as pressing the Filters button. A consumed request can't replay, so requestID and all the latches are gone — it's less state overall.

Popstate: browser back should close the popup, otherwise it stays open over a different search. We can't use shouldCloseWhenBrowserNavigationChanged since live-apply changes route params on every filter change, and raw popstate alone also fires for in-app goBack (e.g. closing the year picker RHP). So we close only when popstate fired AND the search query actually changed. The timeout isn't polling — the check runs on the next navigation state event; the 1s timer is just a fallback in case that event fired before our listener.

The 'browserBack' reason exists because closing on back should only drop edit mode — re-running the view's query (what Cancel does) would fight the back navigation.

@trjExpensify

Copy link
Copy Markdown
Contributor

#94547 (comment) - on this, @FitseTLT can you just report it in the #expensify-bugs channel please?

@FitseTLT

FitseTLT commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

#94547 (comment) - on this, @FitseTLT can you just report it in the #expensify-bugs channel please?

Reported

Comment thread src/libs/actions/Search.ts Outdated
// Each "Edit filters" click requests ONE open of the filters UI. Consumed exactly once (read-and-clear), so nothing
// can replay it on remounts, browser back or stale Onyx emissions; the TTL discards a request that never became openable.
let pendingOpenEditFiltersAt: number | undefined;
const PENDING_OPEN_EDIT_FILTERS_TTL_MS = 10000;

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.

Do you really think this this is necessary? If we are consuming it why should we check with ttl have you faced any real problem

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm not actually, it was just defensive (a click whose navigation never lands could fire the open later when you visit the view manually).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we are good to remove it. tested

@mukhrr mukhrr requested a review from FitseTLT July 8, 2026 01:42
@FitseTLT

FitseTLT commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

lint failures @mukhrr

@mukhrr

mukhrr commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@FitseTLT resolved

@FitseTLT

FitseTLT commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@mukhrr your test steps are outdated and also fill all tests.

@mukhrr

mukhrr commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@FitseTLT thanks for catching 👍 updated it

@FitseTLT

FitseTLT commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

how is 2 still correct?

@mukhrr

mukhrr commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

oh sorry 🙏 now it should be all good

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

🎉

@melvin-bot melvin-bot Bot requested a review from JS00001 July 8, 2026 14:01
@JS00001

JS00001 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Discussing this w/ tom

@JS00001 JS00001 changed the title Add "Edit filters" to saved views [hold] Add "Edit filters" to saved views Jul 8, 2026
@JS00001

JS00001 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Discussed with @trjExpensify , and we'd like to hold these changes on this feature: https://github.com/Expensify/Expensify/issues/651173#issuecomment-4906136563

Basing this PR on those changes will drastically simplify the changes that need to be made here. We will also need to discuss changing the behavior here, based on those changes

Those changes should get moving tomorrow, so shouldn't be too long

edit: sorry, that issue is private, but I'll create an e/app issue for it tomorrow when we move to implementation

@trjExpensify

Copy link
Copy Markdown
Contributor

Makes sense to me to simplify the implementation 👍

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