You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-05-20] [Due for payment 2026-05-18] iOS - Camera - App theme does not change while on camera mode #90236
Version Number: 9.3.69-13 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#87681 Email or phone of affected tester (no customers):josdjnosdjionjsdonjisod@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iPhone 15 Pro Max / iOS 26.4.2 App Component: Chat Report View
Action Performed:
Launch Expensify app.
Go to workspace chat.
Tap + > Add attachment > Take photo.
Pull down control center.
Turn on/off dark mode.
Dismiss control center.
Expected Result:
App theme will change while on camera mode.
Actual Result:
App theme does not change while on camera mode.
It only changes after closing camera mode.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #87681 - "fix: use in-app VisionCamera for chat attachment photos" by @MelvinBot (High confidence) Related Issues: #84018 (original bug this PR was fixing)
Recommendation: REVERT
PR #87681 introduced a new AttachmentCamera component that wraps the in-app camera in a React Native <Modal>. On iOS, React Native's Modal component renders in a separate native view hierarchy, which is isolated from the parent React context tree. This means that when the system color scheme changes (e.g., toggling dark/light mode via Control Center), the ThemeContext update does not propagate into the modal, so the camera screen retains the stale theme until the modal is closed. Reverting this PR resolves the issue.
Assigned: @ShridharGoel (approving reviewer), @srikarparsi (approving reviewer) from PR #87681 Labels: DeployBlockerCash kept (Frontend bug in App repo). No label changes made.
The issue is "Reproducible in staging? Yes" and marked "N/A - new feature, doesn't exist in prod", confirming this is a staging-only regression introduced by the PR.
The PR replaced the external camera intent with a new in-app AttachmentCamera component that renders inside a React Native <Modal>.
The AttachmentCamera component uses useTheme() and useThemeStyles() to obtain theme values, which depend on ThemeContext.
The component wraps its UI in a React Native <Modal visible={isVisible} ...> component.
ThemeProvider (in src/components/ThemeProvider.tsx) provides theme context via ThemeContext.Provider. On iOS, React Native's <Modal> renders in a separate native window, breaking the React context chain — child components inside the modal do not receive context updates from the parent tree when the system theme changes while the modal is open.
The receipt scan camera screen (IOURequestStepScan) does not use a <Modal> — it is a proper navigation screen — which is why it does not have this problem.
Root Cause
AttachmentCamera renders its content inside a React Native <Modal>. On iOS, this modal creates a new native UIWindow, which hosts a separate React root. The ThemeContext provided by the app-level ThemeProvider is not automatically bridged into this new root. As a result, when the user toggles dark/light mode from the Control Center while the camera modal is open, useColorScheme() fires in the main app tree and updates ThemeContext, but the modal's component subtree does not receive this update. The theme change only takes effect after the modal is closed and re-rendered within the main tree.
AttachmentCamera (AttachmentCamera.tsx:178) uses React Native's raw <Modal> directly (imported from 'react-native'). On iOS, this creates a separate native UIWindow, which becomes the key window. When the user toggles dark/light mode from Control Center while the camera modal is open, the Appearance change event targets this new key window — but useColorScheme() in useThemePreference.ts:9 (consumed by ThemeProvider.tsx) lives in the original RCTRootView window and does not receive the update. The theme change only takes effect after the modal is dismissed.
By contrast, IOURequestStepScan (index.native.tsx) is a regular navigation screen (no <Modal>), so no separate UIWindow is created and theme propagation works normally.
What changes do you think we should make in order to solve the problem?
Replace the raw <Modal> in AttachmentCamera with a full-screen navigation screen approach (similar to IOURequestStepScan), or at minimum switch to the app's BaseModal which already wraps children in ColorSchemeWrapper (line 411).
Since BaseModal still ultimately uses RN's Modal under the hood (same UIWindow issue), the cleanest fix is to restructure AttachmentCamera as a navigation screen instead of a modal — this completely eliminates the separate UIWindow and ensures theme context propagates correctly.
What alternative solutions did you explore? (Optional)
Wrapping Modal children in a new ThemeProvider: This alone wouldn't fix it — ThemeProvider itself depends on useColorScheme(), which is the broken link when a separate UIWindow is the key window.
Listening to Appearance.addChangeListener inside the Modal: This could work as a workaround by manually subscribing to appearance changes from within the Modal's component tree, but it adds complexity and diverges from the established pattern.
Supporting evidence
AttachmentCamera imports raw Modal from 'react-native' at line 2 and renders it at line 178
Theme is consumed via useTheme() at line 49 — values are read at render time but the upstream signal never fires while the Modal's UIWindow is active
ThemeProvider debounces theme changes by 300ms via useDebouncedState at line 16, which could add latency even when the signal does propagate
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Not 100% sure to say this issue not reproducible because i can see different behavior while using build v9.3.69-17.
background automatically change when we turn on/off dark mode , but the viewfinder camera have the same color theme
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.69-18 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
changed the title [-]iOS - Camera - App theme does not change while on camera mode[/-][+][Due for payment 2026-05-18] iOS - Camera - App theme does not change while on camera mode[/+]on May 11, 2026
@ShridharGoel The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
changed the title [-][Due for payment 2026-05-18] iOS - Camera - App theme does not change while on camera mode[/-][+][Due for payment 2026-05-20] [Due for payment 2026-05-18] iOS - Camera - App theme does not change while on camera mode[/+]on May 13, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.72-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ShridharGoel The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon May 11, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #87681
melvin-bot commentedon May 11, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 11, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon May 11, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #87681 - "fix: use in-app VisionCamera for chat attachment photos" by @MelvinBot (High confidence)
Related Issues: #84018 (original bug this PR was fixing)
Recommendation: REVERT
PR #87681 introduced a new
AttachmentCameracomponent that wraps the in-app camera in a React Native<Modal>. On iOS, React Native'sModalcomponent renders in a separate native view hierarchy, which is isolated from the parent React context tree. This means that when the system color scheme changes (e.g., toggling dark/light mode via Control Center), theThemeContextupdate does not propagate into the modal, so the camera screen retains the stale theme until the modal is closed. Reverting this PR resolves the issue.Assigned: @ShridharGoel (approving reviewer), @srikarparsi (approving reviewer) from PR #87681
Labels:
DeployBlockerCashkept (Frontend bug in App repo). No label changes made.Detailed Analysis
Evidence
StagingDeployCashdeploy checklist (issue Deploy Checklist: New Expensify 2026-05-08 #90006), confirming it is part of this staging release.AttachmentCameracomponent that renders inside a React Native<Modal>.Verification
src/components/AttachmentPicker/AttachmentCamera.tsx, which was created entirely by PR fix: use in-app VisionCamera for chat attachment photos #87681.AttachmentCameracomponent usesuseTheme()anduseThemeStyles()to obtain theme values, which depend onThemeContext.<Modal visible={isVisible} ...>component.ThemeProvider(insrc/components/ThemeProvider.tsx) provides theme context viaThemeContext.Provider. On iOS, React Native's<Modal>renders in a separate native window, breaking the React context chain — child components inside the modal do not receive context updates from the parent tree when the system theme changes while the modal is open.IOURequestStepScan) does not use a<Modal>— it is a proper navigation screen — which is why it does not have this problem.Root Cause
AttachmentCamerarenders its content inside a React Native<Modal>. On iOS, this modal creates a new nativeUIWindow, which hosts a separate React root. TheThemeContextprovided by the app-levelThemeProvideris not automatically bridged into this new root. As a result, when the user toggles dark/light mode from the Control Center while the camera modal is open,useColorScheme()fires in the main app tree and updatesThemeContext, but the modal's component subtree does not receive this update. The theme change only takes effect after the modal is closed and re-rendered within the main tree.MelvinBot commentedon May 11, 2026
Proposal
What is the root cause of that problem?
AttachmentCamera(AttachmentCamera.tsx:178) uses React Native's raw<Modal>directly (imported from'react-native'). On iOS, this creates a separate nativeUIWindow, which becomes the key window. When the user toggles dark/light mode from Control Center while the camera modal is open, theAppearancechange event targets this new key window — butuseColorScheme()inuseThemePreference.ts:9(consumed byThemeProvider.tsx) lives in the originalRCTRootViewwindow and does not receive the update. The theme change only takes effect after the modal is dismissed.By contrast,
IOURequestStepScan(index.native.tsx) is a regular navigation screen (no<Modal>), so no separateUIWindowis created and theme propagation works normally.What changes do you think we should make in order to solve the problem?
Replace the raw
<Modal>inAttachmentCamerawith a full-screen navigation screen approach (similar toIOURequestStepScan), or at minimum switch to the app'sBaseModalwhich already wraps children inColorSchemeWrapper(line 411).Since
BaseModalstill ultimately uses RN's Modal under the hood (sameUIWindowissue), the cleanest fix is to restructureAttachmentCameraas a navigation screen instead of a modal — this completely eliminates the separateUIWindowand ensures theme context propagates correctly.What alternative solutions did you explore? (Optional)
Wrapping Modal children in a new
ThemeProvider: This alone wouldn't fix it —ThemeProvideritself depends onuseColorScheme(), which is the broken link when a separateUIWindowis the key window.Listening to
Appearance.addChangeListenerinside the Modal: This could work as a workaround by manually subscribing to appearance changes from within the Modal's component tree, but it adds complexity and diverges from the established pattern.Supporting evidence
AttachmentCameraimports rawModalfrom'react-native'at line 2 and renders it at line 178useTheme()at line 49 — values are read at render time but the upstream signal never fires while the Modal'sUIWindowis activeThemeProviderdebounces theme changes by 300ms viauseDebouncedStateat line 16, which could add latency even when the signal does propagateNext Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.Beamanator commentedon May 11, 2026
Looks like this is working well on staging!
ScreenRecording_05-11-2026.17-06-18_1.MP4
m-natarajan commentedon May 11, 2026
Not 100% sure to say this issue not reproducible because i can see different behavior while using build v9.3.69-17.
background automatically change when we turn on/off dark mode , but the viewfinder camera have the same color theme
ScreenRecording_05-12-2026.05-52-22_1.MP4
Beamanator commentedon May 11, 2026
yeah i think that ^ is good enough to prove it's fixed!
melvin-bot commentedon May 11, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.69-18 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-05-18. 🎊
For reference, here are some details about the assignees on this issue:
[-]iOS - Camera - App theme does not change while on camera mode[/-][+][Due for payment 2026-05-18] iOS - Camera - App theme does not change while on camera mode[/+]melvin-bot commentedon May 11, 2026
@ShridharGoel The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[-][Due for payment 2026-05-18] iOS - Camera - App theme does not change while on camera mode[/-][+][Due for payment 2026-05-20] [Due for payment 2026-05-18] iOS - Camera - App theme does not change while on camera mode[/+]melvin-bot commentedon May 13, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.72-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-05-20. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 13, 2026
@ShridharGoel The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]