[$175] Concierge - “Export my last report to PDF” is displayed for a new user who has no expenses or reports
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.33-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @dylanexpensify Slack conversation (hyperlinked to channel name): #expensify_bugs
Action Performed:
- User signs up with public email
- Adds work email
- Selects Track expenses for business
- Enters personal details
- Completes onboarding and is dropped on Home page
- Clicks on Concierge
Expected Result:
Suggested input is something the user can actually do
Actual Result:
Input suggests something the user can’t do
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [x] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [ ] Windows: Chrome
- [ ] MacOS: Chrome / Safari
Screenshots/Videos
https://github.com/user-attachments/assets/67770ae9-3c03-4593-ae88-3cc1f0a766e3
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022119113137106152581
- Upwork Job ID: 2119113137106152581
- Last Price Increase: 2026-11-07
Issue Owner
Current Issue Owner: @ahmedGaber93
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mkhutornyi (External)
Job added to Upwork: https://www.upwork.com/jobs/~022119113137106152581
🤖 Web test steps verification results: ⚠️ partial
The web account had no expenses or reports, but Concierge displayed a different suggestion. Code inspection confirms that the PDF prompt can be selected without checking report availability; the exact reported onboarding flow was not reproduced.
| Step | Status |
|---|---|
1. Sign up using a public emailThe provided session was authenticated with a Gmail account. Sign-up was not independently observed or repeated. |
✅ |
2. Add a work emailNot established: session setup skipped this step. |
⚠️ |
3. Select Track expenses for businessNot established: session setup selected “Something else.” |
⚠️ |
4. Enter personal detailsSession setup entered generic details; this step was not independently observed. |
⚠️ |
5. Complete onboarding and land on HomeThe initial live screen showed authenticated Home. |
✅ |
6. Open ConciergeOpened the main Concierge conversation. Its empty composer displayed “What drove my spend last quarter?”![]() |
✅ |
Verify no expenses or expense reports existExpenses showed “No expenses yet”; Reports showed “No reports yet,” without search queries.![]() |
✅ |
Verify the PDF prompt appearsThe exact prompt did not appear in this session. Selection happens once per composer mount, so one different suggestion does not disprove the issue. |
⚠️ |
Inspect suggestion selection — structured proposalProposalWhat is the root cause of that problem?Medium confidence: ComposerInput.tsx:36–105 randomly selects from 15 unconditional placeholder keys, including the PDF prompt. The Concierge branch renders that selection without checking expense reports. The Concierge check only identifies the main conversation and excludes the side panel. This is placeholder text—not an export action or a server-generated suggestion.What changes do you think we should make in order to solve the problem?Filter candidate placeholders by their prerequisites. Exclude the PDF prompt when no eligible report is available; use a safe fallback while eligibility is unknown. Revalidate the selected placeholder when report data changes, rather than checking only at mount. Review other history-dependent prompts too—the spending-analysis prompt observed here has the same new-user mismatch.Regression coverage: Force the PDF selection deterministically; test chat-only accounts, eligible reports, delayed report loading, and report removal. What alternative solutions did you explore?Gating by email domain or onboarding intent would not establish report availability. Permanently removing the PDF prompt would also hide it from users who can use it. Production logs are unnecessary to establish this client-side selection defect; exact runtime reproduction remains unconfirmed. |
✅ |
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/106297) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Proposal
What is the root cause of that problem?
In src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx, the Concierge DM placeholder is picked once per mount at line 90 (useState(() => ASK_CONCIERGE_PLACEHOLDER_KEYS[Math.floor(Math.random() * ...length)])) from the static list at lines 36-52. That list contains history-dependent prompts, including common.concierge.composerPlaceholders.exportPdf (line 49), exportCsv, awaitingApproval and unsubmitted. The isConciergeInboxDM branch then renders the pick with no check that the user has any report or expense. A brand-new user can therefore be shown "Export my last report to PDF" when there is nothing to export.
What changes do you think we should make in order to solve the problem?
Filter the candidate keys by the user's data before picking one. Add a small helper in ComposerInput.tsx that returns the keys for the current state. When the user has no expense report, it drops the report-dependent keys (exportPdf, exportCsv, awaitingApproval, notReimbursed, unsubmitted, leftToPay, combineExpenses). Use a cheap check such as an ONYXKEYS.COLLECTION.REPORT selector that looks for any isMoneyRequestReport. Keep the generic prompts (askConciergeForHelp, createExpense) as the fallback, so the list is never empty.
Because useState fixes the pick on first render and Onyx may still be loading, compute the pick with useMemo keyed on hasExpenseReports. Keep the random index in a useRef so the placeholder does not flicker on every Onyx update.
Test: a unit test for the helper, with Math.random mocked to select exportPdf. With no expense reports the result must not contain exportPdf. With one expense report it must still be allowed.
What alternative solutions did you explore? (Optional)
MelvinBot's proposal (the only one in the thread) reaches the same root cause. It suggests filtering by prerequisites, and it also proposes revalidating when data changes. Mine differs in two ways. It names a concrete rule (no expense report removes the report-dependent keys) and a stable way to avoid flicker (the ref). It also adds the test that drives the random pick. Gating by email domain or onboarding intent would not reflect whether reports exist. Removing the PDF prompt outright would hide it from users who can use it.
@mkhutornyi — I'd like to be considered for this $175 external implementation, subject to proposal approval and the normal Upwork onboarding/contract requirements.
Problem: On v9.5.33-1, the Concierge composer can suggest “Export my last report to PDF” immediately after onboarding even though the account has no expenses or reports. The automated web check verified an empty account but displayed a different random suggestion; the exact reported prompt was not independently reproduced.
Bounded source finding (static only): In ComposerInput.tsx at pinned historical SHA a2011ae1473e25050a31c86a334998529f1f0ed6, ASK_CONCIERGE_PLACEHOLDER_KEYS includes exportPdf/exportCsv, and useState selects a key once at mount without checking whether an exportable report exists. The Concierge branch then translates that key. This supports a missing eligibility gate as a hypothesis for the reported mismatch, not a runtime-proven cause; whether a report is exportable rather than merely present needs verification.
Proposed scope after approval: verify the current source head and the report-eligibility contract; filter only action-dependent suggestion keys, retain safe generic fallbacks while report data is unknown, and avoid a stale selected key when eligibility changes. A discriminating regression would force the random PDF candidate for (a) no reports, (b) a qualifying report, and (c) delayed report data, plus check removal/no-placeholder flicker. No tests or app reproduction have been run by me. Estimated focused implementation plus tests: 1–2 working days after approval and a usable test setup.
One scope question: should the no-report Concierge state exclude every report-dependent suggestion, or only export-PDF/CSV until each prompt's prerequisites are defined?
I use AI assistance for source analysis and drafting; any code and test results would be reviewed and reported separately. I will not start a paid implementation or claim an assignment before approval.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a new user completes onboarding (with zero expenses and zero expense reports) and opens the main Concierge Inbox DM, the message composer placeholder can display history-dependent prompts such as "Export my last report to PDF" (or "What drove my spend last quarter?", "Give me a CSV of my expenses over $50", etc.), suggesting actions on reports or expenses that do not exist yet.
What is the root cause of that problem?
In src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx:36-52, ASK_CONCIERGE_PLACEHOLDER_KEYS defines 15 static translation keys:
const ASK_CONCIERGE_PLACEHOLDER_KEYS = [
'common.concierge.composerPlaceholders.spendLastMonth',
'common.concierge.composerPlaceholders.topExpenses',
'common.concierge.composerPlaceholders.spendDrivers',
'common.concierge.composerPlaceholders.travelSpendChange',
'common.concierge.composerPlaceholders.topSpender',
'common.concierge.composerPlaceholders.missingCategory',
'common.concierge.composerPlaceholders.awaitingApproval',
'common.concierge.composerPlaceholders.notReimbursed',
'common.concierge.composerPlaceholders.unsubmitted',
'common.concierge.composerPlaceholders.leftToPay',
'common.concierge.composerPlaceholders.createExpense',
'common.concierge.composerPlaceholders.combineExpenses',
'common.concierge.composerPlaceholders.exportPdf',
'common.concierge.composerPlaceholders.exportCsv',
'reportActionCompose.askConciergeForHelp',
] as const;
At line 90, ComposerInput unconditionally selects one key on initial mount:
const [askConciergePlaceholderKey] = useState(() => ASK_CONCIERGE_PLACEHOLDER_KEYS[Math.floor(Math.random() * ASK_CONCIERGE_PLACEHOLDER_KEYS.length)]);
And at lines 101-102, when isConciergeInboxDM is true, it renders translate(askConciergePlaceholderKey).
13 of the 15 keys in ASK_CONCIERGE_PLACEHOLDER_KEYS presuppose that the user already has existing expenses or expense reports (exportPdf, exportCsv, spendLastMonth, topExpenses, spendDrivers, travelSpendChange, topSpender, missingCategory, awaitingApproval, notReimbursed, unsubmitted, leftToPay, combineExpenses), whereas only 2 keys ('common.concierge.composerPlaceholders.createExpense' and 'reportActionCompose.askConciergeForHelp') are valid for a brand-new user with no expenses or expense reports. Because ComposerInput never checks whether the user has any money-request reports or transactions before choosing the placeholder (and locks the choice on first mount via useState before Onyx data may have finished hydrating), a new user with no expenses/reports is shown prompts for actions they cannot perform.
What changes do you think we should make in order to solve the problem?
- Split Concierge placeholder keys into always-valid vs. expense/report-dependent sets in
src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx:- Define
BASE_CONCIERGE_PLACEHOLDER_KEYScontaining prompts that any user (including a brand-new user with 0 expenses/reports) can act on:const BASE_CONCIERGE_PLACEHOLDER_KEYS = [ 'common.concierge.composerPlaceholders.createExpense', 'reportActionCompose.askConciergeForHelp', ] as const; - Define
EXPENSE_DEPENDENT_CONCIERGE_PLACEHOLDER_KEYScontaining the remaining 13 prompts that require existing expenses/reports (spendLastMonth,topExpenses,spendDrivers,travelSpendChange,topSpender,missingCategory,awaitingApproval,notReimbursed,unsubmitted,leftToPay,combineExpenses,exportPdf,exportCsv), and keepASK_CONCIERGE_PLACEHOLDER_KEYS = [...BASE_CONCIERGE_PLACEHOLDER_KEYS, ...EXPENSE_DEPENDENT_CONCIERGE_PLACEHOLDER_KEYS] as const.
- Define
- Gate expense/report-dependent placeholders on whether the user has any money-request report or transaction (only when
isConciergeInboxDMis true):- Add a lightweight boolean selector in
src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx(or a dedicated hookuseHasAnyExpenseOrReport(enabled: boolean)) that subscribes toONYXKEYS.COLLECTION.REPORT(checkingObject.values(reports ?? {}).some((r) => isMoneyRequestReport(r))) andONYXKEYS.COLLECTION.TRANSACTION(checkingObject.values(transactions ?? {}).some(Boolean)) whenisConciergeInboxDMistrue(passingcanBeMissing: trueand skipping evaluation on non-Concierge chats so regular report composers incur zero overhead). - Store a stable random float
const [randomSeed] = useState(() => Math.random())once per mount so the placeholder never flickers across re-renders, and select fromeligiblePlaceholderKeys = hasExpenseOrReport ? ASK_CONCIERGE_PLACEHOLDER_KEYS : BASE_CONCIERGE_PLACEHOLDER_KEYS:const eligibleConciergePlaceholderKeys = hasExpenseOrReport ? ASK_CONCIERGE_PLACEHOLDER_KEYS : BASE_CONCIERGE_PLACEHOLDER_KEYS; const askConciergePlaceholderKey = eligibleConciergePlaceholderKeys[Math.floor(randomSeed * eligibleConciergePlaceholderKeys.length)]; - This guarantees:
- A brand-new user with no expenses or expense reports only sees actionable prompts (
"Create an expense for a $30 lunch"or"Ask Concierge for help") and never sees"Export my last report to PDF"or spend-history prompts. - If Onyx finishes loading reports/transactions asynchronously after mount,
eligibleConciergePlaceholderKeysupdates cleanly without flickering on subsequent Onyx writes becauserandomSeedis fixed per mount.
- A brand-new user with no expenses or expense reports only sees actionable prompts (
- Add a lightweight boolean selector in
- Add unit tests in
tests/unit/ComposerInputConciergePlaceholderTest.tsx:- Test that when
ONYXKEYS.COLLECTION.REPORTandONYXKEYS.COLLECTION.TRANSACTIONare empty (new user), the Concierge DM placeholder is neverexportPdf(even whenMath.randomis mocked to target theexportPdfindex) and always resolves toBASE_CONCIERGE_PLACEHOLDER_KEYS. - Test that once a money-request report exists in Onyx,
exportPdfand the fullASK_CONCIERGE_PLACEHOLDER_KEYSpool become eligible.
- Test that when
What alternative solutions did you explore? (Optional)
- Filtering only
exportPdfandexportCsvwhile leaving the other 11 spend/report prompts: As seen in the automated reproduction screenshot on this issue (where a brand-new user saw"What drove my spend last quarter?"), leavingspendDrivers,awaitingApproval,notReimbursed, orcombineExpensesin the pool for a user with zero reports/expenses still violates the expected result ("Suggested input is something the user can actually do"). Splitting intoBASE_CONCIERGE_PLACEHOLDER_KEYSvs.EXPENSE_DEPENDENT_CONCIERGE_PLACEHOLDER_KEYSsolves the entire class of new-user placeholder mismatches cleanly. - Checking
useOnyx(ONYXKEYS.COLLECTION.REPORT)unconditionally in everyComposerInputinstance:ComposerInputrenders on every chat/report screen. Gating the selector onisConciergeInboxDMensures non-Concierge chats do not run collection scans.
Proposal
What is the root cause of that problem?
In src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx (lines 36–52, 90), askConciergePlaceholderKey is initialized unconditionally on initial render from ASK_CONCIERGE_PLACEHOLDER_KEYS:
const [askConciergePlaceholderKey] = useState(() => ASK_CONCIERGE_PLACEHOLDER_KEYS[Math.floor(Math.random() * ASK_CONCIERGE_PLACEHOLDER_KEYS.length)]);
This array combines general prompts with action-dependent prompts that strictly require existing expense reports (e.g. exportPdf, awaitingApproval) or transaction history (e.g. spendLastMonth, topExpenses, spendDrivers, travelSpendChange, topSpender, missingCategory, notReimbursed, unsubmitted, leftToPay, combineExpenses, exportCsv).
Because candidate placeholders are selected statically on first mount without verifying whether the user has any expense reports or transactions in Onyx (and before Onyx may have hydrated), a brand-new user with zero expenses or reports is shown prompts for actions they cannot perform.
What changes do you think we should make in order to solve the problem?
-
Partition
ASK_CONCIERGE_PLACEHOLDER_KEYSby prerequisite insrc/pages/inbox/report/ReportActionCompose/ComposerInput.tsx:- Define
BASE_CONCIERGE_PLACEHOLDER_KEYSfor prompts that any user (including a brand-new user with 0 expenses and 0 reports) can always perform:const BASE_CONCIERGE_PLACEHOLDER_KEYS = [ 'common.concierge.composerPlaceholders.createExpense', 'reportActionCompose.askConciergeForHelp', ] as const; - Define
EXPENSE_DEPENDENT_CONCIERGE_PLACEHOLDER_KEYSfor the remaining 13 prompts that require existing expenses/reports (spendLastMonth,topExpenses,spendDrivers,travelSpendChange,topSpender,missingCategory,awaitingApproval,notReimbursed,unsubmitted,leftToPay,combineExpenses,exportPdf,exportCsv). - Retain
ASK_CONCIERGE_PLACEHOLDER_KEYS = [...BASE_CONCIERGE_PLACEHOLDER_KEYS, ...EXPENSE_DEPENDENT_CONCIERGE_PLACEHOLDER_KEYS] as const.
- Define
-
Add lightweight, high-performance boolean selectors: Follow the proven pattern from
src/pages/Search/EmptySearchView.tsx(lines 115–119) with delete-pending filtering:const hasExpenseReportsSelector = (reports: OnyxCollection<Report>) => Object.values(reports ?? {}).some( (report) => (report?.type === CONST.REPORT.TYPE.EXPENSE || isMoneyRequestReport(report)) && report?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, ); const hasTransactionsSelector = (transactions: OnyxCollection<Transaction>) => Object.values(transactions ?? {}).some( (transaction) => !!transaction && transaction?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, ); -
Gate evaluation to zero-overhead for non-Concierge chats in
ComposerInput.tsx: Curry the selectors withisConciergeInboxDM:const hasExpenseReportsSelectorCurried = useCallback( (reports: OnyxCollection<Report>) => (isConciergeInboxDM ? hasExpenseReportsSelector(reports) : false), [isConciergeInboxDM], ); const hasTransactionsSelectorCurried = useCallback( (transactions: OnyxCollection<Transaction>) => (isConciergeInboxDM ? hasTransactionsSelector(transactions) : false), [isConciergeInboxDM], ); const [hasExpenseReports = false] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {selector: hasExpenseReportsSelectorCurried}); const [hasTransactions = false] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {selector: hasTransactionsSelectorCurried}); const hasExpenseOrReport = hasExpenseReports || hasTransactions;When
!isConciergeInboxDM, the selector returnsfalseimmediately in O(1) time without iterating collections. For Concierge chats, returning primitive booleans prevents any re-renders unless the boolean state actually transitions. -
Derive the eligible placeholder without flicker: Store a stable random seed float on mount and derive the key with
useMemo:const [randomSeed] = useState(() => Math.random()); const askConciergePlaceholderKey = useMemo(() => { const eligibleKeys = hasExpenseOrReport ? ASK_CONCIERGE_PLACEHOLDER_KEYS : BASE_CONCIERGE_PLACEHOLDER_KEYS; return eligibleKeys[Math.floor(randomSeed * eligibleKeys.length)]; }, [hasExpenseOrReport, randomSeed]);- For a brand-new user with zero expenses/reports, only actionable prompts (
"Create an expense for a $30 lunch"or"Ask Concierge for help") are selected. "Export my last report to PDF"and spend analysis prompts are never shown when no reports or expenses exist.- When Onyx hydrates or when an expense is created,
hasExpenseOrReportupdates seamlessly andrandomSeedprevents re-render flickering.
- For a brand-new user with zero expenses/reports, only actionable prompts (
What alternative solutions did you explore? (Optional)- Only filtering exportPdf / exportCsv: Rejected because leaving spendDrivers, awaitingApproval, combineExpenses, etc. in the pool still presents prompts to a new user that they cannot perform, violating the expected result.
- Unconditional
useOnyxcollection scan: Rejected because running collection scans across all chat composers impacts performance. Currying withisConciergeInboxDMguarantees O(1) bypass for all regular chats.
Tests
- Log in with a fresh new account (0 expenses, 0 reports).
- Open Concierge DM in Inbox.
- Verify the composer placeholder displays an actionable prompt (e.g.
"Create an expense for a $30 lunch"or"Ask Concierge for help…"). - Verify
"Export my last report to PDF"and other report/spend-dependent prompts are never shown. - Create an expense or report.
- Verify that report/spend-dependent prompts become eligible in Concierge DM.
- Open a standard DM or workspace chat and verify composer placeholder functions normally with no performance degradation.
- [x] Verify that no errors appear in the JS console
Automated Unit Tests
Add unit tests in tests/unit/ComposerInputConciergePlaceholderTest.tsx:
- Verify that with empty Onyx collections, the selected Concierge placeholder is strictly from
BASE_CONCIERGE_PLACEHOLDER_KEYSeven whenMath.randomis mocked to target indices ofexportPdforspendDrivers. - Verify that once a report or transaction is added to Onyx,
exportPdfand the fullASK_CONCIERGE_PLACEHOLDER_KEYSpool become eligible.
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0131dae36abcf59374
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a brand-new user completes onboarding (zero expenses, zero expense reports) and opens the Concierge Inbox DM, the composer placeholder can show history-dependent prompts such as "Export my last report to PDF", suggesting actions on reports or expenses that do not exist yet.
What is the root cause of that problem?
In src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx, ASK_CONCIERGE_PLACEHOLDER_KEYS (lines 36-52) mixes prompts that need different underlying data, and line 90 picks one at random with useState on first mount, with no check on the user's data at all. The isConciergeInboxDM branch then renders the pick unconditionally. So a new user can be shown exportPdf (or exportCsv, awaitingApproval, spendLastMonth, etc.) when there is nothing to export or analyse. MelvinBot's web test confirms the prompt is selectable with no report-availability check.
What changes do you think we should make in order to solve the problem?
Filter the candidate keys by what the user actually has, in two tiers, because one gate is not enough:
- Spend-analysis prompts (
spendLastMonth,topExpenses,spendDrivers,travelSpendChange,topSpender,missingCategory) need transaction history, not just a report. Gating only on "has a report" would still show "What drove my spend last quarter?" to a user with one empty report and zero transactions. - Report-action prompts (
exportPdf,exportCsv,awaitingApproval,notReimbursed,unsubmitted,leftToPay,combineExpenses) need at least one money-request report. - Compute both flags from Onyx:
ONYXKEYS.COLLECTION.REPORTfiltered withisMoneyRequestReport(already imported in this file) for reports, andONYXKEYS.COLLECTION.TRANSACTIONfor transactions. - Because
useStatefreezes the pick at first mount and Onyx may not be hydrated yet, recompute the pick withuseMemokeyed on the two eligibility flags, so a key picked before data loads is replaced once eligibility is known. While data is loading, or when neither tier is eligible, fall back to the always-safe keys (createExpense,askConciergeForHelp), so the list is never empty.
What will you verify?
- Jest test forcing the random pick to each tier for: (a) no reports and no transactions, (b) reports present but zero transactions, (c) transactions present, (d) delayed Onyx hydration (pick made before data loads is corrected once data arrives).
- Manual check on a fresh account: open the Concierge DM repeatedly and confirm no report- or transaction-dependent prompt ever appears, and that a generic prompt is shown instead.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a brand-new user (with no expenses or expense reports) opens the Concierge chat right after onboarding, the composer input placeholder can display prompts such as "Export my last report to PDF" (or other report/expense-dependent prompts like "Export my last report to CSV", "Show reports awaiting my approval", etc.) that cannot work because the user has no reports or expenses yet.
What is the root cause of that problem?
In src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx (lines 36-52), ASK_CONCIERGE_PLACEHOLDER_KEYS is a single flat array of 15 translation keys:
const ASK_CONCIERGE_PLACEHOLDER_KEYS = [
'common.concierge.composerPlaceholders.spendLastMonth',
'common.concierge.composerPlaceholders.topExpenses',
'common.concierge.composerPlaceholders.spendDrivers',
'common.concierge.composerPlaceholders.travelSpendChange',
'common.concierge.composerPlaceholders.topSpender',
'common.concierge.composerPlaceholders.missingCategory',
'common.concierge.composerPlaceholders.awaitingApproval',
'common.concierge.composerPlaceholders.notReimbursed',
'common.concierge.composerPlaceholders.unsubmitted',
'common.concierge.composerPlaceholders.leftToPay',
'common.concierge.composerPlaceholders.createExpense',
'common.concierge.composerPlaceholders.combineExpenses',
'common.concierge.composerPlaceholders.exportPdf',
'common.concierge.composerPlaceholders.exportCsv',
'reportActionCompose.askConciergeForHelp',
] as const satisfies readonly TranslationPaths[];
And at line 90 of src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx:
const [askConciergePlaceholderKey] = useState(() => ASK_CONCIERGE_PLACEHOLDER_KEYS[Math.floor(Math.random() * ASK_CONCIERGE_PLACEHOLDER_KEYS.length)]);
There are two problems with this implementation:
- Unconditional pool: Only 2 of the 15 keys (
'common.concierge.composerPlaceholders.createExpense'and'reportActionCompose.askConciergeForHelp') are applicable to a user with zero expenses and zero expense reports. The remaining 13 keys require either existing expense/money-request reports (awaitingApproval,notReimbursed,unsubmitted,leftToPay,combineExpenses,exportPdf,exportCsv) or existing expense transactions (spendLastMonth,topExpenses,spendDrivers,travelSpendChange,topSpender,missingCategory). - One-shot
useStateinitializer: Selecting the key insideuseState(() => ...)runs only once whenComposerInputfirst mounts and cannot adapt as Onyx finishes hydratingONYXKEYS.COLLECTION.REPORT/ONYXKEYS.COLLECTION.TRANSACTIONor when the user creates/deletes their first report or expense.
What changes do you think we should make in order to solve the problem?
- Partition
ASK_CONCIERGE_PLACEHOLDER_KEYSinsrc/pages/inbox/report/ReportActionCompose/ComposerInput.tsxby data requirement:BASE_CONCIERGE_PLACEHOLDER_KEYS: always eligible (createExpense,askConciergeForHelp).REPORT_CONCIERGE_PLACEHOLDER_KEYS: eligible only when the user has at least one non-deleted money-request report (awaitingApproval,notReimbursed,unsubmitted,leftToPay,combineExpenses,exportPdf,exportCsv).TRANSACTION_CONCIERGE_PLACEHOLDER_KEYS: eligible only when the user has at least one non-deleted transaction (spendLastMonth,topExpenses,spendDrivers,travelSpendChange,topSpender,missingCategory).
const BASE_CONCIERGE_PLACEHOLDER_KEYS = [
'common.concierge.composerPlaceholders.createExpense',
'reportActionCompose.askConciergeForHelp',
] as const satisfies readonly TranslationPaths[];
const REPORT_CONCIERGE_PLACEHOLDER_KEYS = [
'common.concierge.composerPlaceholders.awaitingApproval',
'common.concierge.composerPlaceholders.notReimbursed',
'common.concierge.composerPlaceholders.unsubmitted',
'common.concierge.composerPlaceholders.leftToPay',
'common.concierge.composerPlaceholders.combineExpenses',
'common.concierge.composerPlaceholders.exportPdf',
'common.concierge.composerPlaceholders.exportCsv',
] as const satisfies readonly TranslationPaths[];
const TRANSACTION_CONCIERGE_PLACEHOLDER_KEYS = [
'common.concierge.composerPlaceholders.spendLastMonth',
'common.concierge.composerPlaceholders.topExpenses',
'common.concierge.composerPlaceholders.spendDrivers',
'common.concierge.composerPlaceholders.travelSpendChange',
'common.concierge.composerPlaceholders.topSpender',
'common.concierge.composerPlaceholders.missingCategory',
] as const satisfies readonly TranslationPaths[];
- Use O(1)-gated boolean
useOnyxselectors and a stable per-mount random seed inComposerInput: Insrc/pages/inbox/report/ReportActionCompose/ComposerInput.tsx, computeisConciergeInboxDMfirst, and short-circuit the collection selectors when!isConciergeInboxDMso non-Concierge chats do zero work overONYXKEYS.COLLECTION.REPORTandONYXKEYS.COLLECTION.TRANSACTION. Store a stable random floatconst [placeholderRandomSeed] = useState(() => Math.random());on mount and deriveaskConciergePlaceholderKeyfrom the eligible pool:
const isConciergeInboxDM = isTopLevelInline && isChatThread(report) && isConciergeChatReport(report);
const hasMoneyRequestReportSelector = useCallback(
(reports: OnyxCollection<Report>) => {
if (!isConciergeInboxDM || !reports) {
return false;
}
return Object.values(reports).some(
(candidateReport) =>
isMoneyRequestReport(candidateReport) &&
candidateReport?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
},
[isConciergeInboxDM],
);
const hasTransactionSelector = useCallback(
(transactions: OnyxCollection<Transaction>) => {
if (!isConciergeInboxDM || !transactions) {
return false;
}
return Object.values(transactions).some(
(transaction) =>
!!transaction &&
transaction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
},
[isConciergeInboxDM],
);
const [hasMoneyRequestReports = false] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {
selector: hasMoneyRequestReportSelector,
});
const [hasTransactions = false] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {
selector: hasTransactionSelector,
});
const [placeholderRandomSeed] = useState(() => Math.random());
const eligibleConciergePlaceholderKeys = [
...BASE_CONCIERGE_PLACEHOLDER_KEYS,
...(hasMoneyRequestReports ? REPORT_CONCIERGE_PLACEHOLDER_KEYS : []),
...(hasTransactions ? TRANSACTION_CONCIERGE_PLACEHOLDER_KEYS : []),
];
const askConciergePlaceholderKey =
eligibleConciergePlaceholderKeys[Math.floor(placeholderRandomSeed * eligibleConciergePlaceholderKeys.length)];
Because both useOnyx hooks return primitive booleans (hasMoneyRequestReports and hasTransactions), ComposerInput will not re-render on ordinary report or transaction mutations—only when the user transitions between having 0 and >= 1 money-request reports or transactions (or when Onyx finishes initial hydration).
What alternative solutions did you explore? (Optional)
- Checking
ONYXKEYS.HAS_LOADED_APPortryNewDotonboarding flags: Onboarding flags do not guarantee that a user has created an expense or a report (and conversely, an existing user may have deleted all reports). Checking actual report/transaction existence via boolean selectors directly reflects whether report/expense prompts are actionable. - Combining all 13 non-base prompts behind a single
hasTransactions || hasMoneyRequestReportscheck: A user who has only a tracked self-DM transaction (with no expense report) still cannot"Export my last report to PDF". SeparatingREPORT_CONCIERGE_PLACEHOLDER_KEYS(hasMoneyRequestReports) fromTRANSACTION_CONCIERGE_PLACEHOLDER_KEYS(hasTransactions) ensures report-export prompts only appear when a report actually exists.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a brand-new user completes onboarding (with zero expenses and zero expense reports) and opens the Concierge chat, the message composer input placeholder randomly displays action prompts that operate on non-existent data (such as "Export my last report to PDF", "Export my last report to CSV", or historical spend queries like "What drove my spend last quarter?"), suggesting actions the user cannot perform.
What is the root cause of that problem?
In src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx:
- Lines 36-52 define
ASK_CONCIERGE_PLACEHOLDER_KEYS, combining general onboarding prompts (e.g.createExpense,askConciergeForHelp) with history-dependent prompts that strictly require pre-existing reports or expenses (exportPdf,exportCsv,spendLastMonth,topExpenses,spendDrivers,awaitingApproval,unsubmitted,leftToPay,combineExpenses). - At line 90:
const [askConciergePlaceholderKey] = useState(() => ASK_CONCIERGE_PLACEHOLDER_KEYS[Math.floor(Math.random() * ASK_CONCIERGE_PLACEHOLDER_KEYS.length)]);
ComposerInput uniformly picks a random key from the static array on initial render without checking if the user actually has any expense reports or transactions in Onyx.
What changes do you think we should make in order to solve the problem?
- In
src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx, partition the placeholders into general onboarding prompts and history-dependent prompts:
const ONBOARDING_CONCIERGE_PLACEHOLDER_KEYS = [
'common.concierge.composerPlaceholders.createExpense',
'reportActionCompose.askConciergeForHelp',
] as const;
- Check whether the user has existing expense reports (using Onyx reports collection or checking if any non-empty transaction exists). If the user has no expense reports, draw randomly from
ONBOARDING_CONCIERGE_PLACEHOLDER_KEYS. If expense reports exist, draw from the fullASK_CONCIERGE_PLACEHOLDER_KEYS.
What alternative solutions did you explore? (Optional)
Filtering the keys dynamically by verifying report count inside a custom hook useConciergeComposerPlaceholder(reportID). However, keeping the partition in ComposerInput is cleaner and minimizes re-renders.
Contributor Details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0179cdc82689f205c7
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a brand-new user who has no expenses or money request reports opens the Concierge chat (or the "Ask Concierge" panel), the composer input displays prompts such as "Export my last report to PDF" that presuppose existing expenses or reports. If the user submits that prompt, Concierge responds that the user has no reports to export.
What is the root cause of that problem?
In src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx (introduced in PR #100552), ASK_CONCIERGE_PLACEHOLDER_KEYS is a single static array of 15 translation keys:
const ASK_CONCIERGE_PLACEHOLDER_KEYS = [
'common.concierge.composerPlaceholders.spendLastMonth',
'common.concierge.composerPlaceholders.topExpenses',
'common.concierge.composerPlaceholders.spendDrivers',
'common.concierge.composerPlaceholders.travelSpendChange',
'common.concierge.composerPlaceholders.topSpender',
'common.concierge.composerPlaceholders.missingCategory',
'common.concierge.composerPlaceholders.awaitingApproval',
'common.concierge.composerPlaceholders.notReimbursed',
'common.concierge.composerPlaceholders.unsubmitted',
'common.concierge.composerPlaceholders.leftToPay',
'common.concierge.composerPlaceholders.createExpense',
'common.concierge.composerPlaceholders.combineExpenses',
'common.concierge.composerPlaceholders.exportPdf',
'common.concierge.composerPlaceholders.exportCsv',
'reportActionCompose.askConciergeForHelp',
] as const;
And at lines 89–90 and lines 102–103, ComposerInput picks uniformly at random from all 15 keys without checking whether the user actually has any expenses or non-empty money request reports in Onyx:
const isConciergeInboxDM = useIsConciergeInboxDM(reportID);
const [askConciergePlaceholderKey] = useState(() => ASK_CONCIERGE_PLACEHOLDER_KEYS[Math.floor(Math.random() * ASK_CONCIERGE_PLACEHOLDER_KEYS.length)]);
...
} else if (isConciergeInboxDM) {
inputPlaceholder = translate(askConciergePlaceholderKey);
}
Specifically:
- Only 2 of the 15 keys (
'common.concierge.composerPlaceholders.createExpense'and'reportActionCompose.askConciergeForHelp') are actionable for a new user with no expenses or reports. - Nine keys (
spendLastMonth,topExpenses,spendDrivers,travelSpendChange,topSpender,missingCategory,unsubmitted,combineExpenses,exportCsv) require the user to have at least one existing transaction inONYXKEYS.COLLECTION.TRANSACTION(including self-DM tracked expenses that may not belong to a money request report yet). - Four keys (
awaitingApproval,notReimbursed,leftToPay,exportPdf) require the user to have at least one non-empty money request report (isMoneyRequestReport(report) && ((report.transactionCount ?? 0) > 0 || (report.total ?? 0) !== 0)— note that an empty draft report withtransactionCount === 0cannot be exported to PDF, as enforced inuseExportActions.ts:126). - In addition, because
useStateinitializesaskConciergePlaceholderKeyonce on initial mount, if Onyx collections finish hydrating after mount or the available pool changes, a mount-onlyuseStateinitializer cannot adapt to the loaded state.
What changes do you think we should make in order to solve the problem?
In src/pages/inbox/report/ReportActionCompose/ComposerInput.tsx:
- Split the Concierge composer placeholder keys into:
DEFAULT_ASK_CONCIERGE_PLACEHOLDER_KEYS: always-valid prompts (createExpense,askConciergeForHelp).EXPENSE_ASK_CONCIERGE_PLACEHOLDER_KEYS: prompts that require at least one non-deleted transaction (spendLastMonth,topExpenses,spendDrivers,travelSpendChange,topSpender,missingCategory,unsubmitted,combineExpenses,exportCsv).REPORT_ASK_CONCIERGE_PLACEHOLDER_KEYS: prompts that require at least one non-empty money request report (awaitingApproval,notReimbursed,leftToPay,exportPdf).
- When
isConciergeInboxDMistrue, subscribe toONYXKEYS.COLLECTION.TRANSACTIONandONYXKEYS.COLLECTION.REPORTwith lightweight boolean selectors (hasUserTransactionsSelectorandhasNonEmptyMoneyRequestReportsSelector, gated via{canBeMissing: true}and only active for the Concierge DM). - Compute the eligible placeholder pool and memoize a stable random pick from the eligible keys (re-picking only if the currently selected key is not in the eligible pool or when the eligible pool expands).
What alternative solutions did you explore? (Optional)
- Checking
isMoneyRequestReport(report)without checkingtransactionCount/total: An empty draft report (transactionCount === 0) cannot be exported to PDF (useExportActions.ts:126), so requiringisMoneyRequestReport(item) && ((item.transactionCount ?? 0) > 0 || (item.total ?? 0) !== 0)ensures"Export my last report to PDF"is only shown when a report with actual expenses exists. - Checking only
ONYXKEYS.COLLECTION.REPORTfor all 13 expense/report prompts: A user who tracks expenses in their self-DM has transactions inONYXKEYS.COLLECTION.TRANSACTIONwithout a money request report (unsubmitted,combineExpenses,exportCsv, and spend-insight prompts are valid, whereasexportPdfis not). Separating expense-dependent keys from report-dependent keys handles both cases accurately.
📣 @cocvn157! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
@MelvinBot implement your proposal
🤖 Web test steps verification results: ✅ pass
Verified on dev NewDot web: empty-account Concierge displayed the allowed lunch prompt, and self-chat retained its normal composer. Nothing was sent or created.
| Step | Status |
|---|---|
Account has no expenses or reportsExpenses showed “No expenses yet”; Reports showed “No reports yet.” |
✅ |
Main Concierge composer shows an eligible promptDisplayed “Create an expense for a $30 lunch” and remained stable after expanding chat history.![]() |
✅ |
Ordinary chat composer remains unchangedSelf-chat displayed “Write something...” as expected.![]() |
✅ |
Implemented in draft PR: Fix Concierge placeholders for accounts without expenses, assigned to mkhutornyi, with PullerBear review requested.
- Passed: 38,232 tests, including 25 new regression tests; lint, typecheck, spelling, and Storybook smoke checks.
- Remaining verification: formatting check unavailable; changed-file compiler check could not resolve its base reference, though the explicit-file check succeeded. Browser console errors were not collected.
- Human Tests/QA sections remain for completion before marking ready for review.
I went with Melvin but I had to address many things during PR review. 🎀 👀 🎀 C+ reviewed
Edit: There are still many bugs to be addressed. In the end, I had to create PR myself to speed up things. Melvin is very slow and could not catch regressions.
Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Claude posting on behalf of Matt:
@MelvinBot implement your proposal. Use the closed PR https://github.com/Expensify/App/pull/106335 as a reference. It holds the changes from the earlier review.
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai.
Matt's AI agent:
@ahmedGaber93 you're now the C+ on this issue. The previous C+ is no longer in the Contributor program.
The previous C+ accepted Melvin's proposal, then wrote PR 106335, which is now closed. On the last request, Melvin ran out of time.
Next step: post @MelvinBot open a new PR with the changes from closed PR 106335. Do not change anything else. Then review that PR. @marcochavezf is the engineer.

