Skip to content

[CP Staging] Fix focus trap tab registration loop - #96027

Merged
mountiny merged 3 commits into
Expensify:mainfrom
marufsharifi:fix/expense-focus-trap-loop
Jul 14, 2026
Merged

mountiny merged 3 commits into
Expensify:mainfrom
marufsharifi:fix/expense-focus-trap-loop

Conversation

@marufsharifi

@marufsharifi marufsharifi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixes a web crash when opening the create expense flow.

The tab focus-trap registration in OnyxTabNavigator was updating state every time the ref callback fired, even when the registered container element had not changed. After the web build pipeline change to OXC React Compiler, this unstable callback/ref path could repeatedly re-render until React threw Maximum update depth exceeded.

This PR makes the registration callbacks stable and prevents redundant focus-trap mapping updates when the container element is unchanged or already absent.

Fixed Issues

$ #96035
PROPOSAL:

Tests

  1. Open the app on web.
  2. Sign in.
  3. Navigate to a report.
  4. Click the create/add expense action.
  5. Verify the create expense flow opens without crashing.
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests.

QA Steps

Same as Tests

// 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

Screen.Recording.2026-07-14.at.3.02.55.PM.mov

Android: mWeb Chrome

Recording_20260714_145039.mp4

iOS: Native

Screen.Recording.2026-07-14.at.2.46.12.PM.mov

iOS: mWeb Safari

Screen.Recording.2026-07-14.at.2.47.39.PM.mov

MacOS: Chrome / Safari

Screen.Recording.2026-07-14.at.2.21.43.PM.mov

@codecov

codecov Bot commented Jul 14, 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/libs/Navigation/OnyxTabNavigator.tsx 58.42% <18.18%> (-3.02%) ⬇️
... and 10 files with indirect coverage changes

@mountiny
mountiny requested a review from Pujan92 July 14, 2026 09:34
@marufsharifi
marufsharifi marked this pull request as ready for review July 14, 2026 10:28
@marufsharifi
marufsharifi requested review from a team as code owners July 14, 2026 10:28
@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and mountiny and removed request for a team July 14, 2026 10:29
@melvin-bot

melvin-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

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


// This callback is used to register the focus trap container element of each available tab screen
const setTabFocusTrapContainerElement = (tabName: string, containerElement: HTMLElement | null) => {
const setTabFocusTrapContainerElement = useCallback((tabName: string, containerElement: HTMLElement | null) => {

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.

❌ CLEAN-REACT-PATTERNS-0 (docs)

React Compiler is enabled in this codebase (babel-plugin-react-compiler runs first in the build pipeline and this file is in scope — no "use no memo" opt-out is present). Wrapping setTabFocusTrapContainerElement in useCallback is redundant: the compiler already auto-memoizes this closure based on its captured values, and the manual wrapper adds a dependency array to maintain and can interfere with the compiler's own caching model.

Remove the useCallback and keep it a plain function:

const setTabFocusTrapContainerElement = (tabName: string, containerElement: HTMLElement | null) => {
    setFocusTrapContainerElementMapping((prevMapping) => {
        // ...
    });
};

(Note: if check-compiler.sh src/libs/Navigation/OnyxTabNavigator.tsx reports "Failed to compile" for this file, this rule does not apply and manual memoization is acceptable.)


Reviewed at: dbdaf63 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

const isDiscardModalOpenRef = useRef(false);

const registerTabGuard: RegisterTabSwitchGuard = (guard) => {
const registerTabGuard = useCallback<RegisterTabSwitchGuard>((guard) => {

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.

❌ CLEAN-REACT-PATTERNS-0 (docs)

React Compiler auto-memoizes closures, so wrapping registerTabGuard in useCallback<RegisterTabSwitchGuard> is redundant and adds noise the compiler already handles. Manual memoization here provides no value and must be maintained manually.

Remove the useCallback and keep the plain typed function:

const registerTabGuard: RegisterTabSwitchGuard = (guard) => {
    guardsRef.current.set(guard.tabName, guard);
    return () => {
        // ...
    };
};

(Note: if check-compiler.sh src/libs/Navigation/OnyxTabNavigator.tsx reports "Failed to compile" for this file, this rule does not apply.)


Reviewed at: dbdaf63 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

isDiscardModalOpenRef.current = false;
if (result.action !== ModalActions.CONFIRM) {
guard.onCancel?.();
const handleTabPress = useCallback(

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.

❌ CLEAN-REACT-PATTERNS-0 (docs)

Wrapping handleTabPress in useCallback with [showConfirmModal, translate] is redundant under React Compiler, which already tracks the captured variables and memoizes this handler automatically. The manual dependency array must be kept in sync by hand and can interfere with the compiler's optimizations.

Remove the useCallback wrapper and revert to a plain function declaration:

const handleTabPress = (navigation: NavigationProp<ParamListBase>, event: EventArg<'tabPress', true, undefined>) => {
    // ...
};

(Note: if check-compiler.sh src/libs/Navigation/OnyxTabNavigator.tsx reports "Failed to compile" for this file, this rule does not apply.)


Reviewed at: dbdaf63 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

const handleContainerElementChanged = (element: HTMLElement | null) => {
setTabContainerElement(route.name, element);
};
const handleContainerElementChanged = useCallback(

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.

❌ CLEAN-REACT-PATTERNS-0 (docs)

Wrapping handleContainerElementChanged in useCallback with [setTabContainerElement, route.name] is redundant — React Compiler auto-memoizes this closure from its captured values. The manual wrapper and dependency array add maintenance burden without benefit.

Remove the useCallback and keep it a plain function:

const handleContainerElementChanged = (element: HTMLElement | null) => {
    setTabContainerElement(route.name, element);
};

(Note: if check-compiler.sh src/libs/Navigation/OnyxTabNavigator.tsx reports "Failed to compile" for this file, this rule does not apply.)


Reviewed at: dbdaf63 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

@Pujan92

Pujan92 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@marufsharifi any idea why it(OXC React Compiler) is only causing issue for this component and not anywhere else?

@Pujan92

Pujan92 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

With the help of Claude code, I see 42 files bailed out

Divergent (babel/native memoizes, OXC/web bails): 42 files

By reason:
42 Todo: Unsupported declaration type for hoisting

Files:
src/components/AutoCompleteSuggestions/BaseAutoCompleteSuggestions.tsx [Todo: Unsupported declaration type for hoisting]
src/components/FlatList/hooks/useFlatListScrollKey.ts [Todo: Unsupported declaration type for hoisting]
src/components/Picker/BasePicker.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Picker/index.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Rule/TextBase.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/FilterComponents/SingleSelect.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/SearchList/ListItem/BaseListItemHeader.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/SearchList/ListItem/CardListItemHeader.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/SearchList/ListItem/ExpenseReportListItem.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/SearchList/ListItem/MemberListItemHeader.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/SearchList/ListItem/ReportListItemHeader.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Search/SearchList/ListItem/WithdrawalIDListItemHeader.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SelectionList/BaseSelectionList.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SelectionList/SelectionListWithSections/BaseSelectionListWithSections.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SelectionList/hooks/useFlattenedSections.ts [Todo: Unsupported declaration type for hoisting]
src/components/SelectionListWithModal/index.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SubStepForms/AddressStep.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SubStepForms/AgreementsFullStep.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SubStepForms/DateOfBirthStep.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SubStepForms/DocusignFullStep.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SubStepForms/FullNameStep.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SubStepForms/PushRowFieldsStep.tsx [Todo: Unsupported declaration type for hoisting]
src/components/SubStepForms/RegistrationNumberStep.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Table/Table.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Table/TableHeader.tsx [Todo: Unsupported declaration type for hoisting]
src/components/Table/middlewares/filtering.ts [Todo: Unsupported declaration type for hoisting]
src/components/Table/middlewares/sorting.ts [Todo: Unsupported declaration type for hoisting]
src/components/Tables/WorkspaceCategoryRulesTable/index.tsx [Todo: Unsupported declaration type for hoisting]
src/components/TransactionItemRow/EditableCell/usePopoverEditState.ts [Todo: Unsupported declaration type for hoisting]
src/hooks/useDebounce.ts [Todo: Unsupported declaration type for hoisting]
src/hooks/useDebounceNonReactive.ts [Todo: Unsupported declaration type for hoisting]
src/hooks/useInitialSelection.ts [Todo: Unsupported declaration type for hoisting]
src/hooks/useOnyx.ts [Todo: Unsupported declaration type for hoisting]
src/hooks/useStableIndexedHandler.ts [Todo: Unsupported declaration type for hoisting]
src/hooks/useStepFormSubmit.ts [Todo: Unsupported declaration type for hoisting]
src/hooks/useSubPage/index.tsx [Todo: Unsupported declaration type for hoisting]
src/hooks/useVerifyAccountAndResume.ts [Todo: Unsupported declaration type for hoisting]
src/hooks/useWorkletStateMachine/index.ts [Todo: Unsupported declaration type for hoisting]
src/libs/Navigation/OnyxTabNavigator.tsx [Todo: Unsupported declaration type for hoisting]
src/pages/inbox/report/useDebouncedSaveDraft.ts [Todo: Unsupported declaration type for hoisting]

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@Pujan92

Pujan92 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The trigger: a type-parameter reference in a type position (x as T) used inside a nested callback that React Compiler needs to memoize/outline.

Evidence chain:

Move const v = a as T inside a nested callback → bails ❌ (case F). The non-generic version of the same structure compiles (case I). So it's specifically the type-param cast inside the outlined function.
On the real file: keeping the generic but rewriting as TTabName → as string makes OnyxTabNavigator compile ✅. That's the definitive proof.

if (newSelectedTab) {
Tab.setSelectedTab<TTabName>(id, newSelectedTab as TTabName);
}
onTabSelected(newSelectedTab as TTabName);

What's happening under the hood: React Compiler outlines/memoizes that nested state callback. While lowering it to HIR, it encounters newSelectedTab as TTabName — a TSTypeReference to TTabName. To resolve the reference it looks up TTabName's declaration, finds a TSTypeParameter node, and OXC's hoisting pass has no handler for that declaration kind → it throws the Todo: Unsupported declaration type for hoisting and bails the entire component. babel-plugin-react-compiler strips/normalizes TS types earlier in its pipeline, so it never hits this — which is exactly why native memoizes and web doesn't.

Hoist the cast out of the callback (cast newSelectedTab to TTabName once, above the screenListeners arrow), or
Avoid the type-param cast in the nested callback (e.g. cast to a concrete type / restructure the typing).
Either would let OXC memoize the component again — but the explicit useCallback fix is the safest until OXC's react-compiler closes this Todo.

@marufsharifi As claude is suggesting to hoist the case out of the callback with below changes, can you plz try this as looks good to me?

// Hoist the `TTabName` casts out of the `screenListeners` callback below. OXC's React Compiler (used by the
// web build) cannot hoist a type-parameter reference that appears inside that outlined callback, so it bails
// on memoizing the whole component — which leaves the context callbacks unstable and reintroduces an infinite
// tab focus-trap update loop on web. Re-typing the consumers to accept a plain string here keeps the callback
// body free of any `as TTabName`, so the component compiles and gets auto-memoized.
const persistSelectedTab = Tab.setSelectedTab as (tabId: string, tabName: string) => void;
const notifyTabSelected = onTabSelected as (newTabName: string | undefined) => void;

Replace the existing with these vars

if (newSelectedTab) {
    persistSelectedTab(id, newSelectedTab);
}
notifyTabSelected(newSelectedTab);

@Pujan92

Pujan92 commented Jul 14, 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 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 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)
  • 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.
  • 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
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2026-07-14.at.18.58.30.mov
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2026-07-14.at.18.59.35.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-14.at.18.52.33.mov

Comment thread src/libs/Navigation/OnyxTabNavigator.tsx Outdated

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

@marufsharifi

Copy link
Copy Markdown
Contributor Author

The failing tests appear unrelated to the changes in our PR.

@mountiny mountiny changed the title Fix focus trap tab registration loop [CP Staging] Fix focus trap tab registration loop Jul 14, 2026
@mountiny

Copy link
Copy Markdown
Contributor

the Jest tests are unrelated to this

@mountiny
mountiny merged commit 485f997 into Expensify:main Jul 14, 2026
33 of 35 checks passed
@mountiny

Copy link
Copy Markdown
Contributor

OSBotify pushed a commit that referenced this pull request Jul 14, 2026
[CP Staging] Fix focus trap tab registration loop

(cherry picked from commit 485f997)

(cherry-picked to staging by mountiny)
@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Jul 14, 2026
@melvin-bot

melvin-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@melvin-bot melvin-bot Bot added the Emergency label Jul 14, 2026
@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.

@mountiny

Copy link
Copy Markdown
Contributor

The failing tests were unrelated to these changes and addressed in another pr already

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.4.34-2 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site changes are required for this PR, so I did not create a draft docs PR.

Why: This is an internal, non-user-facing fix. The only change is to src/libs/Navigation/OnyxTabNavigator.tsx — it stabilizes the focus-trap tab registration callbacks to fix a web crash (Maximum update depth exceeded) in the create expense flow after the OXC React Compiler build change.

There is no new or renamed feature, tab, setting, button, label, or workflow — nothing that the customer-facing articles under docs/articles describe. The user-visible result is simply "the create expense flow no longer crashes," which isn't documented behavior. So there's nothing in the help site to add or update.

If I've misread the scope and you believe a specific article needs updating, let me know which one and I'll draft it.

@jponikarchuk

Copy link
Copy Markdown

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

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

Bundle Size Analysis (Sentry):

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.4.35-1 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required.

I reviewed the changes in this PR. It only modifies src/libs/Navigation/OnyxTabNavigator.tsx and is a pure internal bug fix — it stabilizes the tab focus-trap registration callbacks to stop an infinite re-render loop (Maximum update depth exceeded) that crashed the create expense flow on web after the OXC React Compiler migration.

There is no user-facing change here:

  • No new or changed features, UI labels, tab names, settings, or buttons.
  • No change to any documented workflow — the create expense flow behaves exactly as before, it just no longer crashes.

Because nothing in App/docs/articles describes this internal navigation/rendering behavior, there is nothing to add or update, and I did not create a draft docs PR.

@marufsharifi, if you believe a specific help article is affected that I may have missed, let me know which article/behavior and I'll take another look.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.4.35-6 🚀

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

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants