App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-11] [$250] Show thread comments/comment number below the support ticket threads.

Open melvin-bot[bot] opened this issue 1 month ago • 133 comments

Problem

Support ticket previews in the Concierge chat do not show that the ticket thread has replies. Customers can't tell that a conversation with their support rep is happening inside the ticket, so they keep typing in the main Concierge chat instead.

Example

  1. A customer created a support ticket and got good help from a support rep.
  2. The customer started following the rep's instructions.
  3. The customer opened Concierge in the RHP and saw the support ticket preview.
  4. The customer typed in the main Concierge chat, thinking they were replying to the rep. This started a new thread with Concierge instead.
  5. Concierge replied, and the customer got frustrated.

There is currently no indicator on the support ticket preview that the support rep has responded. Image

Solution

Show the thread replies (reply count, like regular threads) below the support ticket preview, so customers know there is a conversation in the ticket and can open it. This should reuse the existing thread-reply UI pattern.

Image

cc @jasperhuangg

Reported in Slack.

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

melvin-bot[bot] avatar Oct 19 '26 20:10 melvin-bot[bot]

Proposal

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

When a support ticket thread in the Concierge chat has replies from a support rep, the support ticket preview gives no indication of them. Unlike regular threads, no reply count is shown below the preview, so customers don't realize a conversation is happening inside the ticket and reply in the main Concierge chat instead, starting an unrelated exchange with Concierge.

What is the root cause of that problem?

The "replies" footer that appears under a report action with a thread is rendered by ReportActionItemThread inside ReportActionItem, gated by shouldDisplayThreadReplies:

https://github.com/Expensify/App/blob/9d14b70be07d516add0a1fe43c06aef15bec321e/src/pages/inbox/report/ReportActionItem.tsx#L698-L708

shouldDisplayThreadReplies explicitly returns false for support ticket creation actions because of the trailing isCreatedSupportTicketReportAction exclusion:

https://github.com/Expensify/App/blob/9d14b70be07d516add0a1fe43c06aef15bec321e/src/libs/ReportUtils.ts#L12531-L12534

This exclusion was added deliberately when support tickets were built (commit 187e161410c, "fix(support): hide ticket preview reply counts"), along with a unit test asserting that a parent action whose childType is a support ticket omits the replies footer. The SupportTicketPreview component itself renders no reply indicator either, so even when the ticket thread has visible replies (childVisibleActionCount and childCommenterCount are populated on the parent action, same as regular threads), nothing on the preview reflects them:

https://github.com/Expensify/App/blob/9d14b70be07d516add0a1fe43c06aef15bec321e/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L252-L260

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

In shouldDisplayThreadReplies in src/libs/ReportUtils.ts, remove the isCreatedSupportTicketReportAction exclusion so the function evaluates support ticket creation actions with exactly the same condition as regular threads (visible child actions plus commenters, and not the thread's own parent-action view). A support ticket creation action is an ADD_COMMENT action whose childType is a support ticket, so it already flows through the standard thread bookkeeping:

https://github.com/Expensify/App/blob/9d14b70be07d516add0a1fe43c06aef15bec321e/src/libs/ReportActionsUtils.ts#L440-L442

With the exclusion gone, the existing ReportActionItemThread footer — reply count, replier avatars, and last-reply time — renders below the support ticket preview, and pressing it opens the ticket thread. This reuses the existing thread-reply UI pattern exactly as the issue requests; no changes to SupportTicketPreview are needed. The helper is also read by the Join thread / Leave thread context menu items, but those items (and Reply in thread) keep their own explicit isCreatedSupportTicketReportAction exclusion, so the ticket preview's context menu is unchanged. The isCreatedSupportTicketReportAction import in ReportUtils.ts stays, since canEditReportAction still uses it to keep ticket previews non-editable.

We should also update the existing unit test table for shouldDisplayThreadReplies in tests/unit/ReportUtilsTest.ts, which currently expects the footer to be omitted for the support ticket child type, so it now expects the footer to show — keeping explicit regression coverage for the new behavior:

https://github.com/Expensify/App/blob/9d14b70be07d516add0a1fe43c06aef15bec321e/tests/unit/ReportUtilsTest.ts#L7200-L7221

Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/104400-support-ticket-thread-replies?expand=1

What alternative solutions did you explore? (Optional)

Rendering a bespoke reply-count row inside the SupportTicketPreview component itself. Rejected: it would duplicate what ReportActionItemThread already does (count, avatars, last-reply time, navigation to the thread), would need its own styling and press handling, and would drift from regular threads over time. Gating the existing footer at the ReportActionItem level keeps support tickets visually and behaviorally identical to the established thread pattern.

wildan-m avatar Oct 21 '26 21:10 wildan-m

Job added to Upwork: https://www.upwork.com/jobs/~022113015012080613072

melvin-bot[bot] avatar Oct 21 '26 21:10 melvin-bot[bot]

Proposal updated — added compare branch with implementation.

wildan-m avatar Oct 21 '26 21:10 wildan-m

Proposal

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

When a customer submits a support ticket from the Concierge chat and a support rep replies inside that ticket's thread, the support ticket preview shown in the main Concierge chat gives no indication that a reply/conversation exists. Customers don't realize the rep already responded inside the ticket, so they type their follow-up in the main Concierge chat instead of opening the ticket thread, which kicks off an unrelated conversation with Concierge and causes frustration.

What is the root cause of that problem?

Every normal chat message that has thread replies shows a "X replies" row (avatars + reply count + timestamp) right below it when viewed in the parent chat. That row is rendered by ReportActionItemThread and is only shown when shouldDisplayThreadReplies returns true: https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/pages/inbox/report/ReportActionItem.tsx#L541 https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/pages/inbox/report/ReportActionItem.tsx#L698-L708

shouldDisplayThreadReplies itself explicitly excludes support ticket actions from ever showing the indicator, regardless of whether the ticket actually has replies: https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/libs/ReportUtils.ts#L12616-L12619

function shouldDisplayThreadReplies(reportAction: OnyxInputOrEntry<ReportAction>, isThreadReportParentAction: boolean, isAgentProcessingInThread = false): boolean {
    const hasReplies = (reportAction?.childVisibleActionCount ?? 0) > 0 && !!reportAction?.childCommenterCount;
    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction && !isCreatedSupportTicketReportAction(reportAction);
}

isCreatedSupportTicketReportAction flags the ADD_COMMENT action created when a support ticket is opened (its childType is supportTicket): https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/libs/ReportActionsUtils.ts#L440-L442

So even though the support ticket's ADD_COMMENT action gets childVisibleActionCount/childCommenterCount populated exactly like any other thread parent once the rep replies, the !isCreatedSupportTicketReportAction(reportAction) check always short-circuits the result to false for support tickets, and ReportActionItemThread never renders for them.

Instead, support tickets are rendered via a dedicated SupportTicketPreview card, which only shows the ticket's checkbox/avatar/name/arrow — it has no reply-count UI at all: https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L252-L260 https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/components/ReportActionItem/SupportTicketPreview.tsx#L74-L122

For comparison, regular Tasks go through the exact same shouldDisplayThreadReplies check but are not excluded from it, which is why task previews correctly show "X replies" under them when a task thread has comments: https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L241-L250

This confirms the hard-coded support ticket exclusion in shouldDisplayThreadReplies is the actual root cause: it suppresses the exact reply indicator the issue is asking for, even though the underlying data (childVisibleActionCount, childCommenterCount, childOldestFourAccountIDs, childReportID) is already present and correct for support ticket actions.

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

Remove the support-ticket exclusion from shouldDisplayThreadReplies so support ticket actions follow the same rule as every other thread-having action (including tasks), reusing the existing ReportActionItemThread "X replies" UI exactly as the issue requests, instead of building a new indicator: https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/libs/ReportUtils.ts#L12616-L12619

function shouldDisplayThreadReplies(reportAction: OnyxInputOrEntry<ReportAction>, isThreadReportParentAction: boolean, isAgentProcessingInThread = false): boolean {
    const hasReplies = (reportAction?.childVisibleActionCount ?? 0) > 0 && !!reportAction?.childCommenterCount;
    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;
}

With this change, once a support rep replies inside the ticket thread, childVisibleActionCount/childCommenterCount on the ticket's ADD_COMMENT action become truthy (the same fields SupportTicketPreview already reads childReportID from), shouldDisplayThreadReplies returns true, and ReportActionItemThread automatically renders the "X replies" row (with the rep's avatar, reply count, and last-reply timestamp) directly below the SupportTicketPreview card in the main Concierge chat — matching the mock in the issue. Tapping it uses the existing navigateToAndOpenChildReport flow to jump straight into the ticket thread, so customers can immediately see the rep replied and continue the conversation there instead of starting a new thread with Concierge.

No changes are needed to ReportActionItemThread, SupportTicketPreview, or the backend — the thread metadata needed to drive the indicator is already being sent and stored on the support ticket's ADD_COMMENT action; the indicator was simply being explicitly suppressed for that one action type.

abbasifaizan70 avatar Oct 22 '26 17:10 abbasifaizan70

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

melvin-bot[bot] avatar Oct 22 '26 17:10 melvin-bot[bot]

Proposal

What is the root cause of that problem?

The support ticket preview in Concierge is an ADD_COMMENT action whose child report is the ticket, recognised by its childType:

https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/libs/ReportActionsUtils.ts#L440-L442

ActionContentRouter renders it as SupportTicketPreview, which draws only the checkbox, the rep's avatar and the title:

https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L252-L259

The "N Replies" row (avatars, count, last reply time) under every threaded action, including the task preview in the same Concierge chat, is the ReportActionItemThread footer. ReportActionItem renders it only when shouldDisplayThreadReplies is true:

https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/pages/inbox/report/ReportActionItem.tsx#L698-L708

shouldDisplayThreadReplies returns false for the ticket action whatever its childVisibleActionCount and childCommenterCount are, because of its last clause, added with the support ticket UI in #102561 (commit 187e161410c, "hide ticket preview reply counts"):

https://github.com/Expensify/App/blob/ec8371a58d82e5689b0810a9c033a34e475a9954/src/libs/ReportUtils.ts#L12613-L12619

A real ticket needs an internal support rep, so I ran it with a ticket preview seeded in my Concierge chat next to a normal comment, both with childVisibleActionCount: 2 and childCommenterCount: 1: the comment shows 2 Replies and the ticket preview shows nothing, in the chat and in the Concierge side panel.

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

Remove the support ticket clause, so the ticket preview uses the rule of every other thread:

-    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction && !isCreatedSupportTicketReportAction(reportAction);
+    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;

Join/Leave thread keep their own isSupportTicketAction check, and the ticket's top action keeps no footer through !isThreadReportParentAction.

With the change and the same seed, the preview shows 2 Replies in the chat, the side panel and at 390px, and pressing it opens the ticket; after git stash it is gone again.

I'll update the SUPPORT_TICKET row of the shouldDisplayThreadReplies test in ReportUtilsTest.ts to expect true, where main returns false (the empty footer above); the CHAT and TASK rows stay as they are.

What alternative solutions did you explore? (Optional)

  • Render ReportActionItemThread inside SupportTicketPreview: it would repeat the footer gate and the press/context-menu wiring that ReportActionItem already has.

yusufdeveloper2903 avatar Oct 22 '26 17:10 yusufdeveloper2903

🤖 ProposalPolice™ is tracking duplicate proposals for this issue using an OpenAI Conversation. This comment stores that Conversation's ID and can be safely ignored.

github-actions[bot] avatar Oct 22 '26 17:10 github-actions[bot]

🚨 Edited by proposal-police: This proposal was edited at 2026-10-23 13:03:24 UTC.

Proposal

What is the root cause of that problem?

When a customer opens Concierge and looks at a support ticket card, the card has no reply count, no replier avatars, and no last-reply time under it. The customer cannot tell that the support rep is talking inside the ticket, so they type in the main Concierge composer and start a new chat with Concierge.

The ticket card is only the action body. The replies row is a sibling footer, ReportActionItemThread, and ReportActionItem mounts it only when shouldDisplayThreadReplies is true:

https://github.com/Expensify/App/blob/9d14b70be07d516add0a1fe43c06aef15bec321e/src/pages/inbox/report/ReportActionItem.tsx#L698-L708

For a created support ticket action, shouldDisplayThreadReplies always returns false because of the isCreatedSupportTicketReportAction check, even when that action already has childVisibleActionCount and childCommenterCount:

https://github.com/Expensify/App/blob/9d14b70be07d516add0a1fe43c06aef15bec321e/src/libs/ReportUtils.ts#L12531-L12534

SupportTicketPreview does not render a replies row either, so the thread metadata on the parent report action never appears under the card:

https://github.com/Expensify/App/blob/9d14b70be07d516add0a1fe43c06aef15bec321e/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L252-L260

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

  1. Remove the isCreatedSupportTicketReportAction check from shouldDisplayThreadReplies in ReportUtils.ts, so ticket cards get the same replies footer as any other thread:
return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;

ReportActionItem already mounts ReportActionItemThread when this returns true, so no change is needed there. The ticket card stays as it is.

  1. In ReportActionItemThread, make the footer open the ticket the same way the preview card does. For ticket actions, call Navigation.navigate(getReportRouteForCurrentContext({reportID: reportAction.childReportID})) and return early:
onPress={() => {
        // Support tickets always exist already, so open them the same way the ticket preview card does instead of creating a child thread accidently
        if (isCreatedSupportTicketReportAction(reportAction) && reportAction.childReportID) {
            Navigation.navigate(getReportRouteForCurrentContext({reportID: reportAction.childReportID}));
            return;
        }
        const participantsPersonalDetails = getParticipantsPersonalDetails([currentUserAccountID, Number(reportAction.actorAccountID)], personalDetails);
        navigateToAndOpenChildReport(childReport, reportAction, report, currentUserAccountID, introSelected, participantsPersonalDetails, isSelfTourViewed, conciergeChat);
    }}

here

https://github.com/Expensify/App/blob/1075d317c967a08a7c23f3badb76ebd0df3cf28c/src/pages/inbox/report/ReportActionItemThread.tsx#L78-L87

A ticket is an existing report, not a thread the user starts or can create new if not exist yet. Without this, the default navigateToAndOpenChildReport could create a new child thread if the ticket report is not in Onyx yet, and the user would land in the wrong conversation.

What alternative solutions did you explore? (Optional)

Keep shouldDisplayThreadReplies unchanged and add a separate shouldShowSupportTicketReplies condition in ReportActionItem. This works, but it duplicates the visibility logic, and it would not include the "agent is processing" case. The helper has only two callers, and the context menu already excludes tickets itself, so changing the helper is simpler.

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.

Test branch

Result

https://github.com/user-attachments/assets/29a9d2de-197d-4d8b-b8f6-f882832556e3

samranahm avatar Oct 22 '26 17:10 samranahm

Proposal

What is the root cause of that problem?

Support-ticket previews are ADD_COMMENT actions with childType: supportTicket, identified by [isCreatedSupportTicketReportAction] https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/libs/ReportActionsUtils.ts#L440-L442 https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/libs/ReportActionsUtils.ts#L440-L442 [ActionContentRouter] https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L252-L260
https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L252-L260 renders these actions as SupportTicketPreview.

The reply indicator is rendered separately by [ReportActionItemThread] https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/ReportActionItem.tsx#L698-L708 https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/ReportActionItem.tsx#L698-L708 Its visibility helper, [shouldDisplayThreadReplies] https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/libs/ReportUtils.ts#L12609-L12612 https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/libs/ReportUtils.ts#L12609-L12612 explicitly excludes support-ticket creation actions. Therefore, even when childVisibleActionCount and childCommenterCount indicate replies, the footer remains hidden. Ordinary chat and task actions with the same counts pass this check.

This also affects Concierge in the side panel because it mounts the same [ReportScreen] https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/components/SidePanel/SidePanelReport/index.tsx#L17-L29

https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/components/SidePanel/SidePanelReport/index.tsx#L17-L29

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

Remove the support-ticket exclusion from shouldDisplayThreadReplies. Preserve the existing reply-count/commenter condition, the agent-processing fallback, and !isThreadReportParentAction.

This lets ReportActionItem display the existing footer below the ticket preview. That component already reads the reply count, commenter avatars and last-reply timestamp, and opens the child report when pressed. [[ReportActionItemThread] https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/ReportActionItemThread.tsx#L50-L85) https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/ReportActionItemThread.tsx#L50-L85

Preserve the separate [Search visibility restriction] https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/ReportActionItem.tsx#L541 https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/ReportActionItem.tsx#L541
and support-ticket restrictions on [Join/Leave thread](https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L858-L953).

Update the existing [support-ticket test case] https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/tests/unit/ReportUtilsTest.ts#L7412-L7433 https://github.com/Expensify/App/blob/281586ca896a456a7cbc682a2413c4771fde0449/tests/unit/ReportUtilsTest.ts#L7412-L7433 to expect the footer. Cover tickets with replies, empty reply metadata, and the parent action displayed inside its own thread, while retaining chat/task and agent-processing coverage. Verify the footer opens the correct ticket from both the main Concierge chat and its side panel.

Note: If needed, add a support-ticket guard before the generic navigation fallback. The guard should navigate directly to the ticket route using childReportID, then return before optimistic report creation.

What alternative solutions did you explore? (Optional)

Adding a reply indicator inside SupportTicketPreview would duplicate the existing footer’s display and navigation logic. Changing the shared visibility condition reuses the thread UI requested by the issue.

Test Branch: https://github.com/Expensify/App/compare/main...nabi-ebrahimi:App:fix104400?expand=1

Issue Demo:

https://github.com/user-attachments/assets/ef0d4405-bf01-473e-b4c7-79b2a4cafacf

Fixed Demo:

https://github.com/user-attachments/assets/d0bac0cb-f280-4baf-8e1b-28c32570e43c

nabi-ebrahimi avatar Oct 22 '26 17:10 nabi-ebrahimi

Contributor: Janitha Dilshan | [email protected] | Upwork Profile: https://www.upwork.com/freelancers/~01b672727ccca49ec5

Proposal

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

In the Concierge chat, when a customer opens a support ticket and a support representative replies inside that ticket thread, the SupportTicketPreview card displays no replies indicator or comment counter. Because the customer sees no visible sign of an ongoing thread discussion, they assume no response was received and type their follow-up directly into the main Concierge room, inadvertently opening an unrelated thread with Concierge.

What is the root cause of that problem?

In src/libs/ReportUtils.ts, the helper shouldDisplayThreadReplies determines whether the standard thread reply summary (ReportActionItemThread) should render below a parent action item:

https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L12443-L12446

function shouldDisplayThreadReplies(reportAction: OnyxInputOrEntry<ReportAction>, isThreadReportParentAction: boolean, isAgentProcessingInThread = false): boolean {
    const hasReplies = (reportAction?.childVisibleActionCount ?? 0) > 0 && !!reportAction?.childCommenterCount;
    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction && !isCreatedSupportTicketReportAction(reportAction);
}

The support ticket creation action is an ADD_COMMENT report action whose childType is CONST.REPORT.TYPE.SUPPORT_TICKET. When a support rep posts comments in the ticket, the parent action's thread bookkeeping fields (childVisibleActionCount, childCommenterCount, childOldestFourAccountIDs, childReportID, childLastVisibleActionCreated) are correctly populated just like any regular thread.

However, shouldDisplayThreadReplies explicitly appends && !isCreatedSupportTicketReportAction(reportAction), which hard-blocks ReportActionItemThread from rendering under SupportTicketPreview regardless of how many rep replies exist.

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

  1. Remove the support ticket exclusion from shouldDisplayThreadReplies: In src/libs/ReportUtils.ts, remove !isCreatedSupportTicketReportAction(reportAction) so support ticket actions display the thread reply footer whenever child replies are present:
function shouldDisplayThreadReplies(reportAction: OnyxInputOrEntry<ReportAction>, isThreadReportParentAction: boolean, isAgentProcessingInThread = false): boolean {
    const hasReplies = (reportAction?.childVisibleActionCount ?? 0) > 0 && !!reportAction?.childCommenterCount;
-   return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction && !isCreatedSupportTicketReportAction(reportAction);
+   return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;
}

(Note: The import isCreatedSupportTicketReportAction remains intact in ReportUtils.ts because it is still required by canEditReportAction at line 6213 to ensure support ticket cards remain non-editable).

  1. Update Regression Unit Test: In tests/unit/ReportUtilsTest.ts, update the shouldDisplayThreadReplies parameter table so the SUPPORT_TICKET case asserts true when child replies exist:
    describe('shouldDisplayThreadReplies', () => {
        it.each([
-           [CONST.REPORT.TYPE.SUPPORT_TICKET, false],
+           [CONST.REPORT.TYPE.SUPPORT_TICKET, true],
            [CONST.REPORT.TYPE.CHAT, true],
            [CONST.REPORT.TYPE.TASK, true],
        ] as const)('child report type %s shows the replies footer: %s', (childType, expected) => {

Edge-Case & Caller Forensics Audit

  • Context Menu Safety (joinThread & leaveThread): Both joinThread and leaveThread context menu actions in ContextMenuActions.tsx and line 942 have their own independent guard !isSupportTicketAction && (const isSupportTicketAction = isCreatedSupportTicketReportAction(reportAction)). Modifying shouldDisplayThreadReplies will not leak Join/Leave thread actions into the support ticket context menu.
  • Inside the Ticket Thread (isThreadReportParentAction): When viewing inside the ticket thread report itself, isThreadReportParentAction is true. The existing !isThreadReportParentAction condition ensures the reply footer is cleanly suppressed on the parent action at the top of the thread view.
  • Search View Behavior: In ReportActionItem.tsx, shouldDisplayThreadReplies is guarded by && !isOnSearch, ensuring thread replies are not rendered in global search results.
  • Navigation & Press Handling: Tapping the reply footer utilizes ReportActionItemThread's native navigateToAndOpenChildReport call, which smoothly opens the support ticket in the RHP/central chat across both mobile and desktop screens.

What alternative solutions did you explore? (Optional)

Building custom reply count typography and press handling directly inside SupportTicketPreview.tsx. Rejected because it duplicates the battle-tested avatar clustering, relative time formatting, and navigation logic already encapsulated within ReportActionItemThread, introducing maintenance overhead and styling divergence from regular task and chat threads.

janiya2 avatar Oct 22 '26 17:10 janiya2

Proposal

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

When a support rep replies inside a support ticket, the ticket card in the Concierge chat looks exactly like it did before the reply. Customers cannot see a conversation is happening in the ticket, so they answer in the main Concierge chat and start an unrelated thread.

What is the root cause of that problem?

  1. The ticket card is only the action body. The replies row (avatars, count, last-reply time) is a separate footer, ReportActionItemThread, mounted by ReportActionItem only when shouldDisplayThreadReplies is true: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/ReportActionItem.tsx#L541 https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/ReportActionItem.tsx#L698-L708
  2. shouldDisplayThreadReplies ends with !isCreatedSupportTicketReportAction(reportAction), so for a ticket card it returns false even when the server has already populated childVisibleActionCount and childCommenterCount on that action: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/libs/ReportUtils.ts#L12443-L12446
  3. A ticket card is a plain ADD_COMMENT action with childType supportTicket, so it carries the same thread fields (childVisibleActionCount, childCommenterCount, childOldestFourAccountIDs) the footer already reads: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/libs/ReportActionsUtils.ts#L440-L442 https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/ReportActionItemThread.tsx#L60-L72
  4. The exclusion was added deliberately by 187e161410c ("fix(support): hide ticket preview reply counts") in PR #102561, the PR that shipped the ticket UI, with a test row pinning it. This issue reverses that decision, so the fix is to undo that one clause and flip that one row. https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/tests/unit/ReportUtilsTest.ts#L7412-L7433

The footer mount is the only consumer of shouldDisplayThreadReplies without its own ticket guard. Every other caller keeps one, so removing the clause cannot change them:

  • Reply in thread already returns false for tickets: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L542
  • Join thread has !isSupportTicketAction: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L866-L884
  • Leave thread has the same guard: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L939-L955
  • Edit stays blocked via canEditReportAction: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/libs/ReportUtils.ts#L6290
  • Inside the ticket, the parent action renders with isThreadReportParentAction = true, so no footer there; Search results keep && !isOnSearch (L541).

Tapping the footer is safe: it calls navigateToAndOpenChildReport, which for a non-expense child goes to SEARCH_REPORT in the Search context and REPORT_WITH_ID with backTo otherwise, the same two routes the card's own press uses via getReportRouteForCurrentContext. So the footer opens the ticket where the card does, in chat and in the Concierge panel: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/ReportActionItemThread.tsx#L79-L81 https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/libs/actions/Report/index.ts#L2963-L2974 https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/libs/Navigation/helpers/getReportRouteForCurrentContext.ts#L13-L25 https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/components/ReportActionItem/SupportTicketPreview.tsx#L82

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

Remove the support-ticket clause from shouldDisplayThreadReplies so a ticket card follows the same rule as a comment or a task: https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/libs/ReportUtils.ts#L12443-L12446

return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;

Then flip the SUPPORT_TICKET row of the shouldDisplayThreadReplies test table to true (it asserts false today, so CI fails without this); the canEditReportAction table keeps its false row.

Once the rep replies, hasReplies is true, the footer mounts under the card with the rep's avatar, count and last-reply time, and tapping it opens the ticket. No change to SupportTicketPreview, ReportActionItemThread, or the backend. A ticket with no replies keeps no footer, like any thread. A Concierge agent replying inside the ticket gets the same "processing" footer other threads get via the existing isAgentProcessingInThread term.

Regression safety: every other caller is listed above with its own guard, and isCreatedSupportTicketReportAction stays imported for canEditReportAction.

What alternative solutions did you explore? (Optional)

  • A second gate in ReportActionItem (shouldDisplayThreadReplies(...) || isCreatedSupportTicketReportAction(action) && childVisibleActionCount && childCommenterCount && !isThreadReportParentAction), helper untouched. Rejected: it re-implements hasReplies beside the helper that owns it, its premise that other callers rely on the helper's ticket exclusion is false (each has its own guard, links above), and it drops the isAgentProcessingInThread case.
  • A reply row inside SupportTicketPreview. Rejected: duplicates the footer's count, avatars, time and press wiring, and drifts from regular threads.

ahmdshrif avatar Oct 22 '26 17:10 ahmdshrif

Proposal

What is the root cause of that problem?

Two causes, and the second is what makes this more than a one-line change.

The gate. ReportActionItem already renders a replies-footer slot directly below whatever ActionContentRouter returns — for a ticket, SupportTicketPreview — so the row the issue asks for needs no new UI:

https://github.com/Expensify/App/blob/af65eec71382c77194e1b2ed0abe9794150100cb/src/pages/inbox/report/ReportActionItem.tsx#L698-L707

That slot is gated by shouldDisplayThreadReplies, whose trailing clause hard-excludes support-ticket parents:

https://github.com/Expensify/App/blob/af65eec71382c77194e1b2ed0abe9794150100cb/src/libs/ReportUtils.ts#L12610-L12612

For childType === supportTicket the gate returns false even once the rep's replies have set childVisibleActionCount/childCommenterCount on the Concierge action, so the customer gets a bare card.

The part that decides the fix. Dropping that clause on its own ships a second defect, because the footer is a pressable of its own and its press handler is not the card's. ReportActionItemThread presses into navigateToAndOpenChildReport:

https://github.com/Expensify/App/blob/af65eec71382c77194e1b2ed0abe9794150100cb/src/pages/inbox/report/ReportActionItemThread.tsx#L79-L82

navigateToAndOpenChildReport falls back to createChildReport whenever childReport is missing from Onyx, and with childReportID present that path merges a buildOptimisticChatReport object straight onto the ticket's own report key and never calls openReport:

https://github.com/Expensify/App/blob/af65eec71382c77194e1b2ed0abe9794150100cb/src/libs/actions/Report/index.ts#L3021-L3051

buildOptimisticChatReport writes type: CONST.REPORT.TYPE.CHAT:

https://github.com/Expensify/App/blob/af65eec71382c77194e1b2ed0abe9794150100cb/src/libs/ReportUtils.ts#L9434-L9437

isSupportTicket keys on exactly report?.type === CONST.REPORT.TYPE.SUPPORT_TICKET (src/libs/ReportUtils.ts#L1530-L1532), so after that merge the ticket opens as a plain chat: the Book a call header button (HeaderView.tsx:273), the survey/resolved footer (ReportActionsList.tsx:227, :272) and the offline-composer rule (ReportFooter.tsx:97) all stop matching, and the context-menu suppressions keyed on isSupportTicket(report) (ContextMenuActions.tsx:480, :861, :934) re-expose Reply in thread / Join thread inside the ticket.

That branch is reachable: the ticket report genuinely can be absent from Onyx, and the card is written for exactly that state, falling back to action.childReportID and action.childReportName:

https://github.com/Expensify/App/blob/af65eec71382c77194e1b2ed0abe9794150100cb/src/components/ReportActionItem/SupportTicketPreview.tsx#L49-L56

So whether the new row misbehaves depends on whether the ticket report happens to be hydrated when it is tapped: the card keeps working either way, while the row one line below it can quietly rewrite the report's type.

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

1. src/libs/ReportUtils.ts:12612 — drop the exclusion so the existing footer renders under the preview:

return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;

2. src/pages/inbox/report/ReportActionItemThread.tsx:79 — send support-ticket parents through the same navigation the card itself uses (SupportTicketPreview.tsx:82), instead of the child-report creation path:

onPress={() => {
    if (isCreatedSupportTicketReportAction(reportAction)) {
        Navigation.navigate(getReportRouteForCurrentContext({reportID: childReport?.reportID ?? reportAction.childReportID}));
        return;
    }
    const participantsPersonalDetails = getParticipantsPersonalDetails([currentUserAccountID, Number(reportAction.actorAccountID)], personalDetails);
    navigateToAndOpenChildReport(childReport, reportAction, report, currentUserAccountID, introSelected, participantsPersonalDetails, isSelfTourViewed, conciergeChat);
}}

Row and card then resolve to the identical route — including the Search/SEARCH_REPORT branch inside getReportRouteForCurrentContext, which matters for the reporter's flow of opening Concierge from the RHP.

3. tests/unit/ReportUtilsTest.ts:7412-7432 — flip the SUPPORT_TICKET row of the existing table to true and reword the assertion; the CHAT/TASK rows stay:

https://github.com/Expensify/App/blob/af65eec71382c77194e1b2ed0abe9794150100cb/tests/unit/ReportUtilsTest.ts#L7412-L7432

On what the removed clause was holding up: each context-menu consumer of shouldDisplayThreadReplies already carries its own support-ticket guard independently of the util — Reply in thread at line 542, Join/Leave thread via isSupportTicketAction at lines 871 and 944 plus the isSupportTicket(report) early returns above them — so the util clause is redundant there and those menus keep hiding:

https://github.com/Expensify/App/blob/af65eec71382c77194e1b2ed0abe9794150100cb/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L538-L545

The isThreadReportParentAction argument still suppresses the row on the parent action pinned to the top of the ticket itself, and isOnSearch in ReportActionItem.tsx:541 still keeps it out of Search previews. The row's MultiAccountAvatar renders childOldestFourAccountIDs, i.e. the support rep — the exact "a human is talking to you in here" signal the issue is after.

What alternative solutions did you explore? (Optional)

Rendering a bespoke reply line inside SupportTicketPreview. Rejected: it duplicates the footer the issue asks us to reuse, nests a pressable inside the card's own PressableWithoutFeedback, and would re-implement the childCommenterCount, MAX_THREAD_REPLIES_PREVIEW and datetimeToCalendarTime handling ReportActionItemThread already owns.

Gating only the ReportActionItem call site instead of the util. Rejected: the mount condition would restate hasReplies and isThreadReportParentAction next to the util that already computes them, and leaves step 2's press handler — the part that actually breaks — untouched.

Test branch: https://github.com/Expensify/App/compare/main...trasnake87:App:fix/104400

Regression test

tests/unit/ReportUtilsTest.ts, run with npx jest tests/unit/ReportUtilsTest.ts:

  • without the change: Tests: 1 failed, 1516 skipped, 6 passed, 1523 total
  • with the change: Tests: 1516 skipped, 7 passed, 1523 total

trasnake87 avatar Oct 22 '26 17:10 trasnake87

[Updated] What changed: the root cause is now traced to ReportActionItemThread, ReportActionItem, shouldDisplayThreadReplies, with the affected call sites listed.

ahmdshrif avatar Oct 22 '26 17:10 ahmdshrif

Proposal updated: added a test branch.

trasnake87 avatar Oct 22 '26 17:10 trasnake87

Proposal

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

Support ticket previews in the Concierge chat show no reply count, so customers can't tell the rep answered inside the ticket and keep typing in the main Concierge chat.

What is the root cause of that problem?

The replies row under any threaded action is ReportActionItemThread, and ReportActionItem mounts it only when shouldDisplayThreadReplies is true

https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/ReportActionItem.tsx#L698-L708

that helper ends with !isCreatedSupportTicketReportAction(reportAction), so for the ticket preview it returns false even when the ticket already has childVisibleActionCount and childCommenterCount

https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/libs/ReportUtils.ts#L12443-L12446

the ticket preview itself (SupportTicketPreview) has no replies UI, it is only the action body

https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L252-L260

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

Drop the support ticket clause so the ticket preview follows the same rule as comments and tasks

return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;

Join / Leave / Reply in thread keep their own ticket guards in ContextMenuActions, edit stays blocked by canEditReportAction, and inside the ticket the top is SupportTicketView, so nothing else changes.

Flip the SUPPORT_TICKET row of the existing test to true

https://github.com/Expensify/App/blob/2f6a76c58baaf468e3e93ca5f588b17672f59739/tests/unit/ReportUtilsTest.ts#L7412-L7433

What alternative solutions did you explore? (Optional)

Render a replies row inside SupportTicketPreview. It would duplicate the count, avatars, time and press handling that ReportActionItemThread already has, so I'd rather reuse the footer like the issue asks.

David-2002065 avatar Oct 22 '26 17:10 David-2002065

🚨 Edited by proposal-police: This proposal was edited at 2026-10-22 18:58:02 UTC.

Proposal

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

A support ticket preview in the Concierge chat looks the same after a support rep replies inside the ticket as it did before. There is no reply count, no replier avatar, and no last-reply time under the card, so the customer replies in the main Concierge composer and starts a new conversation with Concierge instead of continuing the one already happening in the ticket.

What is the root cause of that problem?

The replies row under a threaded message is ReportActionItemThread. ReportActionItem mounts it only when shouldDisplayThreadReplies is true, and search results stay excluded by !isOnSearch:

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/pages/inbox/report/ReportActionItem.tsx#L541

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/pages/inbox/report/ReportActionItem.tsx#L698-L708

shouldDisplayThreadReplies returns false for every support-ticket creation action, even when that action already has childVisibleActionCount and childCommenterCount. The last clause was added on purpose in 187e161410c ("fix(support): hide ticket preview reply counts", Jasper Huang, 2026-09-30), with a unit test that pins the footer off for childType === supportTicket. This issue reverses that decision.

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/ReportUtils.ts#L12443-L12446

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/tests/unit/ReportUtilsTest.ts#L7412-L7432

The ticket preview is an ADD_COMMENT whose childType is supportTicket, so it already carries the thread fields the footer reads. ActionContentRouter renders it as SupportTicketPreview, which draws only the checkbox, the rep avatar, the title, and the arrow. Task previews use the same helper and are not excluded, which is why a task with replies shows the row and a ticket with replies does not. The Concierge side panel mounts the same ReportScreen, so the missing row is the same bug there.

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/ReportActionsUtils.ts#L440-L442

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/pages/inbox/report/actionContents/ActionContentRouter.tsx#L252-L260

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/components/SidePanel/SidePanelReport/index.tsx#L22-L27

Dropping that clause on its own has a second defect, on web, mobile web, and native, because they share this code. The card opens the ticket with getReportRouteForCurrentContext and writes nothing. The footer calls navigateToAndOpenChildReport. When the ticket report is not in Onyx, that merges a buildOptimisticChatReport (type: chat, plus the parent chat's policyID, chatType, and a participant) onto the ticket's own key. The app already plans for a missing ticket: the card falls back to action.childReportID and action.childReportName, and isResolvedSupportTicket has a branch for a ticket that has not loaded.

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/components/ReportActionItem/SupportTicketPreview.tsx#L49-L56

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/components/ReportActionItem/SupportTicketPreview.tsx#L82

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/pages/inbox/report/ReportActionItemThread.tsx#L79-L82

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/actions/Report/index.ts#L2939-L2951

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/actions/Report/index.ts#L3049-L3051

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/ReportUtils.ts#L9268-L9269

OpenReport is a write, so offline it stays queued. Until the device reconnects, isSupportTicket is false: no SupportTicketView header, and the ticket composer, footer, and menu rules do not apply. Online, the same merge lasts for one round trip, and the server response does not have to clear extra merged fields such as that participant.

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/actions/Report/index.ts#L2148

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/ReportUtils.ts#L1530-L1532

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/tests/unit/ReportUtilsTest.ts#L28894-L28904

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

  1. In shouldDisplayThreadReplies, drop the support-ticket clause. Keep hasReplies, the agent-processing fallback, and !isThreadReportParentAction. isCreatedSupportTicketReportAction stays imported, because canEditReportAction still uses it and the card stays non-editable.
-    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction && !isCreatedSupportTicketReportAction(reportAction);
+    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/ReportUtils.ts#L12445

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/libs/ReportUtils.ts#L6290

Once the rep replies, the existing footer renders under the card: avatar, count, last-reply time. A ticket with no replies keeps no footer. A Concierge agent still replying in the ticket gets the same processing footer other threads get. Flip the pinned test row from false to true, and add the case where the ticket parent is shown inside its own thread.

-            [CONST.REPORT.TYPE.SUPPORT_TICKET, false],
+            [CONST.REPORT.TYPE.SUPPORT_TICKET, true],
  1. In ReportActionItemThread, send a support-ticket press through the same route the card uses, and leave every other thread on navigateToAndOpenChildReport. The route is SEARCH_REPORT inside Search and REPORT_WITH_ID with backTo otherwise, so it matches the card in the inbox, the side panel, and narrow layouts. Long-press and right-click still open the existing menu.
 onPress={() => {
+    if (isCreatedSupportTicketReportAction(reportAction)) {
+        Navigation.navigate(getReportRouteForCurrentContext({reportID: childReport?.reportID ?? reportAction.childReportID}));
+        return;
+    }
     const participantsPersonalDetails = getParticipantsPersonalDetails([currentUserAccountID, Number(reportAction.actorAccountID)], personalDetails);
     navigateToAndOpenChildReport(childReport, reportAction, report, currentUserAccountID, introSelected, participantsPersonalDetails, isSelfTourViewed, conciergeChat);
 }}

Reply in thread, Join thread, and Leave thread stay hidden. They were removed when tickets shipped (80bd84992a0, "feat(support): show support tickets in app") and ContextMenuActionsSupportTicketTest still requires that. Reply in thread would only open the same report the arrow and the new row already open. Join and Leave would let the customer mute or leave their own support conversation. Inside the ticket, the created action renders SupportTicketView, so no reply row appears there. Search keeps && !isOnSearch.

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L542

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L861-L878

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L934-L950

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/tests/unit/ContextMenuActionsSupportTicketTest.ts#L61-L71

https://github.com/Expensify/App/blob/d89309bc04308b72dc5592c6a600219db9c3f2bd/src/pages/inbox/report/ReportActionItemContentCreated.tsx#L148-L158

npx jest tests/ui/ReportActionItemThreadTest.tsx tests/unit/ContextMenuActionsSupportTicketTest.ts tests/unit/ReportUtilsTest.ts -t "shouldDisplayThreadReplies|ReportActionItemThread|ContextMenuActions support tickets" passes: 13 passed, 1515 skipped.

What alternative solutions did you explore? (Optional)

  • A reply row built inside SupportTicketPreview. It would copy the count, avatars, last-reply time, and press handling that ReportActionItemThread already owns, and it would nest a second pressable inside the card's PressableWithoutFeedback.
  • A second gate in ReportActionItem (shouldDisplayThreadReplies || isCreatedSupportTicketReportAction(action) && child counts), leaving the helper untouched. That repeats hasReplies next to the function that owns it, and it drops the isAgentProcessingInThread case. Reply in thread, Join thread, and Leave thread each have their own ticket guard, so other callers do not depend on the helper's exclusion.
  • Adding Reply in thread, Join thread, or Leave thread to the ticket card menu. The arrow and the replies row already open the ticket, on every platform. Join and Leave change notification preference, which would let the customer mute the support conversation.

What specific scenarios should we cover in automated tests?

  • A support-ticket parent with childVisibleActionCount > 0 and childCommenterCount > 0, shown in its original conversation, shows the replies footer.
  • The same parent with both counts at 0, and no agent processing, hides the footer.
  • The same parent shown as the thread's own parent action (isThreadReportParentAction === true) hides the footer even when it has replies.
  • A chat parent and a task parent with replies still show the footer.
  • An action with zeroed counts and isAgentProcessingInThread === true still shows the footer, including when its childType is a support ticket.
  • canEditReportAction still returns false for a support-ticket creation action.
  • Pressing the replies row of a ticket whose report is not in Onyx navigates to that ticket and leaves report_<ticketReportID> unset.
  • Pressing the replies row of a normal comment still goes through navigateToAndOpenChildReport.
  • Reply in thread, Join thread, and Leave thread stay hidden for a support ticket and for its preview.

POW

Image

Comparison Branch

https://github.com/Expensify/App/compare/main...neerajbachani:App:fix/104400-support-ticket-thread-replies

neerajbachani avatar Oct 22 '26 18:10 neerajbachani

Proposal

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

In Concierge chat, when a support ticket thread receives replies from a support representative, the support ticket preview card in the parent conversation shows no reply count or thread activity indicator. Customers are unaware that the support rep has responded inside the ticket and continue typing into the main Concierge chat instead, inadvertently starting unintended new threads.

What is the root cause of that problem?

The reply footer under report action items is rendered by ReportActionItemThread inside ReportActionItem.tsx, controlled by the helper shouldDisplayThreadReplies: https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L12443-L12446

function shouldDisplayThreadReplies(reportAction: OnyxInputOrEntry<ReportAction>, isThreadReportParentAction: boolean, isAgentProcessingInThread = false): boolean {
    const hasReplies = (reportAction?.childVisibleActionCount ?? 0) > 0 && !!reportAction?.childCommenterCount;
    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction && !isCreatedSupportTicketReportAction(reportAction);
}

The function explicitly appends && !isCreatedSupportTicketReportAction(reportAction), deliberately suppressing the thread replies footer for all support ticket creation actions. Even when the ticket thread has active replies (childVisibleActionCount > 0 and childCommenterCount > 0), the preview card suppresses the replies footer entirely.

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

  1. Remove the support ticket exclusion from shouldDisplayThreadReplies in src/libs/ReportUtils.ts: Update shouldDisplayThreadReplies to evaluate support ticket creation actions using standard thread visibility criteria:

    function shouldDisplayThreadReplies(reportAction: OnyxInputOrEntry<ReportAction>, isThreadReportParentAction: boolean, isAgentProcessingInThread = false): boolean {
        const hasReplies = (reportAction?.childVisibleActionCount ?? 0) > 0 && !!reportAction?.childCommenterCount;
        return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;
    }
    
  2. Verify Context Menu safety: In src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx, actions like "Reply in thread", "Join thread", and "Leave thread" already contain explicit, independent guards check:

    • Line 542: !isSupportTicket(report) && !isCreatedSupportTicketReportAction(reportAction)
    • Line 871 / 883: isSupportTicketAction = isCreatedSupportTicketReportAction(reportAction) guarding Join thread.
    • Line 944 / 954: isSupportTicketAction = isCreatedSupportTicketReportAction(reportAction) guarding Leave thread. Therefore, removing the exclusion from shouldDisplayThreadReplies will not inadvertently enable thread context menu actions on the support ticket preview.
  3. User Flow & Navigation: With this change, ReportActionItemThread automatically renders below the support ticket preview card when the ticket has responses (displaying the reply count, respondent avatars, and the timestamp of the last message). Tapping the thread reply row triggers navigateToAndOpenChildReport, smoothly navigating the user directly into the active support ticket conversation.

What alternative solutions did you explore? (Optional)

  • Adding custom reply counts directly inside SupportTicketPreview.tsx: Rejected because it would duplicate existing logic in ReportActionItemThread (avatar rendering, layout, press animations, localization strings), leading to UI drift and redundant maintenance. Reusing ReportActionItemThread keeps the UI pattern consistent across all threads in the application.

What specific scenarios should we cover in automated tests?

In tests/unit/ReportUtilsTest.ts:

  1. shouldDisplayThreadReplies returns true when a support ticket report action has childVisibleActionCount > 0 and childCommenterCount > 0 (not a parent action).
  2. shouldDisplayThreadReplies returns false when a support ticket report action has childVisibleActionCount === 0.
  3. shouldDisplayThreadReplies returns false when isThreadReportParentAction === true, even for support tickets with replies.
  4. shouldDisplayThreadReplies returns true when isAgentProcessingInThread === true on a support ticket action.

Anthgg avatar Oct 22 '26 18:10 Anthgg

Proposal

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

In Concierge chat, when a support ticket thread receives replies from a support representative, the support ticket preview card in the parent conversation shows no reply count or thread activity indicator. Customers are unaware that the support rep has responded inside the ticket and continue typing into the main Concierge chat instead, inadvertently starting unintended new threads.

What is the root cause of that problem?

The reply footer under report action items is rendered by ReportActionItemThread inside ReportActionItem.tsx, controlled by the helper shouldDisplayThreadReplies: https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L12443-L12446

function shouldDisplayThreadReplies(reportAction: OnyxInputOrEntry<ReportAction>, isThreadReportParentAction: boolean, isAgentProcessingInThread = false): boolean {
    const hasReplies = (reportAction?.childVisibleActionCount ?? 0) > 0 && !!reportAction?.childCommenterCount;
    return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction && !isCreatedSupportTicketReportAction(reportAction);
}

The function explicitly appends && !isCreatedSupportTicketReportAction(reportAction), deliberately suppressing the thread replies footer for all support ticket creation actions. Even when the ticket thread has active replies (childVisibleActionCount > 0 and childCommenterCount > 0), the preview card suppresses the replies footer entirely.

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

  1. Remove the support ticket exclusion from shouldDisplayThreadReplies in src/libs/ReportUtils.ts: Update shouldDisplayThreadReplies to evaluate support ticket creation actions using standard thread visibility criteria:

    function shouldDisplayThreadReplies(reportAction: OnyxInputOrEntry<ReportAction>, isThreadReportParentAction: boolean, isAgentProcessingInThread = false): boolean {
        const hasReplies = (reportAction?.childVisibleActionCount ?? 0) > 0 && !!reportAction?.childCommenterCount;
        return (hasReplies || isAgentProcessingInThread) && !isThreadReportParentAction;
    }
    
  2. Verify Context Menu safety: In src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx, actions like "Reply in thread", "Join thread", and "Leave thread" already contain explicit, independent guards check:

    • Line 542: !isSupportTicket(report) && !isCreatedSupportTicketReportAction(reportAction)
    • Line 871 / 883: isSupportTicketAction = isCreatedSupportTicketReportAction(reportAction) guarding Join thread.
    • Line 944 / 954: isSupportTicketAction = isCreatedSupportTicketReportAction(reportAction) guarding Leave thread. Therefore, removing the exclusion from shouldDisplayThreadReplies will not inadvertently enable thread context menu actions on the support ticket preview.
  3. User Flow & Navigation: With this change, ReportActionItemThread automatically renders below the support ticket preview card when the ticket has responses (displaying the reply count, respondent avatars, and the timestamp of the last message). Tapping the thread reply row triggers navigateToAndOpenChildReport, smoothly navigating the user directly into the active support ticket conversation.

What alternative solutions did you explore? (Optional)

  • Adding custom reply counts directly inside SupportTicketPreview.tsx: Rejected because it would duplicate existing logic in ReportActionItemThread (avatar rendering, layout, press animations, localization strings), leading to UI drift and redundant maintenance. Reusing ReportActionItemThread keeps the UI pattern consistent across all threads in the application.

What specific scenarios should we cover in automated tests?

In tests/unit/ReportUtilsTest.ts:

  1. shouldDisplayThreadReplies returns true when a support ticket report action has childVisibleActionCount > 0 and childCommenterCount > 0 (not a parent action).
  2. shouldDisplayThreadReplies returns false when a support ticket report action has childVisibleActionCount === 0.
  3. shouldDisplayThreadReplies returns false when isThreadReportParentAction === true, even for support tickets with replies.
  4. shouldDisplayThreadReplies returns true when isAgentProcessingInThread === true on a support ticket action.

RajGahoi avatar Oct 22 '26 19:10 RajGahoi

Proposal

What is the root cause of that problem?

The support ticket preview has thread replies, but shouldDisplayThreadReplies in src/libs/ReportUtils.ts explicitly excludes support-ticket creation actions. This prevents ReportActionItem from showing the existing reply-count row, even when the ticket has replies.

The reply row also uses a generic navigation path. If the ticket report is not loaded yet, we need to avoid opening it as a newly created chat instead of the existing support ticket.

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

  1. Remove the support-ticket exclusion from shouldDisplayThreadReplies so the existing ReportActionItemThread row displays the reply count, avatars, and last-reply time below the ticket preview. Keep the current checks that prevent showing it in the wrong context.
  2. Make tapping that row use the same support-ticket navigation as SupportTicketPreview, including when the ticket data is not yet loaded.
  3. Update the existing unit tests and cover tickets with and without replies, navigation with and without loaded ticket data, and unchanged behavior for regular threads. Verify the result in Concierge chat and the side panel.

What alternative solutions did you explore? (Optional)

Adding a separate reply counter inside SupportTicketPreview would duplicate the existing UI and navigation, so I would reuse the shared reply row instead.

krsnak avatar Oct 22 '26 19:10 krsnak

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

github-actions[bot] avatar Oct 22 '26 19:10 github-actions[bot]