Skip to content

Commit 6fed0c3

Browse files
committed
Restore PR additions lost during merge resolution
The merge resolution at 84216cc preferred main's version for several files where the PR-tip had its own additions, leaving dangling references to symbols that no longer existed: - ONYXKEYS.CONCIERGE_THINKING_KICKOFF — restore the key + its boolean type mapping. AgentZeroStatusContext reads it via useOnyx; without the key, TypeScript and Jest both blew up (TS2339 + runtime undefined.startsWith). - Report.setConciergeThinkingKickoff / clearConciergeThinkingKickoff — restore both functions and re-export them. AgentZeroStatusContext imports the clear helper; useAskConcierge imports the set helper. - useAskConcierge.tsx — restore the setConciergeThinkingKickoff() call before addComment(), drop the empty-query early-return so a blank query still triggers the indicator-kickoff side effect. Also drop the now-unused @typescript-eslint/naming-convention disable directive in AgentZeroStatusContextTest.ts (lint flagged it as redundant).
1 parent 84216cc commit 6fed0c3

4 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/ONYXKEYS.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,9 @@ const ONYXKEYS = {
603603
/** Company cards custom names */
604604
NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES: 'nvp_expensify_ccCustomNames',
605605

606+
/** Whether to kick off the "Concierge is thinking" indicator when AgentZeroStatusGate mounts */
607+
CONCIERGE_THINKING_KICKOFF: 'conciergeThinkingKickoff',
608+
606609
/** The user's Concierge reportID */
607610
CONCIERGE_REPORT_ID: 'conciergeReportID',
608611

@@ -1528,6 +1531,7 @@ type OnyxValuesMapping = {
15281531
[ONYXKEYS.LAST_ROUTE]: string;
15291532
[ONYXKEYS.IS_USING_IMPORTED_STATE]: boolean;
15301533
[ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES]: Record<string, string>;
1534+
[ONYXKEYS.CONCIERGE_THINKING_KICKOFF]: boolean;
15311535
[ONYXKEYS.CONCIERGE_REPORT_ID]: string;
15321536
[ONYXKEYS.SELF_DM_REPORT_ID]: string;
15331537
[ONYXKEYS.SHARE_UNKNOWN_USER_DETAILS]: Participant;

src/components/Search/SearchRouter/useAskConcierge.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import useOnyx from '@hooks/useOnyx';
44
import useOpenConciergeAnywhere from '@hooks/useOpenConciergeAnywhere';
55
import useSidePanelReportID from '@hooks/useSidePanelReportID';
66
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
7-
import {addComment} from '@userActions/Report';
7+
import {addComment, setConciergeThinkingKickoff} from '@userActions/Report';
88
import CONST from '@src/CONST';
99
import ONYXKEYS from '@src/ONYXKEYS';
1010

@@ -23,15 +23,15 @@ function useAskConcierge() {
2323

2424
return (searchQuery: string) => {
2525
openConciergeAnywhere();
26-
const trimmedQuery = searchQuery.trim();
27-
if (!trimmedQuery || !targetReport || !targetReportID) {
26+
if (!targetReport || !targetReportID) {
2827
return;
2928
}
29+
setConciergeThinkingKickoff();
3030
addComment({
3131
report: targetReport,
3232
notifyReportID: targetReportID,
3333
ancestors: [],
34-
text: trimmedQuery,
34+
text: searchQuery,
3535
timezoneParam: timezone ?? CONST.DEFAULT_TIME_ZONE,
3636
currentUserAccountID,
3737
shouldPlaySound: true,

src/libs/actions/Report/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7659,6 +7659,14 @@ function setOptimisticTransactionThread(reportID?: string, parentReportID?: stri
76597659
});
76607660
}
76617661

7662+
function setConciergeThinkingKickoff() {
7663+
Onyx.set(ONYXKEYS.CONCIERGE_THINKING_KICKOFF, true);
7664+
}
7665+
7666+
function clearConciergeThinkingKickoff() {
7667+
Onyx.set(ONYXKEYS.CONCIERGE_THINKING_KICKOFF, null);
7668+
}
7669+
76627670
export type {Video, GuidedSetupData, TaskForParameters, IntroSelected, OpenReportActionParams, ParticipantInfo};
76637671

76647672
export {
@@ -7741,6 +7749,8 @@ export {
77417749
subscribeToNewActionEvent,
77427750
subscribeToReportLeavingEvents,
77437751
clearAgentZeroProcessingIndicator,
7752+
clearConciergeThinkingKickoff,
7753+
setConciergeThinkingKickoff,
77447754
subscribeToReportReasoningEvents,
77457755
unsubscribeFromReportReasoningChannel,
77467756
subscribeToReportTypingEvents,

tests/unit/AgentZeroStatusContextTest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const mockTranslate = jest.fn((key: string) => {
2121
});
2222

2323
jest.mock('@hooks/useLocalize', () => ({
24-
// eslint-disable-next-line @typescript-eslint/naming-convention
2524
__esModule: true,
2625
default: () => ({
2726
translate: mockTranslate,

0 commit comments

Comments
 (0)