Skip to content

[Due for payment 2026-10-16] [$175] [CFI] Description hint is not displayed in the description field. #100527

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.4.72-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13176708/test-cases/41236896
Email or phone of affected tester (no customers): dave0123seife@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Mac 14.5/ Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  1. Enabled rules in Workspace

Steps:

  1. Go to Workspace > Categories > Advertising
  2. Add a Description Hint > Save
  3. Go to Required fields > Enable Require description
    4 Start manual Expense creation flow > Enter Amount
  4. Choose Advertising as Category

Expected Result:

Added description hint is displayed in the description field after choosing the Category

Image

Hint Text Specs

  • Size: Label (13px/16px)
  • Color: textSupporting
  • Position: 4px below the input field

Actual Result:

Description hint is not displayed in the description field.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Screen.Recording.2026-09-07.at.5.27.22.in.the.afternoon.mov

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7252973

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @Ollyws

Activity

  1. applause-bot commented on Sep 7, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/e929e2648a4152b402d01d9b942884ef366b07bf8cfba7e8bc7c83ff2ddf78a8

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 7, 2026
  3. MelvinBot commented on Sep 7, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The description field on the new manual expense creation form never receives the category's hint.

    In the new manual expense flow, the description is an inline TextInput rendered by src/components/MoneyRequestConfirmationList/sections/DescriptionField.tsx:102-121. That input is given label and accessibilityLabel but no hint prop, so policyCategory.commentHint has nowhere to render. The old flow's MenuItemWithTopDescription branch has no hint either — it only adds a "Required" right label.

    The hint is wired up in exactly one place in the app: the standalone description screen, src/pages/iou/request/step/DynamicIOURequestStepDescription.tsx:181. In the new flow that screen is never opened for description during creation, which is why the hint appears when you edit an existing expense but not while creating one.

    Confirmed by repro on dev web (v9.4.72-2 line) + a secondary bug in the old flow

    Repro (web, Chrome): Collect→Control workspace, Advertising category with hint Client name and Require description on.

    Step Result
    Hint saved on category settings ✅
    Advertising category page showing Description hint = Client name
    Require description enabled ✅
    Required fields page with Require description toggled ON for Advertising
    Creation flow, category chosen — Description field shows only the generic Description placeholder, no hint ❌
    Focused Description field on creation form showing only Description placeholder, no hint text
    Editing description of the already-created expense — hint Client name renders under the input ✅ (works)
    Description edit screen for an existing expense showing Client name hint text below the input

    Secondary bug, same symptom, old flow only. DynamicIOURequestStepDescription reads categories from the route report's policy — useOnyx(POLICY_CATEGORIES + report?.policyID) at line 72. During creation that route report is not the workspace chat: the FAB seeds a generateReportID() with no Onyx report (FloatingActionButtonAndPopover.tsx:36), and with delayed submissions off the amount step hands confirmation the self-DM, whose policyID is _FAKE_ (IOUAmountSubmission.ts:504-517). Either way policyCategories is undefined and line 181 silently yields ''. The sibling category step already solves this — it resolves the policy from the transaction/participants with a draft fallback (DynamicIOURequestStepCategory.tsx:77-108), which is why you can pick the category but then can't see its hint.

    transaction.category itself is fine — action === CREATE makes withFullTransactionOrNotFound pass the draft transaction (withFullTransactionOrNotFound.tsx:127), and the category step writes category to TRANSACTION_DRAFT.

    The hint was added in #56317, whose test steps did cover "before they create the expense". The original commit special-cased the draft transaction for that, but the policyCategories subscription was always keyed on report?.policyID and was never made creation-aware; the new inline flow then bypassed the screen entirely.

    What changes do you think we should make in order to solve the problem?

    1. Render the hint on the inline description input (fixes the reported flow).

    In DescriptionField.tsx, derive the hint and pass it to the TextInput:

    • Read the transaction's category with the existing categoryStateSelector via useTransactionSelector — the same pattern CategoryField.tsx:56 uses.
    • Read the policy's categories with usePolicyCategoriesForConfirmation(policy?.id) — the hook MoneyRequestConfirmationList already uses at line 221.
    • Look up commentHint for that category and pass it as hint, with shouldRenderHintAsHTML when non-empty, mirroring DynamicIOURequestStepDescription.tsx:232-233.

    Keeping the lookup inside DescriptionField avoids threading a new value through requiredFlags and the four footer variants. Alternatively, compute it next to isDescriptionRequired at MoneyRequestConfirmationList.tsx:380, where policyCategories and iouCategory are already in hand, and add it to requiredFlags.

    2. Make the description screen's policy lookup creation-aware (fixes the old flow and any entry point where the route report isn't the workspace chat).

    Replace the report?.policyID key at DynamicIOURequestStepDescription.tsx:72 with the same resolution the category step uses: getSelectedWorkspacePolicyID(transaction, action) ?? getIOURequestPolicyID(transaction, pickReportForPolicy(...)), plus the POLICY_CATEGORIES_DRAFT fallback.

    Tests: unit-test the hint derivation for a category with a commentHint against one without, and add a creation-flow case asserting the hint renders after a category with a hint is selected.

    What alternative solutions did you explore? (Optional)

    • Show the hint on the confirmation Description row itself (the old flow's MenuItemWithTopDescription). It has no hint slot today, in any flow or action, so this is a product decision rather than a bug fix — worth a design call if it's wanted.
    • Prefill the description with the hint text. Rejected: the copy is a prompt ("Client name"), not a value, and it would submit hint text as real data.
    Related issues and one loose end

    No duplicate found. #98740 (markdown formatting in the description-hint change log) touches the same feature but is a different bug.

    Loose end, not reproduced: for isEditingSplit the description screen reads transaction.category rather than splitDraftTransaction.category, unlike DynamicIOURequestStepCategory.tsx:111-112. Likely a third, narrower hint gap.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/100527) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run · no recording available

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 7, 2026
  5. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (External)

  6. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  7. danielamodu commented on Sep 7, 2026

    @danielamodu
    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    In a workspace with Rules enabled and "Require description" enabled on a category with a configured Description Hint (e.g. "Client name"), starting the manual expense creation flow and choosing that category results in the Description field showing only the generic "Description" label/placeholder with no hint text displayed.

    What is the root cause of that problem?

    There are two root causes across the expense creation surfaces:

    1. Inline Description Input (DescriptionField.tsx):
      In the new manual expense creation flow (isNewManualExpenseFlowEnabled = true), DescriptionField.tsx renders an inline TextInput inside MoneyRequestConfirmationList. However, TextInput is rendered without passing any hint or shouldRenderHintAsHTML props:
    <TextInput
        value={iouComment ?? ''}
        readOnly={didConfirm}
        onChangeText={handleDescriptionInputChange}
        onFocus={() => scrollFocusedInputIntoView?.(fieldContainerRef.current)}
        submitBehavior={canUseHardwareKeyboard ? 'blurAndSubmit' : 'newline'}
        onSubmitEditing={canUseHardwareKeyboard ? onSubmitForm : undefined}
        label={translate('common.description')}
        accessibilityLabel={translate('common.description')}
        autoGrowHeight
        maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}
        type="markdown"
        excludedMarkdownStyles={!policy ? ['mentionReport'] : []}
    />

    DescriptionField receives policy as a prop and has transactionID from useConfirmationFields(), but currently does not look up the selected category or its corresponding commentHint from policy categories.

    1. Dedicated Description Screen (DynamicIOURequestStepDescription.tsx):
      In legacy or navigation-based flows where the user taps MenuItemWithTopDescription, DynamicIOURequestStepDescription.tsx attempts to compute descriptionHint:
    const descriptionHint = transaction?.category && policyCategories ? (policyCategories[transaction?.category]?.commentHint ?? '') : '';

    However, policyCategories is subscribed at line 72 using only report?.policyID:

    const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report?.policyID}`);

    During manual expense creation, the route report is often a temporary generated report without a saved Onyx policy, or a self-DM with a fake policy ID (_FAKE_). As a result, policyCategories is undefined, causing descriptionHint to evaluate to ''.

    What changes do you think we should make in order to solve the problem?

    1. In src/components/MoneyRequestConfirmationList/sections/DescriptionField.tsx:

    • Import categoryStateSelector from ./selectors.
    • Import usePolicyCategoriesForConfirmation from @components/MoneyRequestConfirmationList/hooks/usePolicyCategoriesForConfirmation.
    • Retrieve the transaction's selected category using the existing selector:
      const categoryState = useTransactionSelector(transactionID, categoryStateSelector);
      const category = categoryState?.category;
    • Retrieve policy categories using usePolicyCategoriesForConfirmation(policy?.id).
    • Derive the description hint:
      const descriptionHint = category && policyCategories ? (policyCategories[category]?.commentHint ?? '') : '';
    • Pass hint={descriptionHint} and shouldRenderHintAsHTML={!!descriptionHint} to TextInput:
      <TextInput
          value={iouComment ?? ''}
          readOnly={didConfirm}
          onChangeText={handleDescriptionInputChange}
          onFocus={() => scrollFocusedInputIntoView?.(fieldContainerRef.current)}
          submitBehavior={canUseHardwareKeyboard ? 'blurAndSubmit' : 'newline'}
          onSubmitEditing={canUseHardwareKeyboard ? onSubmitForm : undefined}
          label={translate('common.description')}
          accessibilityLabel={translate('common.description')}
          autoGrowHeight
          maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}
          type="markdown"
          excludedMarkdownStyles={!policy ? ['mentionReport'] : []}
          hint={descriptionHint}
          shouldRenderHintAsHTML={!!descriptionHint}
      />

    2. In src/pages/iou/request/step/DynamicIOURequestStepDescription.tsx:

    • Update the policy resolution to match DynamicIOURequestStepCategory.tsx:
      Resolve policyID using getSelectedWorkspacePolicyID(transaction, action) ?? getIOURequestPolicyID(transaction, pickReportForPolicy(report, transactionReport, participantReport)) with fallback to reportDraft.
    • Subscribe to both real and draft policy categories:
      const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`);
      const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${policyIdDraft}`);
      const policyCategories = policyCategoriesReal ?? policyCategoriesDraft;
      This ensures that when navigating to the full-page description step during creation, policyCategories is populated and descriptionHint renders accurately.

    3. Automated Tests:

    • Add unit tests in tests/unit/components/MoneyRequestConfirmationList/DescriptionFieldTest.tsx:
      • Verify that when a transaction has a category with a configured commentHint, TextInput receives the expected hint string and shouldRenderHintAsHTML = true.
      • Verify that when a transaction has no category, or a category without a commentHint, hint is empty and shouldRenderHintAsHTML = false.
    • Add unit test in tests/unit/DynamicIOURequestStepDescriptionTest.tsx:
      • Verify that descriptionHint resolves correctly even when report.policyID is empty during draft creation.

    What alternative solutions did you explore? (Optional)

    Passing descriptionHint down as a prop from MoneyRequestConfirmationList through requiredFlags into TransactionDetailsFields and DescriptionField. However, computing it directly within DescriptionField via useTransactionSelector and usePolicyCategoriesForConfirmation is cleaner, keeps concerns encapsulated, and matches how sibling fields like CategoryField and MerchantField operate without bloating intermediate wrapper components.

  8. badnikhil commented on Sep 8, 2026

    @badnikhil

    @Ollyws Worth flagging while this is being scoped, because the same branch drops a second thing and it is tied to the "Require description" half of the repro.

    DescriptionField is handed isDescriptionRequired all the way from MoneyRequestConfirmationList:

    https://github.com/Expensify/App/blob/378f5f8b4118ab0e0e6bcd6f38bf16a0361f6154/src/components/MoneyRequestConfirmationListFooter/fieldGroups/TransactionDetailsFields/index.tsx#L98

    but in the new manual expense branch the prop is never read. The "Required" label only exists on the menu-item branch underneath it:

    {isNewManualExpenseFlowEnabled && !isReadOnly ? (

    rightLabel={isDescriptionRequired ? translate('common.required') : ''}

    MerchantField has the same shape but handled it. Its inline branch also drops rightLabel, and puts an inline error in its place:

    rightLabel={isMerchantRequired && !shouldDisplayMerchantError ? translate('common.required') : ''}

    Description has neither. For completeness on where the requirement is enforced: useConfirmationValidation has no reference to description at all, so confirmation is not blocked, and the requirement surfaces afterwards as the missingComment violation. Amount, date and merchant each have a branch in that file.

    So with rules on and Require description enabled, the new flow shows the field with no hint and no "Required" marker. The hint and the marker are the same three lines of JSX, so it is worth deciding up front whether this issue covers both or only the hint.

  9. melvin-bot commented on Sep 8, 2026

    @melvin-bot

    📣 @badnikhil! 📣
    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:

    1. Make sure you've read and understood the contributing guidelines.
    2. 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.
    3. 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.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  10. badnikhil commented on Sep 8, 2026

    @badnikhil

    Contributor details
    Your Expensify account email: nikhilljatt@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~01f2ba0507adf6ac64

  11. melvin-bot commented on Sep 8, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  12. badnikhil commented on Sep 8, 2026

    @badnikhil

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    With a category rule that sets a description hint (and "Require description" on), creating a manual expense shows the description field with no hint and no Required marker.

    What is the root cause of that problem?

    In the new manual expense flow (isBetaEnabled(CONST.BETAS.NEW_MANUAL_EXPENSE_FLOW), MoneyRequestConfirmationList.tsx:227) the description is an inline TextInput rendered by DescriptionField.tsx:102-121.

    The hint lives at policyCategory.commentHint (src/types/onyx/PolicyCategory.ts:41) and is rendered in exactly one place in the app: DynamicIOURequestStepDescription.tsx:181 computes

    transaction?.category && policyCategories ? (policyCategories[transaction.category]?.commentHint ?? '') : ''
    

    and passes it as hint with shouldRenderHintAsHTML. The new flow never opens that screen while creating the expense, so the hint has nowhere to render.

    Two details worth having on the record, because they change the scope:

    1. The same JSX branch also drops the Required affordance. isDescriptionRequired is handed all the way down from MoneyRequestConfirmationList through TransactionDetailsFields/index.tsx:98, but the inline branch never reads it — the Required label only exists on the menu-item branch below (DescriptionField.tsx:102 vs :141). MerchantField has the identical shape and handled it: its inline branch drops rightLabel and puts an inline error in its place (MerchantField.tsx:129, :153). Description has neither. So the tester's repro is really two regressions in the same ternary.
    2. useConfirmationValidation has no reference to description at all, so confirmation is never blocked; the requirement only surfaces afterwards as the missingComment violation. Amount, date and merchant each have a branch in that file.

    What changes do you think we should make in order to solve the problem?

    The parent already holds both halves of the lookup, so no new Onyx subscription and no new plumbing are needed. MoneyRequestConfirmationList.tsx:380 already computes isCategoryDescriptionRequired(policyCategories, iouCategory, ...) from the same policyCategories and the same category.

    1. In MoneyRequestConfirmationList.tsx, next to line 380, derive
    const descriptionHint = policyCategories?.[iouCategory]?.commentHint ?? '';
    

    and add it to the existing requiredFlags object at line 597. It already flows to DescriptionField via fieldGroupTypes.ts:32 and TransactionDetailsFields/index.tsx:98.

    1. In DescriptionField.tsx, on the inline TextInput, pass hint={descriptionHint} and shouldRenderHintAsHTML={!!descriptionHint}, mirroring DynamicIOURequestStepDescription.tsx:232-233, and render the Required affordance from the isDescriptionRequired prop so it stops being dead in that branch.

    2. Jest test: a category with a commentHint renders it, one without renders nothing, and isDescriptionRequired renders the marker.

    What alternative solutions did you explore? (Optional)

    Reading commentHint inside DescriptionField from its own Onyx connection. Rejected: it duplicates a lookup the parent already performs and adds a subscription per field.

    Routing creation through DynamicIOURequestStepDescription so the existing hint code runs. Rejected: that reintroduces the extra screen the new flow deliberately removes.

    Fixing only the hint and leaving Required dead. Worth a maintainer decision rather than my assumption, which is why I flagged it above; the two are the same three lines of JSX, so splitting them costs a second PR.

  13. 76 remaining items

  14. melvin-bot commented on Oct 26, 2026

    @melvin-bot

    @Ollyws Huh... This is 4 days overdue. Who can take care of this?

  15. lucasrocha20 commented on Oct 26, 2026

    @lucasrocha20

    I can get this, ok?

  16. mallenexpensify commented on Oct 27, 2026

    @mallenexpensify
    Contributor

    @Ollyws plz provide an update with where we are here and what you're due. Thx

  17. Ollyws commented on Oct 27, 2026

    @Ollyws
    Contributor

    The first PR was reverted due to two regressions. There were three linked issues:

    #101512 - Regression
    #101556 - Regression
    #101519 - Already existed on prod (still existed after #101072 revert)

    All three were fixed in a follow up PR.

  18. Ollyws commented on Oct 27, 2026

    @Ollyws
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR: N/A, new feature.
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template. Needed for all bugs AND new features

    Regression Test Proposal

    Precondition:

    • Rules are enabled in the workspace

    Test:

    Precondition:

    1. Go to Workspace > Categories > Advertising
    2. Add a Description hint > Save
    3. Go to Required fields > Enable Require description
    4. Start the manual expense creation flow > Enter an amount
    5. Choose Advertising as the category
    6. Verify the description hint is displayed in the Description field after choosing the category
    

    Do we agree 👍 or 👎

  19. mallenexpensify commented on Oct 27, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @Ollyws due $75 via NewDot

    Went with $75 cuz OG price was $250 and there were two regressions. Comment/reopen if you disagree.

    Link to the comment on the PR: N/A, new feature.

    Thx for inc. this @Ollyws

  20. flaviadefaria commented on Nov 9, 2026

    @flaviadefaria
    Contributor

    Approved: @Ollyws due $75 via NewDot

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions