Skip to content

Make it more apparent in the expense chat carousel view when expenses are added to a report #71390

Closed

Description

@jamesdeanexpensify

Background

Coming from this convo, we'd like to make it more apparent in the expense chat carousel view when expenses are added to a report.

Proposal

More specifically, new expenses should slide in and there should be a highlight that fades out slowly:

2025-09-26_13-36-18.mp4

cc @Expensify/design

Issue OwnerCurrent Issue Owner: @situchan

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    ImprovementItem broken or needs improvement.
    on Sep 26, 2025
  2. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 26, 2025
  3. melvin-bot commented on Sep 26, 2025

    @melvin-bot

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

  4. jamesdeanexpensify commented on Sep 26, 2025

    @jamesdeanexpensify
    ContributorAuthor

    Shoot, I can't seem to get the video to show up right in the OP.

  5. PiyushChandra17 commented on Sep 26, 2025

    @PiyushChandra17
    Contributor

    I would like to work on this, the changes are already mentioned in OP

  6. rushatgabhane commented on Sep 26, 2025

    @rushatgabhane
    Member

    need a proposal for this one

  7. PiyushChandra17 commented on Sep 26, 2025

    @PiyushChandra17
    Contributor

    Proposal

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

    Make it more apparent in the expense chat carousel view when expenses are added to a report

    What is the root cause of that problem?

    Improvement

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

    1. We need to implement a Carousel view when expenses are added to report

    2. It should consists with prevButton and nextButton at the top > It should slide in and have fade view effect

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

    n/A

    What alternative solutions did you explore? (Optional)

    n/A

  8. jamesdeanexpensify commented on Sep 26, 2025

    @jamesdeanexpensify
    ContributorAuthor

    I updated the video in the OP with a recording. You can see that there's already a carousel view in the expense chat!

  9. jamesdeanexpensify commented on Sep 26, 2025

    @jamesdeanexpensify
    ContributorAuthor

    The actual change is: new expenses should slide in and there should be a highlight that fades out slowly:

  10. PiyushChandra17 commented on Sep 26, 2025

    @PiyushChandra17
    Contributor

    Okay i think it's right here, we need to update this

    carouselRef.current?.scrollToIndex({index: carouselTransactions.length - visibleItemsOnEndCount, animated: true, viewOffset: 2 * styles.gap2.gap});

    Need to figure out the slide in behaviour, highlight that fades out slowly we do it like this way:

    selectionListRef.current?.scrollAndHighlightItem?.(invitedEmails);

  11. FitseTLT commented on Sep 26, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Make it more apparent in the expense chat carousel view when expenses are added to a report

    What is the root cause of that problem?

    New Feature

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

    We will need to pass shouldHighlight prop to TransactionPreviewContent and we will enable the highlight animation if it is true

    const transactionWrapperStyles = [styles.border, styles.moneyRequestPreviewBox, (isIOUSettled || isApproved) && isSettlementOrApprovalPartial && styles.offlineFeedback.pending];
    return (
    <View style={[transactionWrapperStyles, containerStyles]}>

    const animatedHighlightStyle = useAnimatedHighlightStyle({
            shouldHighlight,
            highlightColor: theme.messageHighlightBG,
            backgroundColor: theme.cardBG,
        });
    
        const transactionWrapperStyles = [
            styles.border,
            styles.moneyRequestPreviewBox,
            (isIOUSettled || isApproved) && isSettlementOrApprovalPartial && styles.offlineFeedback.pending,
            animatedHighlightStyle,
        ];
    
        return (
            <Animated.View style={[transactionWrapperStyles, containerStyles]}>
               
    

    In MoneyRequestReportPreview we will track the highlighted items via a state and pass shouldHighlight all the way down to TransactionPreviewContent if an item is part of it. Via an effect whenever there is a new transaction added we will set newItemsToHighlight

       const [itemsToHighlight, setItemsToHighlight] = useState<Set<string> | null>(null);
        const prevTransactionIDs = usePrevious(transactions.map((tra) => tra.transactionID));
        useEffect(() => {
            const newTransactionIDs = transactions.filter((tran) => !prevTransactionIDs.includes(tran.transactionID)).map((tra) => tra.transactionID);
            if (!newTransactionIDs.length) {
                return;
            }
            const newItemsToHighlight = new Set<string>();
            newTransactionIDs.forEach((item) => {
                newItemsToHighlight.add(item);
            });
    
            setItemsToHighlight(newItemsToHighlight);
        }, [transactions]);
    

                shouldHighlight={!!itemsToHighlight?.has(item.transactionID)}
    
    

    Then pass itemsToHighlight

                itemsToHighlight={itemsToHighlight}
    
    

    Then insided MoneyRequestReportPreviewContent we will scroll to the first new item

      useEffect(() => {
            const index = carouselTransactions.findIndex((trans) => itemsToHighlight?.has(trans.transactionID));
    
            if (index < 0) {
                return;
            }
            InteractionManager.runAfterInteractions(() => {
                carouselRef.current?.scrollToIndex({index});
            });
        }, [itemsToHighlight]);
    

    Optionally we can start the scrolling and highlighting after the report preview is scrolled to view here

    if (action?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW) {
    if (index > 0) {
    setTimeout(() => {
    reportScrollManager.scrollToIndex(index);
    }, 100);
    } else {
    setIsFloatingMessageCounterVisible(false);

    In that case we can imperatively call scrollAndHighlightItem approach like in SelectionLisht here The approach will similar to the above but we will only need to make notifyNewAction pass the new transactionIDs added then after scrolling to the report preview we will call scrollAndHighlightItem with the new transactionIDs and simialr to BaseSelectionList we will scroll to the new item and set a temporary itemsToHighlight state(that would be reset after a timeout).

    REsult :
    2025-09-27.02-56-40.mp4

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

    What alternative solutions did you explore? (Optional)

  12. github-actions commented on Sep 26, 2025

    @github-actions
    Contributor

    ⚠️ @FitseTLT 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).

  13. 111 remaining items

  14. melvin-bot commented on May 6, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @marcochavezf, @dannymcclain, @FitseTLT, @situchan eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  15. situchan commented on May 29, 2026

    @situchan
    Contributor

    @mallenexpensify This is done and ready for payment

    The linked blocker is not a regression.
    Reason: #83760 (comment)

    BugZero Checklist:

    • [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: new feature

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

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue: https://github.com/Expensify/Expensify/issues/642938

    Regression Test Proposal

    Test:

    1. Open a dm or policy chat
    2. Create expenses
    3. Verify that the new expenses created are scrolled to view and highlighted unless the report preview has more than 10 expenses and the new expenses are currently hidden on the report preview.
    4. Open the iou report
    5. Create an expense while on the iou report page
    6. Quickly navigate back to the chat report
    7. Verify that the scrolling and highlighting doesn't occur because the expense was added while on the iou report.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-f929-a01c-5d38-95bdeb8767f4
  16. mallenexpensify commented on May 30, 2026

    @mallenexpensify
    Contributor

    @situchan @FitseTLT what are you each due? Please post links to PRs you worked on (and.. any DBs or regressions). Thx

    ^ Test case created. Thx

  17. situchan commented on Jun 4, 2026

    @situchan
    Contributor

    @situchan @FitseTLT what are you each due?

    $250

    Please post links to PRs you worked on

    #81446

    (and.. any DBs or regressions).

    Linked blocker: #81446 (comment)
    Not regression. Reasoning: #83760 (comment)

  18. situchan commented on Jun 20, 2026

    @situchan
    Contributor

    @situchan @FitseTLT what are you each due?

    $250

    Please post links to PRs you worked on

    #81446

    (and.. any DBs or regressions).

    Linked blocker: #81446 (comment) Not regression. Reasoning: #83760 (comment)

    cc: @mallenexpensify ^

  19. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  20. mallenexpensify commented on Jun 22, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @FitseTLT due $250 via NewDot
    Contributor+: @situchan due $250 via NewDot

    Apologies for the delay, thx for tagging

  21. laurenreidexpensify commented on Jul 7, 2026

    @laurenreidexpensify
    Contributor

    $250 approved @situchan

  22. flaviadefaria commented on Jul 14, 2026

    @flaviadefaria
    Contributor

    Approved: @FitseTLT due $250 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 productionExternalAdded to denote the issue can be worked on by a contributorImprovementItem broken or needs improvement.MonthlyKSv2NewFeatureSomething to build that is a new item.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions