Skip to content

revert: remove Home and Office commuter exclusions - #99777

Draft
francoisl wants to merge 1 commit into
mainfrom
francois-revert-94316
Draft

revert: remove Home and Office commuter exclusions#99777
francoisl wants to merge 1 commit into
mainfrom
francois-revert-94316

Conversation

@francoisl

@francoisl francoisl commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

This reverts commit 1c7808f, the merge of "Allow Home and Office Commuter exclusions"
(#94316), which caused bugs in production.

Removes the HOME_AND_OFFICE exclusion method, the homeAddressRequired guard modal and its isDistanceRequest flag, the AddHomeAddress time-sensitive item, the HomeAddressRequiredContent report action, and their translations.

"Add setting to prevent manual/odometer distance requests for a given policy" (#99433) merged on top of this and shares the same guard hook, so the conflicts were resolved to keep it intact: the useBlockDistanceRequest rename, the requireMapOrGPS setting and its toggle, and getDistanceExpenseTypeForPolicy at the distance entry points all stay. The hook returns to blocking manual/odometer flows only, now keyed off isMapOrGPSRequired so it still covers both requireMapOrGPS and commuter exclusions.

Fixed Issues

Some or all of:

#99752
#99752
#99740
#99735
#99731
#99725
#99724
#99722
#99720
#99713
#99712
#99711
#99710
#99709

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 comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I 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)
  • 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.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

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

This reverts commit 1c7808f, the merge of
"Allow Home and Office Commuter exclusions"
(#94316), which caused bugs in production.

Removes the HOME_AND_OFFICE exclusion method, the homeAddressRequired guard
modal and its isDistanceRequest flag, the AddHomeAddress time-sensitive item,
the HomeAddressRequiredContent report action, and their translations.

"Add setting to prevent manual/odometer distance requests for a given policy"
(#99433) merged on top of this and shares
the same guard hook, so the conflicts were resolved to keep it intact: the
useBlockDistanceRequest rename, the requireMapOrGPS setting and its toggle, and
getDistanceExpenseTypeForPolicy at the distance entry points all stay. The hook
returns to blocking manual/odometer flows only, now keyed off isMapOrGPSRequired
so it still covers both requireMapOrGPS and commuter exclusions.
@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 db454098..fc9705b4 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -7318,7 +7318,7 @@ Der Control-Tarif beginnt bei 9 $ pro aktivem Mitglied und Monat.`,
                 summaryDisabled: 'Kein Ausschluss von Pendelstrecken',
                 summaryFixedDistance: ({distance, unit}: {distance: number; unit: string}) => `${distance} ${unit} pro Abrechnung ausschließen`,
                 optionDisabledTitle: 'Pendelfahrten nicht ausschließen',
-                optionDisabledHelp: 'Es wird kein Ausschluss für den Arbeitsweg angewendet.',
+                optionDisabledHelp: 'Es wird kein Arbeitsweg-Ausschluss angewendet.',
                 optionFixedDistanceTitle: 'Eine feste Entfernung pro Antrag ausschließen',
                 optionFixedDistanceHelp: 'Ziehen Sie die gleiche Pendelstrecke von jeder Abrechnung ab. Am besten für Mitglieder geeignet, die eine Abrechnung pro Arbeitstag einreichen.',
                 distanceLabel: 'Entfernung',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index ed72cc6a..c4181b95 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -9,7 +9,6 @@
  * - Improve the prompts in prompts/translation, or
  * - Improve context annotations in src/languages/en.ts
  */
-
 import CONST from '@src/CONST';
 import type {OriginalMessageReportPreview, OriginalMessageSettlementAccountLocked, PersonalRulesModifiedFields, PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage';
 
@@ -7286,7 +7285,7 @@ El plan Controlar empieza en 9 $ por miembro activo al mes.`,
                 summaryDisabled: 'Sin exclusión por desplazamiento al trabajo',
                 summaryFixedDistance: ({distance, unit}: {distance: number; unit: string}) => `Excluir ${distance} ${unit} por reclamación`,
                 optionDisabledTitle: 'No excluir los desplazamientos al trabajo',
-                optionDisabledHelp: 'No se aplica ninguna exclusión de desplazamiento.',
+                optionDisabledHelp: 'No se aplica ninguna exclusión por desplazamiento.',
                 optionFixedDistanceTitle: 'Excluir una distancia fija por reclamación',
                 optionFixedDistanceHelp: 'Resta la misma distancia de desplazamiento de cada solicitud. Ideal para personas que envían una solicitud por día laborable.',
                 distanceLabel: 'Distancia',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index adb23abf..8b597f57 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -7281,7 +7281,7 @@ Il piano Control parte da 9 $ al mese per ogni membro attivo.`,
                 summaryDisabled: 'Nessuna esclusione per il tragitto',
                 summaryFixedDistance: ({distance, unit}: {distance: number; unit: string}) => `Escludi ${distance} ${unit} per rimborso`,
                 optionDisabledTitle: 'Non escludere gli spostamenti casa-lavoro',
-                optionDisabledHelp: 'Non è applicata alcuna esclusione per il tragitto casa-lavoro.',
+                optionDisabledHelp: 'Nessuna esclusione del tragitto casa-lavoro è applicata.',
                 optionFixedDistanceTitle: 'Escludi una distanza fissa per richiesta',
                 optionFixedDistanceHelp: 'Detrai la stessa distanza del tragitto casa-lavoro da ogni richiesta. Ideale per chi invia una richiesta per ogni giorno lavorativo.',
                 distanceLabel: 'Distanza',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 522ad75c..7e6d8957 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7189,7 +7189,7 @@ Control プランは、アクティブメンバー1人あたり月額 $9 から
                 summaryDisabled: '通勤除外なし',
                 summaryFixedDistance: ({distance, unit}: {distance: number; unit: string}) => `申請ごとに ${distance} ${unit} を除外します`,
                 optionDisabledTitle: '通勤を除外しない',
-                optionDisabledHelp: '通勤除外は適用されていません。',
+                optionDisabledHelp: '通勤の除外は適用されていません。',
                 optionFixedDistanceTitle: '申請ごとに一定距離を除外します',
                 optionFixedDistanceHelp: '各申請から同じ通勤距離を差し引きます。1勤務日につき1件の申請を行うメンバーに最適です。',
                 distanceLabel: '距離',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index b2c58fa1..f6c917fb 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -7286,7 +7286,7 @@ Plan Control zaczyna się od 9 USD za aktywnego członka miesięcznie.`,
                 summaryDisabled: 'Bez wykluczenia dojazdów',
                 summaryFixedDistance: ({distance, unit}: {distance: number; unit: string}) => `Wyklucz ${distance} ${unit} na zgłoszenie`,
                 optionDisabledTitle: 'Nie wykluczaj dojazdów',
-                optionDisabledHelp: 'Nie zastosowano wyłączenia dojazdów.',
+                optionDisabledHelp: 'Nie zastosowano wykluczenia dojazdów do pracy.',
                 optionFixedDistanceTitle: 'Wyklucz stały dystans na każde rozliczenie',
                 optionFixedDistanceHelp: 'Odejmij tę samą odległość dojazdu od każdego rozliczenia. Najlepsze dla osób, które składają jedno rozliczenie na każdy dzień pracy.',
                 distanceLabel: 'Dystans',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 9ce96e20..0dc0681c 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7008,7 +7008,7 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
                 summaryDisabled: '不排除通勤',
                 summaryFixedDistance: ({distance, unit}: {distance: number; unit: string}) => `每次报销排除 ${distance} ${unit}`,
                 optionDisabledTitle: '不要排除通勤',
-                optionDisabledHelp: '未应用通勤排除规则。',
+                optionDisabledHelp: '未应用通勤排除。',
                 optionFixedDistanceTitle: '为每笔报销排除固定距离',
                 optionFixedDistanceHelp: '从每笔报销中扣除相同的通勤距离。最适合每个工作日提交一笔报销的成员使用。',
                 distanceLabel: '距离',

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

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

@codecov

codecov Bot commented Aug 28, 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 92.59% <ø> (ø)
src/components/AddressForm.tsx 92.64% <100.00%> (-0.22%) ⬇️
...stReportView/MoneyRequestReportTransactionList.tsx 0.29% <ø> (+<0.01%) ⬆️
...tReportView/SearchMoneyRequestReportEmptyState.tsx 2.12% <ø> (+0.16%) ⬆️
...neyRequestReportPreview/AddExpenseActionButton.tsx 100.00% <ø> (ø)
src/hooks/useBlockDistanceRequest.ts 100.00% <100.00%> (ø)
src/hooks/useExpenseActions.ts 65.87% <ø> (-0.33%) ⬇️
src/hooks/useParticipantSubmission.ts 71.42% <ø> (-0.24%) ⬇️
src/libs/ReportUtils.ts 87.38% <ø> (+0.03%) ⬆️
src/pages/AddressPage.tsx 84.37% <100.00%> (ø)
... and 15 more
... and 13 files with indirect coverage changes

@francoisl

Copy link
Copy Markdown
Contributor Author

Discussing in https://expensify.slack.com/archives/C01GTK53T8Q/p1787883510578759, we might not need this as it's supposed to be behind a beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants