Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/AvatarWithDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ function AvatarWithDisplayName({
}

if (isChatThread(report)) {
if (report?.parentReportID === conciergeReportID) {
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.PROFILE.getRoute(CONST.ACCOUNT_ID.CONCIERGE)));
return;
}

// In an ideal situation account ID won't be 0
if (actorAccountID.current && actorAccountID.current > 0) {
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.PROFILE.getRoute(actorAccountID.current)));
Expand Down
3 changes: 3 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3884,6 +3884,9 @@ function getIconsForChatThread(
if (!report?.parentReportID || !report?.parentReportActionID) {
return [];
}
if (report.parentReportID === conciergeReportIDOnyxConnect) {
return getIconsForParticipants([CONST.ACCOUNT_ID.CONCIERGE], personalDetails);
}
const parentReportAction = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`]?.[report.parentReportActionID];
const actorAccountID = getReportActionActorAccountID(parentReportAction, report as OnyxEntry<Report>, report as OnyxEntry<Report>);
const actorDetails = actorAccountID ? personalDetails?.[actorAccountID] : undefined;
Expand Down
17 changes: 16 additions & 1 deletion src/libs/actions/Report/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ type AddAttachmentWithCommentParams = {
delegateAccountID: number | undefined;
sidePanelContext?: SidePanelContext;
conciergeReportID: string | undefined;
conciergeThreadReportID?: string;
};

type MergeReportsProps = {
Expand Down Expand Up @@ -1285,6 +1286,7 @@ function addAttachmentWithComment({
delegateAccountID,
sidePanelContext,
conciergeReportID,
conciergeThreadReportID,
}: AddAttachmentWithCommentParams) {
if (!report?.reportID) {
return;
Expand All @@ -1311,13 +1313,26 @@ function addAttachmentWithComment({
delegateAccountID,
sidePanelContext,
conciergeReportID,
conciergeThreadReportID,
});
handlePlaySound();
return;
}

// Multiple attachments - first: combine text + first attachment as a single action
addActions({report, notifyReportID, ancestors, timezoneParam: timezone, currentUserAccountID, text, file: attachments?.at(0), isInSidePanel, delegateAccountID, conciergeReportID});
addActions({
report,
notifyReportID,
ancestors,
timezoneParam: timezone,
currentUserAccountID,
text,
file: attachments?.at(0),
isInSidePanel,
delegateAccountID,
conciergeReportID,
conciergeThreadReportID: attachments.length === 1 ? conciergeThreadReportID : undefined,
});

// Remaining: attachment-only actions (no text duplication)
for (let i = 1; i < attachments?.length; i += 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ function useComposerSubmit(reportID: string) {
clearAgentZeroProcessingIndicator(reportID, CONST.ACCOUNT_ID.CONCIERGE);
}

// Concierge answers each question in its own thread. The side panel renders its own pinned report,
// so it stays in the DM rather than being sent to a thread it cannot show.
const shouldRespondInThread = reportID === conciergeReportID && !isInSidePanel && isBetaEnabled(CONST.BETAS.CONCIERGE_RESPOND_IN_THREAD);

if (attachmentFileRef.current) {
const attachmentCount = Array.isArray(attachmentFileRef.current) ? attachmentFileRef.current.length : 1;
addAttachmentWithComment({
report: targetReport,
notifyReportID: reportID,
Expand All @@ -102,6 +107,9 @@ function useComposerSubmit(reportID: string) {
delegateAccountID,
sidePanelContext,
conciergeReportID,

// A send with several attachments posts one message per attachment, so it stays in the DM.
conciergeThreadReportID: shouldRespondInThread && attachmentCount === 1 ? generateReportID() : undefined,
});
attachmentFileRef.current = null;
return;
Expand Down Expand Up @@ -197,10 +205,7 @@ function useComposerSubmit(reportID: string) {
reportActionID: optimisticReportActionID,
delegateAccountID,
conciergeReportID,

// Concierge answers each question in its own thread. The side panel renders its own pinned report,
// so it stays in the DM rather than being sent to a thread it cannot show.
conciergeThreadReportID: reportID === conciergeReportID && !isInSidePanel && isBetaEnabled(CONST.BETAS.CONCIERGE_RESPOND_IN_THREAD) ? generateReportID() : undefined,
conciergeThreadReportID: shouldRespondInThread ? generateReportID() : undefined,
});
};

Expand Down
Loading