[$250] "You appear to be offline" message not shown in RHP chats (report/expense/transaction threads)
Problem
When offline, the You appear to be offline message is shown in regular chats above the composer, but it is not shown in chats opened in the Right-Hand Panel (RHP) — e.g. report threads, expense threads, and transaction threads.
Expected behavior
The You appear to be offline indicator should appear consistently across all chat composers, including RHP chats (report/expense/transaction threads), the same way it does in regular chats. On mobile it already shows on most screens, so behavior should be consistent.
Actual behavior
- Regular chat: offline message is shown. ✅
- Report RHP chat: offline message is missing. ❌
- Expense RHP chat: offline message is missing. ❌
Steps to reproduce
- Go offline.
- Open a regular chat → observe the
You appear to be offlinemessage above the composer. - Open a report/expense/transaction thread in the RHP → notice the message is missing.
Reported in Slack.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022069504855594848967
- Upwork Job ID: 2069504855594848967
- Last Price Increase: 2026-07-07
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)
Job added to Upwork: https://www.upwork.com/jobs/~022069504855594848967
Proposal
Please re-state the problem that we are trying to solve in this issue.
[$250] "You appear to be offline" message not shown in RHP chats (report/expense/transaction threads)
What is the root cause of that problem?
I traced this to the path that handles expense report, You appear to be offline:
- src/libs/actions/IOU/SplitTransactionUpdate.ts:39 (
SplitTransactionUpdate):isPolicyExpenseChat as isPolicyExpenseChatReportUtil, - src/libs/actions/IOU/SplitTransactionUpdate.ts:147 (
chatReport):const chatReport = allReportsList?.['${ONYXKEYS.COLLECTION.REPORT}${expenseReport?.chatReportID}']; - src/libs/actions/IOU/SplitTransactionUpdate.ts:164 (
expenseReportParentChat):const expenseReportParentChat = getReportOrDraftReport(chatReport?.parentReportID); - The local evidence matches this recurring failure shape: optimistic transaction/report data is written to one Onyx key but the visible list reads another derived key. Here,
src/libs/actions/IOU/SplitTransactionUpdate.ts:39andsrc/libs/actions/IOU/SplitTransactionUpdate.ts:147do not agree on the sameexpense report, You appear to be offlinevalue, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.
What changes do you think we should make in order to solve the problem?
- Update
src/libs/actions/IOU/SplitTransactionUpdate.ts:39to deriveexpense report, You appear to be offlinefrom the report/transaction source that owns this flow before the value is consumed. - Carry the same normalized value through
src/libs/actions/IOU/SplitTransactionUpdate.ts:147; that follows the safer family move to align optimistic/success/failure data with the selector consumed by the screen, so the write/optimistic/read paths agree instead of only changing the visible component. - Keep the change inside the Reports, Expenses, IOU, Transactions surface and avoid changing payment actions, personal/deleted policies.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
- Add or update a regression in
tests/unit/ReportUtils*.tsfor the exact issue flow: [$250] "You appear to be offline" message not shown in RHP chats (report/expense/transaction threads). - Cover the counter-case near
src/libs/actions/IOU/SplitTransactionUpdate.ts:39so valid existingexpense report, You appear to be offlinebehavior still works. - Manually repeat the issue steps after the patch and confirm the visible state/action is no longer stale.
What alternative solutions did you explore? (Optional)
- I would not add a broad new condition outside these referenced paths; the safer fix is to keep
expense report, You appear to be offlineconsistent at the first read/write boundary shown above.
Proposal
What is the root cause of that problem?
The composer's "You appear to be offline" indicator is gated on !shouldUseNarrowLayout:
https://github.com/Expensify/App/blob/0aceb729ed9f565a0cca075ba490b331110219ba/src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx#L11-L15
shouldUseNarrowLayout is true not only on small screens but also for any chat opened inside the Right-Hand Panel, because isInNarrowPaneModal is true there:
https://github.com/Expensify/App/blob/0aceb729ed9f565a0cca075ba490b331110219ba/src/hooks/useResponsiveLayout/index.ts#L57-L64
The intent of the guard is to avoid a duplicate, since on small screens ScreenWrapper already renders a sticky bottom offline indicator. But that bottom indicator is gated strictly on isSmallScreenWidth, and the wide-screen one defaults to off:
https://github.com/Expensify/App/blob/0aceb729ed9f565a0cca075ba490b331110219ba/src/components/ScreenWrapper/index.tsx#L176-L177
So in a wide-screen RHP thread: isSmallScreenWidth is false → ScreenWrapper shows nothing, while shouldUseNarrowLayout is true → ComposerDefaultFooter hides its own indicator. Nothing renders it anywhere, hence the missing message.
What changes do you think we should make in order to solve the problem?
Gate the composer indicator on !isSmallScreenWidth instead of !shouldUseNarrowLayout, so it mirrors exactly the condition under which ScreenWrapper does NOT show the sticky bottom indicator:
https://github.com/Expensify/App/blob/0aceb729ed9f565a0cca075ba490b331110219ba/src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx#L9-L19
Use isSmallScreenWidth from useResponsiveLayout (with the existing prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth lint-disable comment, as sibling files like ComposerFooter/ComposerSendButton already do). On true mobile the bottom indicator still covers it; on wide-screen RHP threads the composer now renders it; regular wide chats are unchanged.
The same !shouldUseNarrowLayout guard repeats in every non-composer branch of ReportFooter (archived, anonymous, blocked, system chat, admins-only, read-only), so those RHP footers lose the indicator on wide screens too:
https://github.com/Expensify/App/blob/0aceb729ed9f565a0cca075ba490b331110219ba/src/pages/inbox/report/ReportFooter.tsx#L120-L124
They should be switched to isSmallScreenWidth for consistency.
What alternative solutions did you explore? (Optional)
Have the report's ScreenWrapper opt into shouldShowOfflineIndicatorInWideScreen for RHP threads, letting ScreenWrapper own the indicator everywhere. This is more invasive and risks double indicators in regular wide chats, so fixing the composer guard is cleaner.
🚨 Edited by proposal-police: This proposal was edited at 2026-06-23 19:41:49 UTC.
Proposal
What is the root cause of that problem?
The composer footer hides its own offline indicator whenever shouldUseNarrowLayout is true:
https://github.com/Expensify/App/blob/eb175af86e974af511c24c484b1f873e23cce564/src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx#L9-L15
That condition is too broad because shouldUseNarrowLayout is true not only on actual small screens, but also inside RHP / narrow-pane modal routes:
https://github.com/Expensify/App/blob/eb175af86e974af511c24c484b1f873e23cce564/src/hooks/useResponsiveLayout/index.ts#L58-L65
Regular small-screen chats can rely on the page-level ScreenWrapper offline indicator, but wide-screen RHP chats cannot. ScreenWrapper only shows the default page-level indicator on small screens unless wide-screen display is explicitly enabled:
https://github.com/Expensify/App/blob/eb175af86e974af511c24c484b1f873e23cce564/src/components/ScreenWrapper/index.tsx#L174-L177
So in RHP report, expense, and transaction-thread chats on wide screens, both possible indicator paths are disabled: the composer footer hides its indicator because RHP makes shouldUseNarrowLayout true, and the surrounding ScreenWrapper does not render the wide-screen offline indicator.
The same shouldUseNarrowLayout condition is also used in the related non-composer ReportFooter branches, such as archived, anonymous, blocked, system, admins-only, and read-only footers. Those branches should follow the same visibility rule so the offline indicator behavior stays consistent across all report footer states.
What changes do you think we should make in order to solve the problem?
Use isSmallScreenWidth for the offline-indicator visibility decision in both ComposerDefaultFooter and the related non-composer ReportFooter branches instead of using shouldUseNarrowLayout.
The composer/report footer should hide its inline offline indicator only on actual small screens, where the page-level mobile offline indicator already handles the message. It should still render the inline indicator in wide-screen RHP chats, because RHP is a narrow-pane layout but not a small-screen layout.
This also addresses the duplicate-indicator concern raised during review. On actual small screens, isSmallScreenWidth remains true, so the footer-level indicator stays hidden and the existing mobile behavior is preserved. On wide-screen RHP chats, isSmallScreenWidth is false, so the footer-level indicator is shown where the user is actively composing or viewing the report footer. Based on the latest clarification, the expected behavior is to show the offline indicator for all wide-screen RHP chats, including report, expense, and transaction-thread chats.
Required change:
- In
src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx, destructureisSmallScreenWidthfromuseResponsiveLayout(). - Render
<OfflineIndicator />when!isSmallScreenWidth. - Keep the existing
containerStyles={[styles.chatItemComposeSecondaryRow]}so the visual spacing matches the current wide composer footer. - Add the existing lint-disable comment used elsewhere when intentionally reading
isSmallScreenWidth. - In
src/pages/inbox/report/ReportFooter.tsx, destructureisSmallScreenWidthfromuseResponsiveLayout()together withshouldUseNarrowLayout. - Replace the non-composer footer offline indicator checks from
!shouldUseNarrowLayoutto!isSmallScreenWidthfor archived, anonymous, blocked, system, admins-only, and read-only footer branches. - Keep using
shouldUseNarrowLayoutfor layout-only spacing such asstyles.mb5, because that still depends on the narrow-pane layout.
Tests that should be added:
-
Add or update a
ReportActionComposeUI test that mocks offline network state anduseResponsiveLayout()as{shouldUseNarrowLayout: true, isSmallScreenWidth: false, isInNarrowPaneModal: true}and asserts thatcommon.youAppearToBeOfflinerenders. -
Add a counter-case for actual small-screen layout
{shouldUseNarrowLayout: true, isSmallScreenWidth: true}and assert the composer footer does not render its own inline offline indicator, preventing duplicate mobile indicators. -
Add coverage for a non-composer
ReportFooterstate, such as archived or read-only, and assert that the offline indicator renders when{shouldUseNarrowLayout: true, isSmallScreenWidth: false}but not when{shouldUseNarrowLayout: true, isSmallScreenWidth: true}.
The existing proposal points to src/libs/actions/IOU/SplitTransactionUpdate.ts, but this issue is not caused by optimistic IOU data or transaction/report write paths. The missing UI comes from the composer footer render condition, so changing IOU action logic would not fix the root cause.
I also considered adding route-specific Wide/Super-Wide RHP logic or enabling the wide-screen ScreenWrapper offline indicator on the RHP report pages, but the latest clarification supports showing the offline indicator for all wide-screen RHP chats. Applying the same isSmallScreenWidth condition in the shared composer and ReportFooter paths keeps the behavior consistent without adding route-specific checks.
What alternative solutions did you explore? (Optional)
Fixed Demo:
https://github.com/user-attachments/assets/322b9480-399b-4813-9f84-3fbe3b1fe424
⚠️ @nabi-ebrahimi Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When offline, the "You appear to be offline." message is shown above the composer in regular chats, but it is missing in chats opened in the Right-Hand Panel (RHP) — report threads, expense threads, and transaction threads.
What is the root cause of that problem?
The offline message above the composer is rendered by ComposerDefaultFooter, and it is gated on !shouldUseNarrowLayout:
https://github.com/Expensify/App/blob/d68fa6034c5ce0d8e93451b8867d791056b75fb6/src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx#L13-L18
The intent of that guard is "only render the composer's offline indicator on a wide screen, because on a small (mobile) screen the indicator is already rendered at the bottom of the screen by ScreenWrapper." However, shouldUseNarrowLayout is true not only on small screens but also whenever the component is inside a narrow-pane modal — i.e. any RHP chat — even on a wide screen. That is by design in useResponsiveLayout, where shouldUseNarrowLayout = isSmallScreenWidth || isInNarrowPaneModal:
https://github.com/Expensify/App/blob/d68fa6034c5ce0d8e93451b8867d791056b75fb6/src/hooks/useResponsiveLayout/index.ts#L56-L64
So in an RHP thread on a wide screen, shouldUseNarrowLayout is true, and the composer's offline indicator is hidden. At the same time, ScreenWrapper only renders its own small-screen offline indicator when isSmallScreenWidth is true (and its wide-screen variant defaults to off):
https://github.com/Expensify/App/blob/d68fa6034c5ce0d8e93451b8867d791056b75fb6/src/components/ScreenWrapper/index.tsx#L176-L177
On a wide screen isSmallScreenWidth is false, so ScreenWrapper shows nothing either. The result is that neither the composer nor the screen wrapper shows the offline message in a wide-screen RHP chat — the indicator goes missing. The guard conflates "on mobile" with "in the RHP", but only the "on mobile" case is the one where the bottom ScreenWrapper indicator already covers it.
What changes do you think we should make in order to solve the problem?
In ComposerDefaultFooter, change the guard for the composer's offline indicator from !shouldUseNarrowLayout to !isSmallScreenWidth (read isSmallScreenWidth from useResponsiveLayout instead of, or in addition to, shouldUseNarrowLayout).
With this change:
- Wide-screen regular chat:
isSmallScreenWidthisfalse→ indicator shown (unchanged). - Wide-screen RHP chat (report/expense/transaction thread):
isSmallScreenWidthisfalse→ indicator now shown (the bug is fixed). - Mobile / small screen:
isSmallScreenWidthistrue→ composer indicator hidden, exactly as today, because the bottomScreenWrapperoffline indicator already renders it there (so we avoid a duplicate indicator).
Because the repo has an ESLint rule preferring shouldUseNarrowLayout over isSmallScreenWidth, this intentional use of isSmallScreenWidth should carry the same // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth comment that ScreenWrapper already uses for the very same reason (showing the offline indicator based on real screen width, not modal context).
Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/94359-rhp-composer-offline-indicator?expand=1
What alternative solutions did you explore? (Optional)
An alternative is to leave ComposerDefaultFooter as-is and instead enable the wide-screen offline indicator on the RHP's ScreenWrapper (passing shouldShowOfflineIndicatorInWideScreen). This was rejected because it would place the indicator at the bottom of the RHP screen rather than directly above the composer (inconsistent with regular chats, where it sits above the composer), and it would require threading the prop through the report screen wrapper for RHP contexts only. Fixing the guard in the composer footer keeps the indicator in the same place across all chats with a single, localized change.
Proposal
What is the root cause of that problem?
The composer's offline message is rendered by ComposerDefaultFooter, and it is gated on !shouldUseNarrowLayout:
https://github.com/Expensify/App/blob/be8591c9249/src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx#L11-L15
const {shouldUseNarrowLayout} = useResponsiveLayout();
...
{!shouldUseNarrowLayout && <OfflineIndicator containerStyles={[styles.chatItemComposeSecondaryRow]} />}
The problem is what shouldUseNarrowLayout means. In useResponsiveLayout it is true for both small screens and for any component rendered inside the RHP:
https://github.com/Expensify/App/blob/be8591c9249/src/hooks/useResponsiveLayout/index.ts#L57-L64
const isInNarrowPaneModal = activeModalType === CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED || (isDisplayedInNarrowModalNavigator && !activeModalType);
const shouldUseNarrowLayout = isSmallScreenWidth || isInNarrowPaneModal;
A report/expense/transaction thread opened in the RHP renders the same ReportScreen → ReportFooter → ReportActionCompose → ComposerDefaultFooter, but inside the RIGHT_MODAL_NAVIGATOR, so isInNarrowPaneModal === true and therefore shouldUseNarrowLayout === true even on a wide screen. !shouldUseNarrowLayout is then false and the OfflineIndicator is never mounted in the RHP composer.
Why the regular (central‑pane) chat works and the RHP one doesn't: on a wide screen the central pane is not in a modal, so isInNarrowPaneModal === false → shouldUseNarrowLayout === false → the composer indicator shows. On true mobile (isSmallScreenWidth === true) the composer indicator is intentionally hidden because ScreenWrapper renders a global small‑screen offline indicator instead — that one is gated on isSmallScreenWidth, not shouldUseNarrowLayout:
https://github.com/Expensify/App/blob/be8591c9249/src/components/ScreenWrapper/index.tsx#L176-L177
const displaySmallScreenOfflineIndicator = isSmallScreenWidth && (...);
const displayWideScreenOfflineIndicator = !isSmallScreenWidth && (... ?? false); // false for ReportScreen
ReportScreen passes no offline‑indicator props, so on a wide screen both ScreenWrapper indicators are off and the only source of the composer offline message is ComposerDefaultFooter. In the RHP that source is suppressed by the shouldUseNarrowLayout gate, and no global one replaces it → the message is missing.
So: RHP composer → isInNarrowPaneModal true → shouldUseNarrowLayout true on wide screen → !shouldUseNarrowLayout false → OfflineIndicator not mounted, and ScreenWrapper's small‑screen indicator is isSmallScreenWidth‑gated (false on wide) → no offline message anywhere → symptom.
Sibling flows with the identical root cause: the non‑composer footers in ReportFooter (archived / anonymous / blocked / system‑chat / admins‑only / read‑only) use the exact same !shouldUseNarrowLayout gate, so an archived/blocked report opened in the RHP on a wide screen is also missing the indicator — e.g. https://github.com/Expensify/App/blob/be8591c9249/src/pages/inbox/report/ReportFooter.tsx#L120-L122 (repeated at L134-L136, L148-L150, L162-L164, L190-L192, L214-L216). Not affected: central‑pane chats (already wide, indicator shows) and any true mobile screen (the ScreenWrapper small‑screen indicator covers them).
What changes do you think we should make in order to solve the problem?
Gate the composer offline indicator on isSmallScreenWidth instead of shouldUseNarrowLayout. That keeps the indicator hidden only on true mobile (where ScreenWrapper shows the global one) and shows it on every wide layout — central pane and RHP. useResponsiveLayout already returns isSmallScreenWidth, and this is exactly the same distinction ScreenWrapper already relies on at L176‑L177 above. The repo already sanctions this with the eslint-disable used in ScreenWrapper/index.tsx#L121-L123.
1. src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx — https://github.com/Expensify/App/blob/be8591c9249/src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx#L11-L15
- const {shouldUseNarrowLayout} = useResponsiveLayout();
+ // Use isSmallScreenWidth (not shouldUseNarrowLayout) so the indicator still renders in the RHP on wide screens,
+ // where ScreenWrapper's small-screen offline indicator is not shown (it is gated on isSmallScreenWidth).
+ // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
+ const {isSmallScreenWidth} = useResponsiveLayout();
...
- {!shouldUseNarrowLayout && <OfflineIndicator containerStyles={[styles.chatItemComposeSecondaryRow]} />}
+ {!isSmallScreenWidth && <OfflineIndicator containerStyles={[styles.chatItemComposeSecondaryRow]} />}
2. (Consistency) src/pages/inbox/report/ReportFooter.tsx — apply the same !shouldUseNarrowLayout → !isSmallScreenWidth change to the 6 non‑composer footer branches (L120-L122, L134-L136, L148-L150, L162-L164, L190-L192, L214-L216) so archived/blocked/system/admins‑only/read‑only threads in the RHP are consistent too. useResponsiveLayout is already called here (it destructures shouldUseNarrowLayout at https://github.com/Expensify/App/blob/be8591c9249/src/pages/inbox/report/ReportFooter.tsx#L56) — just also pull isSmallScreenWidth (with the same eslint‑disable) and swap the gate.
Verify:
- Wide screen, regular chat, offline → message shows (unchanged). ✅
- Wide screen, report/expense/transaction thread in RHP, offline → message now shows. ✅
- Mobile (small screen), any chat, offline → composer indicator stays hidden,
ScreenWrapper's global small‑screen indicator shows (no duplicate). ✅
What alternative solutions did you explore? (Optional)
Enable the ScreenWrapper wide‑screen indicator for ReportScreen by passing shouldShowOfflineIndicatorInWideScreen (drives displayWideScreenOfflineIndicator at https://github.com/Expensify/App/blob/be8591c9249/src/components/ScreenWrapper/index.tsx#L177). Rejected: it would render a second indicator in the central pane (the composer footer already shows one there), and it places the message at the screen bottom rather than directly above the composer where the existing design puts it.
Add isInNarrowPaneModal to the gate (!shouldUseNarrowLayout || isInNarrowPaneModal). This works functionally but is a double negative that re‑expands to "show unless small screen", i.e. exactly !isSmallScreenWidth — the direct form is clearer and matches how ScreenWrapper already decides small‑ vs wide‑screen indicators.
⚠️ @yusufdeveloper2903 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
⚠️ @abbasifaizan70 Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Proposal
What is the root cause of that problem?
The writable chat footer goes through ReportActionCompose.DefaultFooter, and that footer only renders the inline OfflineIndicator when !shouldUseNarrowLayout.
shouldUseNarrowLayout does not only mean "small screen". It is also true when the composer is rendered inside the RHP/narrow pane modal. So on desktop RHP chats, including report, expense, and transaction-thread chats, the composer is treated as narrow and hides the inline offline message. At the same time, the screen-level mobile offline indicator is not shown because the actual screen width is still wide. Regular desktop chats are not inside the RHP, so they keep showing the inline You appear to be offline row above the composer.
What changes do you think we should make in order to solve the problem?
In ComposerDefaultFooter, use the actual screen width from useResponsiveLayout for this offline-indicator decision.
Specifically, render the composer footer OfflineIndicator when !isSmallScreenWidth instead of when !shouldUseNarrowLayout. Keep it hidden only on real small-screen/mobile layouts, where ScreenWrapper already owns the bottom offline indicator and we do not want duplicate messages.
This keeps the current regular desktop and mobile behavior, while making desktop RHP report chats, expense report chats, and transaction-thread chats show the same inline offline row as regular desktop chats. ComposerFooter already uses isSmallScreenWidth for its row spacing, so the layout wrapper is already aligned with this behavior.
I would verify:
- regular desktop report chat while offline
- report thread opened in the RHP while offline
- expense report and transaction-thread RHP chats while offline
- small-screen/mobile report chat while offline, to confirm the existing bottom indicator remains and the composer row is not duplicated
What alternative solutions did you explore? (Optional)
I considered enabling the wide-screen ScreenWrapper offline indicator for RHP report screens, but that would move the message to the screen level and affect broader RHP pages instead of fixing the composer footer behavior. I also considered changing shouldUseNarrowLayout, but that hook is intentionally true for both small screens and RHP/narrow panes, so the safer fix is to use isSmallScreenWidth only at the composer footer decision that actually depends on real screen width.
⚠️ @KJ21-ENG Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Updated my proposal: refreshed the existing proposal with the latest correct root cause and fix scope.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-03 06:37:37 UTC.
Proposal
What is the root cause of that problem?
The report footer hides the offline indicator using shouldUseNarrowLayout.
In ComposerDefaultFooter, the inline offline indicator is only mounted when shouldUseNarrowLayout is false.
https://github.com/Expensify/App/blob/086f3e3a3b1360d018bbc42368bbf5633351a9b3/src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx#L14-L18
That condition is too broad for this UI decision. shouldUseNarrowLayout means "small screen or inside RHP", not only "actual small screen".
https://github.com/Expensify/App/blob/086f3e3a3b1360d018bbc42368bbf5633351a9b3/src/hooks/useResponsiveLayout/index.ts#L61-L69
So on a desktop RHP report, expense, or transaction thread:
isSmallScreenWidthisfalseisInNarrowPaneModalistrueshouldUseNarrowLayoutistrue
Because ComposerDefaultFooter checks !shouldUseNarrowLayout, it treats desktop RHP the same as mobile and does not mount the inline <OfflineIndicator />.
The screen-level fallback does not replace it. ScreenWrapper only shows the default mobile indicator when isSmallScreenWidth is true, and the wide-screen indicator defaults to false unless a screen explicitly opts in.
https://github.com/Expensify/App/blob/086f3e3a3b1360d018bbc42368bbf5633351a9b3/src/components/ScreenWrapper/index.tsx#L182-L185
This leaves desktop RHP chats without the "You appear to be offline" message. The app hides the report footer indicator because the route is in an RHP, but the mobile ScreenWrapper indicator is not shown because the actual screen is not small.
The same incorrect !shouldUseNarrowLayout condition is repeated in ReportFooter for non-composer footer states, so archived, anonymous, blocked, system, admins-only, and read-only RHP footers can hide the offline indicator for the same reason.
https://github.com/Expensify/App/blob/086f3e3a3b1360d018bbc42368bbf5633351a9b3/src/pages/inbox/report/ReportFooter.tsx#L62-L126
What changes do you think we should make in order to solve the problem?
Centralize the report footer offline indicator in a small shared component, and let that component decide visibility from actual screen width.
The visibility rule should be:
!isSmallScreenWidth
This matches the latest review/design clarification: the offline indicator should be shown for RHP chats, and design is fine with the possible duplicate-background-indicator case. It also keeps mobile behavior unchanged because the footer-level indicator remains hidden on actual small screens where the mobile ScreenWrapper indicator owns the message.
Add a shared component under the report footer folder:
// src/pages/inbox/report/ReportFooterOfflineIndicator.tsx
import OfflineIndicator from '@components/OfflineIndicator';
import {View} from 'react-native';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
type ReportFooterOfflineIndicatorProps = {
shouldWrapWithContainer?: boolean;
};
function ReportFooterOfflineIndicator({shouldWrapWithContainer = false}: ReportFooterOfflineIndicatorProps) {
const styles = useThemeStyles();
const {isSmallScreenWidth} = useResponsiveLayout();
if (isSmallScreenWidth) {
return null;
}
const indicator = <OfflineIndicator containerStyles={[styles.chatItemComposeSecondaryRow]} />;
if (!shouldWrapWithContainer) {
return indicator;
}
return <View style={styles.offlineIndicatorContainer}>{indicator}</View>;
}
This avoids repeating the same visibility condition in ComposerDefaultFooter and every non-composer ReportFooter branch.
In ComposerDefaultFooter, replace the current inline condition with the shared component.
https://github.com/Expensify/App/blob/086f3e3a3b1360d018bbc42368bbf5633351a9b3/src/pages/inbox/report/ReportActionCompose/ComposerDefaultFooter.tsx#L1-L18
-import OfflineIndicator from '@components/OfflineIndicator';
-
-import useResponsiveLayout from '@hooks/useResponsiveLayout';
-import useThemeStyles from '@hooks/useThemeStyles';
+import ReportFooterOfflineIndicator from '../ReportFooterOfflineIndicator';
@@
function ComposerDefaultFooter() {
- const styles = useThemeStyles();
- const {shouldUseNarrowLayout} = useResponsiveLayout();
return (
<ComposerFooter>
- {!shouldUseNarrowLayout && <OfflineIndicator containerStyles={[styles.chatItemComposeSecondaryRow]} />}
+ <ReportFooterOfflineIndicator />
In ReportFooter, keep shouldUseNarrowLayout for footer spacing/layout, but replace each repeated offline indicator block with the shared component.
https://github.com/Expensify/App/blob/086f3e3a3b1360d018bbc42368bbf5633351a9b3/src/pages/inbox/report/ReportFooter.tsx#L62-L126
-import OfflineIndicator from '@components/OfflineIndicator';
import SwipeableView from '@components/SwipeableView';
@@
+import ReportFooterOfflineIndicator from './ReportFooterOfflineIndicator';
@@
- {!shouldUseNarrowLayout && (
- <View style={styles.offlineIndicatorContainer}>
- <OfflineIndicator containerStyles={[styles.chatItemComposeSecondaryRow]} />
- </View>
- )}
+ <ReportFooterOfflineIndicator shouldWrapWithContainer />
Apply the same replacement to every non-composer <OfflineIndicator /> branch in ReportFooter.
This keeps layout behavior unchanged, shows the indicator in all desktop RHP chats, preserves mobile behavior, and removes repeated visibility logic from the report footer code path.
What alternative solutions did you explore? (Optional)
I considered directly replacing each !shouldUseNarrowLayout with !isSmallScreenWidth. That matches the latest expected behavior, but it repeats the same visibility rule in ComposerDefaultFooter and every non-composer ReportFooter branch. A shared component is cleaner and keeps the rule in one place.
I considered hiding the background report footer indicator while an RHP is on top to avoid duplicate desktop indicators. I rejected that after the latest design feedback because design reviewed the duplicate case and still said showing the indicator is fine.
I considered using useResponsiveLayoutOnWideRHP() so the indicator would show only for Wide/Super-Wide RHP. That avoids some duplicate cases, but it does not match the latest clarification that RHP chats generally should show the offline indicator.
I considered manually reading wideRHPRouteKeys and superWideRHPRouteKeys in ReportFooter and passing a new prop down to ReportActionCompose and ComposerDefaultFooter. That adds more code and solves only selected RHP cases instead of the clarified all-desktop-RHP behavior.
I rejected enabling shouldShowOfflineIndicatorInWideScreen on the RHP ScreenWrapper because it would move the message to the screen-level indicator instead of the composer/footer location used by report chats, and it would not address the repeated footer-level conditions in ReportFooter.
⚠️ @emkhalid Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Proposal
What is the root cause of that problem?
When submitting a distance expense from Self DM while offline, the client optimistically moves the transaction into the workspace but does not reliably persist the selected workspace distance rate unit/id into the transaction's Onyx record used for display. The display helper treats a missing rate as "pending" (blank) unless it is explicitly told the transaction is offline. Concretely:
- The optimistic move path in src/libs/actions/Transaction.ts sometimes updates
comment.customUnit.customUnitRateIDwhen it auto-selects a default rate, but not in all offline submit paths for Self DM → workspace move. When the optimistic record lackscustomUnitRateIDand/ordistanceUnitthe UI's distance rate field is empty. DistanceRequestUtils.getFormattedRateValue(...)andgetRateForExpenseDisplay(...)returntranslate('iou.fieldPending')when unit/rate/currency are missing. They only return the fallback label (iou.defaultRate) whenisOfflineis set to true. See src/libs/DistanceRequestUtils.ts wheregetFormattedRateValueacceptsisOffline?: booleanand hasif (isOffline && !rate) { return translate('iou.defaultRate'); }.
Files implicated:
- Rate formatting/display helpers: src/libs/DistanceRequestUtils.ts
function getFormattedRateValue(..., isOffline?: boolean) {
if (isOffline && !rate) {
return translate('iou.defaultRate');
}
if (!rate || !currency || !unit) {
return translate('iou.fieldPending');
}
// ... format normally
}
- Optimistic move / submit behavior: src/libs/actions/Transaction.ts
// inside changeTransactionsReport in src/libs/actions/Transaction.ts
if (!currentRateID || !currentRate || currentRate.enabled === false) {
const defaultRate = DistanceRequestUtils.getDefaultMileageRate(policy);
if (defaultRate?.customUnitRateID) {
// existing code builds updatedTransaction with comment.customUnit.customUnitRateID = defaultRate.customUnitRateID
// then pushes optimistic MERGE updates to Onyx for the transaction
}
}
- Policy helpers for selecting default rate: src/libs/PolicyUtils.ts
Why this produces a blank Rate field
- When submitting offline from Self DM, the optimistic Onyx update that ends up being shown in the transaction thread sometimes lacks the
customUnitfields (either not merged or only present in a temporary/failed optimistic value). The UI rendering code calls the DistanceRequestUtils display helpers withoutisOffline=truefor that pending transaction entry and the helper returns the "pending" label (blank/placeholder) instead of showing the selected rate.
What changes do you think we should make in order to solve the problem?
Two focused fixes:
- Persist selected rate and unit into Onyx for offline optimistic submit paths
-
Ensure any optimistic Onyx MERGE/SET created when moving a transaction from Self DM into a workspace (including offline submit paths) contains the chosen
comment.customUnitobject with at least:customUnitRateID(the workspace rate id)distanceUnit(the workspace unit, e.g. "mi"/"km")quantity(the numeric value as applicable)
-
Where to change: the optimistic data built in src/libs/actions/Transaction.ts (function
changeTransactionsReport) — when you prepare theoptimisticValue/updatedTransaction.commentpush, include the fullcustomUnitblock so Onyx always contains the selected rate/unit for display.
Suggested example (pseudo-code snippet to add where optimistic MERGE is created):
// Build optimistic transaction merge (ensure customUnit is present)
const optimisticValue: Partial<Transaction> = {
comment: {
...updatedTransaction.comment,
customUnit: {
...(updatedTransaction.comment?.customUnit ?? {}),
customUnitRateID: defaultRate.customUnitRateID,
distanceUnit: updatedDistanceUnit, // e.g. 'mi' or 'km'
quantity: updatedTransaction.comment?.customUnit?.quantity ?? null,
},
},
};
// Push optimistic MERGE (Onyx/Merge or API optimisticData)
optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transaction.transactionID}`, value: optimisticValue });
- Also ensure any code path that creates a draft/offline transaction (e.g. draft submit, transaction create) sets
transaction.comment.customUniton the draft key (TRANSACTION_DRAFT/TRANSACTION_BACKUP) so the UI pulls the data from the same shape whether online or offline.
- Pass
isOfflineinto the rate display helper for pending/offline transactions
-
When rendering the Rate field for a transaction that is pending/offline (transaction.pendingAction, transaction.pendingFields, or when displayed from the draft/backup collection), call
DistanceRequestUtils.getRateForExpenseDisplay(..., isOffline = true)so that when rate is missing due to server-side absence we show the default offline-friendly label instead of blank. -
Where to change: UI components that render the rate field for transactions (examples: expense view / report action renderers — find call-sites that invoke
getRateForExpenseDisplayor code paths that build the displayed rate). Ensure the boolean is derived by checkingtransaction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADDor usinggetIsOffline()helper where appropriate.
Example call-site change (pseudo-code):
const isOfflineTransaction = transaction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD || getIsOffline();
const rateLabel = DistanceRequestUtils.getRateForExpenseDisplay(rateName, isCustomUnitOutOfPolicy, unit, rate, currency, translate, toLocaleDigit, getCurrencySymbol, isOfflineTransaction);
Why both changes?
- Persisting the chosen
customUnitfixes the root cause and ensures the real rate shows once the optimistic data is present. - Passing
isOfflineprotects UIs that render the pending transaction before the persistence has finished, so users see a meaningful offline fallback (iou.defaultRate) instead of an empty field. Together they make the UX consistent and robust during offline Self DM submit.
What alternative solutions did you explore? (Optional)
- Force the display component to always prefer
defaultRatefor any pending transactions (single-sided UI change). Rejected because it hides real rates when they are available in optimistic data and loses fidelity for P2P vs workspace expense types. - Fully revert to blocking submit while offline. Rejected for UX reasons - feature should support offline submit.
Tests
- Unit test for
changeTransactionsReport: when moving a transaction to a workspace in offline mode, the optimistic Onyx MERGE includescomment.customUnit.customUnitRateIDandcomment.customUnit.distanceUnit. - Unit test for rate display: when
getRateForExpenseDisplayis called for a pending transaction withisOffline=trueand no rate present, it returns theiou.defaultRatetranslation; withisOffline=falseit returnsiou.fieldPending. - Integration / E2E test (manual or Playwright): replicate the user's reproduction steps in the issue: create workspace with KMs, create distance expense in Self DM, go offline, submit to workspace, open expense - assert Rate field shows selected/default rate.
Proposal updated — added compare branch with implementation.
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
⚠️ @aswin-s Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.