Skip to content

[Due for payment 2025-06-19] [$250] Expense report - 'Comments' sub-header is not displayed in the chat. #63076

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.1.54-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/6184971
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: All platforms
App Component: Other

Action Performed:

  1. Go to ND https://staging.new.expensify.com/
  2. Loggin with a expensifail account
  3. Create a new WS > Enable workflows in 'More Features' if it is disabled
  4. Go to the WS chat created
  5. Click on + button (create) within the chat > Create Report
  6. Open the Expense Report you created on the previously step.
  7. Send a message.

Expected Result:

'Comments' sub-header should be displayed above the comment.

Actual Result:

'Comments' sub-header is not displayed above the first comment.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021928524875839888926
  • Upwork Job ID: 1928524875839888926
  • Last Price Increase: 2025-05-30
  • Automatic offers:
    • daledah | Contributor | 107616047
Issue OwnerCurrent Issue Owner: @OfstadC

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 29, 2025
  2. melvin-bot commented on May 29, 2025

    @melvin-bot

    Triggered auto assignment to @OfstadC (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. daledah commented on May 29, 2025

    @daledah
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-05-29 18:22:49 UTC.

    Proposal

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

    'Comments' sub-header is not displayed above the first comment.

    What is the root cause of that problem?

    We only display the sub header when there's transactions

    <Animated.Text
    style={[styles.textLabelSupporting]}
    entering={hasComments ? undefined : FadeIn}
    exiting={FadeOut}
    >
    {hasComments || isLoadingReportActions ? translate('common.comments') : ''}
    </Animated.Text>

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

    We should display only the "Comments" sub header when there's comment and no transactions

    Add here

    {hasComments && (
                    <View style={[styles.dFlex, styles.flexRow, listHorizontalPadding, styles.justifyContentBetween, styles.mb2]}>
                        <Animated.Text
                            style={[styles.textLabelSupporting]}
                            entering={undefined}
                            exiting={FadeOut}
                        >
                            {translate('common.comments')}
                        </Animated.Text>
                    </View>
                )}

    Or move this sub header to outside of !isEmpty(transactions) check.

    <View style={[styles.dFlex, styles.flexRow, listHorizontalPadding, styles.justifyContentBetween, styles.mb2]}>
    <Animated.Text
    style={[styles.textLabelSupporting]}
    entering={hasComments ? undefined : FadeIn}
    exiting={FadeOut}
    >
    {hasComments || isLoadingReportActions ? translate('common.comments') : ''}
    </Animated.Text>
    <View style={[styles.dFlex, styles.flexRow, styles.alignItemsCenter, styles.pr3]}>
    <Text style={[styles.mr3, styles.textLabelSupporting]}>{translate('common.total')}</Text>
    <Text style={[shouldUseNarrowLayout ? styles.mnw64p : styles.mnw100p, styles.textAlignRight, styles.textBold, pendingActionsOpacity]}>
    {convertToDisplayString(totalDisplaySpend, report?.currency)}
    </Text>
    </View>
    </View>

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None, UI issue

    What alternative solutions did you explore? (Optional)

    We can extract this sub header:

    <View style={[styles.dFlex, styles.flexRow, listHorizontalPadding, styles.justifyContentBetween, styles.mb2]}>
    <Animated.Text
    style={[styles.textLabelSupporting]}
    entering={hasComments ? undefined : FadeIn}
    exiting={FadeOut}
    >
    {hasComments || isLoadingReportActions ? translate('common.comments') : ''}
    </Animated.Text>
    <View style={[styles.dFlex, styles.flexRow, styles.alignItemsCenter, styles.pr3]}>
    <Text style={[styles.mr3, styles.textLabelSupporting]}>{translate('common.total')}</Text>
    <Text style={[shouldUseNarrowLayout ? styles.mnw64p : styles.mnw100p, styles.textAlignRight, styles.textBold, pendingActionsOpacity]}>
    {convertToDisplayString(totalDisplaySpend, report?.currency)}
    </Text>
    </View>
    </View>

    Into a new component. Implement like below

    function SubHeader({report, hasComments, isLoadingInitialReportActions: isLoadingReportActions, transactions}: MoneyRequestReportTransactionListProps) {
        const {totalDisplaySpend} = getMoneyRequestSpendBreakdown(report);
        const styles = useThemeStyles();
        const {translate} = useLocalize();
        const {shouldUseNarrowLayout} = useResponsiveLayout();
    
        const pendingActionsOpacity = useMemo(() => {
            const pendingAction = transactions.some(getTransactionPendingAction);
            return pendingAction && styles.opacitySemiTransparent;
        }, [styles.opacitySemiTransparent, transactions]);
    
        const isTransactionEmpty = isEmpty(transactions);
        const shouldShowComments = hasComments || (!isEmpty(transactions) && isLoadingReportActions);
    
        if (isTransactionEmpty && !hasComments) {
            return null;
        }
    
        return (
            <View style={[styles.dFlex, styles.flexRow, styles.ph5, styles.justifyContentBetween, styles.mb2]}>
                <Animated.Text
                    style={[styles.textLabelSupporting]}
                    entering={hasComments ? undefined : FadeIn}
                    exiting={FadeOut}
                >
                    {shouldShowComments ? translate('common.comments') : ''}
                </Animated.Text>
                {!isTransactionEmpty && (
                    <View style={[styles.dFlex, styles.flexRow, styles.alignItemsCenter, styles.pr3]}>
                        <Text style={[styles.mr3, styles.textLabelSupporting]}>{translate('common.total')}</Text>
                        <Text style={[shouldUseNarrowLayout ? styles.mnw64p : styles.mnw100p, styles.textAlignRight, styles.textBold, pendingActionsOpacity]}>
                            {convertToDisplayString(totalDisplaySpend, report?.currency)}
                        </Text>
                    </View>
                )}
            </View>
        );
    }

    Then add it after here

    <SubHeader
              report={report}
              transactions={transactions}
              hasComments={reportHasComments}
              isLoadingInitialReportActions={isLoadingInitialReportActions}
    />

    There's also a weird behaviour that I'm not sure if it's a bug: If there's no comments, then the "Comments" sub header will display briefly when loading then disappears. We can discuss this later if needed.

    Screen.Recording.2025-05-30.at.01.20.15.mov

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 30, 2025
  5. melvin-bot commented on May 30, 2025

    @melvin-bot
  6. changed the title [-]Expense report - 'Comments' sub-header is not displayed in the chat.[/-] [+][$250] Expense report - 'Comments' sub-header is not displayed in the chat.[/+] on May 30, 2025
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 30, 2025
  8. melvin-bot commented on May 30, 2025

    @melvin-bot

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

  9. s77rt commented on May 31, 2025

    @s77rt
    Member

    @daledah Thanks for the proposal. I think we should extract the view logic outside the !isEmpty(transactions) condition. Can you please update your proposal?

  10. OfstadC commented on Jun 3, 2025

    @OfstadC
    Contributor

    Please note - I'll be OoO through Friday. If this issue needs BZ action while I'm out, please remove me, reapply the BZ label so another BZ member is assigned, and than re-add me as an assignee so I can check back in on Monday. Thank you! 😃

  11. s77rt commented on Jun 3, 2025

    @s77rt
    Member

    Not overdue ^

  12. 17 remaining items

  13. changed the title [-][$250] Expense report - 'Comments' sub-header is not displayed in the chat.[/-] [+][Due for payment 2025-06-19] [$250] Expense report - 'Comments' sub-header is not displayed in the chat.[/+] on Jun 12, 2025
  14. melvin-bot commented on Jun 12, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Jun 12, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.65-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-06-19. 🎊

    For reference, here are some details about the assignees on this issue:

  16. melvin-bot commented on Jun 12, 2025

    @melvin-bot

    @s77rt @OfstadC @s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  17. s77rt commented on Jun 15, 2025

    @s77rt
    Member

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: Improve MoneyRequestReportView #58903 (comment)

    • [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: n/a

    • [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.

      Bug requires regression test: No, I think this is a minor bug that does not need a test

  18. OfstadC commented on Jun 19, 2025

    @OfstadC
    Contributor

    Payment Summary

    Thank you!

  19. JmillsExpensify commented on Jun 26, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @s77rt

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions