Skip to content

Inbox filters#92146

Draft
youssef-lr wants to merge 9 commits into
mainfrom
youssef_inbox_filters
Draft

Inbox filters#92146
youssef-lr wants to merge 9 commits into
mainfrom
youssef_inbox_filters

Conversation

@youssef-lr
Copy link
Copy Markdown
Contributor

@youssef-lr youssef-lr commented May 30, 2026

Explanation of Change

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/640582

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • 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.
  • I verified that similar component doesn't exist in the codebase
  • I verified that all props are defined accurately and each prop has a /** comment above it */
  • I verified that each file is named correctly
  • I verified that each component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
  • I verified that the only data being stored in component state is data necessary for rendering and nothing else
  • In component if we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
  • 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)
  • I verified that component 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)
  • I verified that all JSX used for rendering exists in the render method
  • I verified that each 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

Screenshots/Videos

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

shawnborton and others added 6 commits April 17, 2026 12:29
Replace the hidden Focus/Priority mode toggle in Account > Preferences
with visible tab filters at the top of the Inbox: All, Unread, Expenses,
and Direct messages. This gives users immediate, discoverable control
over which chats they see.

- Add CONST.INBOX_TAB and ONYXKEYS.NVP_INBOX_TAB for tab state
- Add filterReportsForInboxTab() post-filter in SidebarUtils
- Add InboxTabSelector component using TabSelectorBase with small size
- Add 'small' size variant to TabSelector components (28px height, 11px font)
- Remove isInFocusMode from the entire report pipeline
- Remove PriorityModeHandler, PriorityModeController, FocusModeNotification
- Remove PriorityModePage and its route/navigation config
- Remove updateChatPriorityMode API command
- Update all test files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the Unread tab with a "To do" tab that shows items needing
action (GBR/RBR indicators). Rename Direct Messages to DMs.

Add a separate Unreads toggle in the Inbox header using a small 20px
Switch component. The toggle filters to show only unread items and
works across all tabs. State persists via NVP_INBOX_UNREAD_FILTER.

- Add 'small' size variant to Switch component (36x20 track, 14x14 thumb)
- Add switchTrackSmall/switchThumbSmall styles
- Add InboxUnreadToggle component with "Unreads" label + small switch
- Update filterReportsForInboxTab to apply unread filter orthogonally

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simplify inbox filtering to four straightforward tabs:
All, Unread, Expenses, and DMs. Remove the separate Unreads toggle
and To-do tab in favor of a clean Unread tab that shows only
unread and non-muted chats. Pinned/GBR/RBR items show only if
they qualify for the active tab filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve conflicts with upstream changes that added isOffline parameter
and refactored shouldDisplayReportInLHN to use a params object.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@OSBotify

This comment has been minimized.

@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 e3222cf3a28..6d960942c3b 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -2890,15 +2890,11 @@ ${amount} für ${merchant} – ${date}`,
         },
     },
     focusModeUpdateModal: {
-        title: 'Willkommen im #Fokusmodus!',
+        title: 'Willkommen im #focus-Modus!',
         prompt: (priorityModePageUrl: string) =>
-            `Behalte den Überblick, indem du nur ungelesene Chats oder Chats siehst, die deine Aufmerksamkeit benötigen. Keine Sorge, du kannst das jederzeit in den <a href="${priorityModePageUrl}">Einstellungen</a> ändern.`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+            `Behalten Sie den Überblick, indem Sie nur ungelesene Chats oder Chats sehen, die Ihre Aufmerksamkeit erfordern. Keine Sorge, Sie können dies jederzeit in den <a href="${priorityModePageUrl}">Einstellungen</a> ändern.`,
     },
+    inboxTabs: {all: 'Alle', todo: 'To-do', unread: 'Ungelesen'},
     reportDetailsPage: {
         inWorkspace: (policyName: string) => `in ${policyName}`,
         generatingPDF: 'PDF erstellen',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index a222c9dd554..9fdf481bb23 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -2769,15 +2769,11 @@ ${amount} para ${merchant} - ${date}`,
         },
     },
     focusModeUpdateModal: {
-        title: '¡Bienvenido al modo #concentración!',
-        prompt: (priorityModePageUrl) =>
-            `Mantente al tanto de todo viendo sólo los chats no leídos o los que necesitan tu atención. No te preocupes, puedes cambiar el ajuste en cualquier momento desde la <a href="${priorityModePageUrl}">configuración</a>.`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+        title: '¡Bienvenido al modo #focus!',
+        prompt: (priorityModePageUrl: string) =>
+            `Mantente al tanto de todo viendo solo los chats sin leer o los que necesitan tu atención. No te preocupes, puedes cambiar esto en cualquier momento en los <a href="${priorityModePageUrl}">ajustes</a>.`,
     },
+    inboxTabs: {all: 'Todo', todo: 'Pendientes', unread: 'No leído'},
     reportDetailsPage: {
         inWorkspace: (policyName) => `en ${policyName}`,
         generatingPDF: 'Generar PDF',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 48d1f73eb2d..e747b8436ea 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -2814,9 +2814,9 @@ ${amount} pour ${merchant} - ${date}`,
         title: 'Modifier l’agent',
         agentName: 'Nom de l’agent',
         instructions: 'Écrire des instructions personnalisées',
-        chatWithAgent: 'Discuter avec l\u2019agent',
+        chatWithAgent: 'Discuter avec l’agent',
         copilotIntoAccount: 'Copilote dans le compte',
-        deleteAgent: 'Supprimer l\u2019agent',
+        deleteAgent: 'Supprimer l’agent',
         deleteAgentTitle: 'Supprimer l’agent ?',
         deleteAgentMessage: 'Voulez-vous vraiment supprimer cet agent ? Cette action est irréversible.',
     },
@@ -2898,15 +2898,11 @@ ${amount} pour ${merchant} - ${date}`,
         },
     },
     focusModeUpdateModal: {
-        title: 'Bienvenue en mode #focus !',
+        title: 'Bienvenue dans le mode #focus !',
         prompt: (priorityModePageUrl: string) =>
-            `Gardez le contrôle en affichant uniquement les discussions non lues ou celles qui nécessitent votre attention. Ne vous inquiétez pas, vous pouvez modifier ce paramètre à tout moment dans les <a href="${priorityModePageUrl}">paramètres</a>.`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+            `Gardez une longueur d’avance en n’affichant que les discussions non lues ou celles qui nécessitent votre attention. Ne vous inquiétez pas, vous pourrez modifier ce paramètre à tout moment dans les <a href="${priorityModePageUrl}">paramètres</a>.`,
     },
+    inboxTabs: {all: 'Tout', todo: 'À faire', unread: 'Non lu'},
     reportDetailsPage: {
         inWorkspace: (policyName: string) => `dans ${policyName}`,
         generatingPDF: 'Générer le PDF',
@@ -2989,7 +2985,7 @@ ${amount} pour ${merchant} - ${date}`,
         phoneOrEmail: 'Téléphone ou e-mail',
         error: {
             agentSignInBlocked:
-                'Les comptes d\u2019agent ne permettent pas de se connecter directement. Pour utiliser un agent, connectez-vous avec votre propre compte et accédez-y via Copilot.',
+                'Les comptes d’agent ne permettent pas de se connecter directement. Pour utiliser un agent, connectez-vous avec votre propre compte et accédez-y via Copilot.',
             invalidFormatEmailLogin: 'L’adresse e-mail saisie est invalide. Veuillez corriger le format et réessayer.',
         },
         cannotGetAccountDetails: 'Impossible de récupérer les détails du compte. Veuillez essayer de vous reconnecter.',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 74008d5b625..d934838ae4d 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -2802,8 +2802,8 @@ ${amount} per ${merchant} - ${date}`,
         title: 'Modifica agente',
         agentName: 'Nome agente',
         instructions: 'Scrivi istruzioni personalizzate',
-        chatWithAgent: 'Chatta con l\u2019agente',
-        copilotIntoAccount: 'Copilot nell\u2019account',
+        chatWithAgent: 'Chatta con l’agente',
+        copilotIntoAccount: 'Copilot nell’account',
         deleteAgent: 'Elimina agente',
         deleteAgentTitle: 'Eliminare agente?',
         deleteAgentMessage: 'Sei sicuro di voler eliminare questo agente? Questa azione non può essere annullata.',
@@ -2886,15 +2886,11 @@ ${amount} per ${merchant} - ${date}`,
         },
     },
     focusModeUpdateModal: {
-        title: 'Benvenuto/a nella modalità #focus!',
+        title: 'Benvenuto nella modalità #focus!',
         prompt: (priorityModePageUrl: string) =>
-            `Resta sempre aggiornato vedendo solo le chat non lette o quelle che richiedono la tua attenzione. Non preoccuparti, puoi modificare questa impostazione in qualsiasi momento nelle <a href="${priorityModePageUrl}">impostazioni</a>.`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+            `Resta al passo visualizzando solo le chat non lette o quelle che richiedono la tua attenzione. Non preoccuparti, puoi modificare questa impostazione in qualsiasi momento nelle <a href="${priorityModePageUrl}">impostazioni</a>.`,
     },
+    inboxTabs: {all: 'Tutti', todo: 'Da fare', unread: 'Non letti'},
     reportDetailsPage: {
         inWorkspace: (policyName: string) => `in ${policyName}`,
         generatingPDF: 'Genera PDF',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 846c4766166..bc4c425a464 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -2862,15 +2862,11 @@ ${date} の ${merchant} への ${amount}`,
         },
     },
     focusModeUpdateModal: {
-        title: '#focusモードへようこそ!',
+        title: '#focus モードへようこそ!',
         prompt: (priorityModePageUrl: string) =>
-            `未読のチャットや対応が必要なチャットだけを表示して、常に状況を把握しましょう。いつでも<a href="${priorityModePageUrl}">設定</a>から変更できます。`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+            `未読のチャットや対応が必要なチャットだけを表示して、見落としを防ぎましょう。いつでも<a href="${priorityModePageUrl}">設定</a>から変更できます。`,
     },
+    inboxTabs: {all: 'すべて', todo: 'To-do', unread: '未読'},
     reportDetailsPage: {
         inWorkspace: (policyName: string) => `${policyName} 内`,
         generatingPDF: 'PDFを生成',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index c522b5421e4..d70faec9836 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -2883,15 +2883,11 @@ ${amount} voor ${merchant} - ${date}`,
         },
     },
     focusModeUpdateModal: {
-        title: 'Welkom bij de #focus-modus!',
+        title: 'Welkom bij de #focusmodus!',
         prompt: (priorityModePageUrl: string) =>
-            `Houd het overzicht door alleen ongelezen chats of chats die je aandacht nodig hebben te zien. Geen zorgen, je kunt dit op elk moment wijzigen in de <a href="${priorityModePageUrl}">instellingen</a>.`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+            `Blijf overal van op de hoogte door alleen ongelezen chats of chats te zien die je aandacht nodig hebben. Maak je geen zorgen, je kunt dit op elk moment wijzigen in de <a href="${priorityModePageUrl}">instellingen</a>.`,
     },
+    inboxTabs: {all: 'Alles', todo: 'Takenlijst', unread: 'Ongelezen'},
     reportDetailsPage: {
         inWorkspace: (policyName: string) => `in ${policyName}`,
         generatingPDF: 'PDF genereren',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 58a4b7b4975..20ca0fd2eaa 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -2877,15 +2877,11 @@ ${amount} dla ${merchant} - ${date}`,
         },
     },
     focusModeUpdateModal: {
-        title: 'Witamy w trybie #focus!',
+        title: 'Witaj w trybie #focus!',
         prompt: (priorityModePageUrl: string) =>
-            `Miej wszystko pod kontrolą, wyświetlając tylko nieprzeczytane czaty lub czaty wymagające Twojej uwagi. Nie martw się, możesz to zmienić w dowolnym momencie w <a href="${priorityModePageUrl}">ustawieniach</a>.`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+            `Miej wszystko pod kontrolą, wyświetlając tylko nieprzeczytane czaty lub czaty wymagające twojej uwagi. Nie martw się, możesz to zmienić w każdej chwili w <a href="${priorityModePageUrl}">ustawieniach</a>.`,
     },
+    inboxTabs: {all: 'Wszystkie', todo: 'Do zrobienia', unread: 'Nieprzeczytane'},
     reportDetailsPage: {
         inWorkspace: (policyName: string) => `w ${policyName}`,
         generatingPDF: 'Wygeneruj PDF',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 0de92a89420..7d501770b63 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -2879,13 +2879,9 @@ ${amount} para ${merchant} - ${date}`,
     focusModeUpdateModal: {
         title: 'Bem-vindo ao modo #focus!',
         prompt: (priorityModePageUrl: string) =>
-            `Mantenha tudo sob controle vendo apenas os chats não lidos ou que precisam da sua atenção. Não se preocupe, você pode alterar isso a qualquer momento em <a href="${priorityModePageUrl}">configurações</a>.`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+            `Fique por dentro de tudo vendo apenas os chats não lidos ou que precisam da sua atenção. Não se preocupe, você pode mudar isso a qualquer momento em <a href="${priorityModePageUrl}">configurações</a>.`,
     },
+    inboxTabs: {all: 'Todos', todo: 'Tarefas', unread: 'Não lido'},
     reportDetailsPage: {
         inWorkspace: (policyName: string) => `em ${policyName}`,
         generatingPDF: 'Gerar PDF',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index c0641efcf72..ea443502e46 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -2806,13 +2806,9 @@ ${amount},商户:${merchant} - 日期:${date}`,
     },
     focusModeUpdateModal: {
         title: '欢迎进入 #focus 模式!',
-        prompt: (priorityModePageUrl: string) => `通过仅查看未读聊天或需要你关注的聊天来随时掌握进展。别担心,你可以随时在<a href="${priorityModePageUrl}">设置</a>中更改此项。`,
-    },
-    inboxTabs: {
-        all: 'All',
-        todo: 'To-do',
-        unread: 'Unread',
+        prompt: (priorityModePageUrl: string) => `通过只查看未读聊天或需要你处理的聊天,随时掌控一切。别担心,你可以随时在<a href="${priorityModePageUrl}">设置</a>中更改此选项。`,
     },
+    inboxTabs: {all: '全部', todo: '待办事项', unread: '未读'},
     reportDetailsPage: {
         inWorkspace: (policyName: string) => `在 ${policyName} 中`,
         generatingPDF: '生成 PDF',

Note

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

View workflow run

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #92146.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Web 🕸️
https://92146.pr-testing.expensify.com
Web

👀 View the workflow run that generated this build 👀

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

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 93.84% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/components/ScrollOffsetContextProvider.tsx 67.24% <100.00%> (+2.42%) ⬆️
src/components/TabSelector/TabLabel.tsx 100.00% <100.00%> (ø)
src/components/TabSelector/TabSelectorBase.tsx 94.73% <100.00%> (ø)
src/components/TabSelector/TabSelectorItem.tsx 100.00% <100.00%> (ø)
src/pages/inbox/sidebar/BaseSidebarScreen.tsx 100.00% <100.00%> (ø)
src/pages/inbox/sidebar/InboxTabSelector.tsx 100.00% <100.00%> (ø)
src/styles/index.ts 59.37% <100.00%> (+0.30%) ⬆️
src/hooks/useSidebarOrderedReports.tsx 94.73% <83.33%> (-1.13%) ⬇️
... and 2 more
... and 166 files with indirect coverage changes

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.

3 participants