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
4 changes: 4 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: 'Emoji',
collapse: 'Einklappen',
expand: 'Erweitern',
askConciergeToCreate: 'Bitten Sie Concierge AI, eine Ausgabe zu erstellen ...',
askConciergeToUpdate: 'Bitte Concierge AI bitten, eine Ausgabe zu aktualisieren...',
askConciergeToCorrect: 'Bitten Sie Concierge AI, eine Ausgabe zu korrigieren...',
addColleagueWithMention: 'Füge eine:n Kolleg:in mit einer „@“-Erwähnung hinzu …',
},
reportActionContextMenu: {
copyMessage: 'Nachricht kopieren',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,10 @@ const translations = {
addAttachment: 'Add attachment',
writeSomething: 'Write something...',
blockedFromConcierge: 'Communication is barred',
askConciergeToCreate: 'Ask Concierge AI to create an expense...',
askConciergeToUpdate: 'Ask Concierge AI to update an expense...',
askConciergeToCorrect: 'Ask Concierge AI to correct an expense...',
addColleagueWithMention: 'Add a colleague with an "@" mention...',
fileUploadFailed: 'Upload failed. File is not supported.',
localTime: ({user, time}: LocalTimeParams) => `It's ${time} for ${user}`,
edited: '(edited)',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: 'Emoji',
collapse: 'Colapsar',
expand: 'Expandir',
askConciergeToCreate: 'Pídele a Concierge AI que cree un gasto...',
askConciergeToUpdate: 'Pídele a Concierge AI que actualice un gasto...',
askConciergeToCorrect: 'Pídele a Concierge AI que corrija un gasto...',
addColleagueWithMention: 'Añade a un colega con una mención "@"...',
},
reportActionContextMenu: {
copyMessage: 'Copiar mensaje',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: 'Emoji',
collapse: 'Réduire',
expand: 'Développer',
askConciergeToCreate: 'Demander à Concierge AI de créer une dépense...',
askConciergeToUpdate: 'Demander à Concierge AI de mettre à jour une dépense...',
askConciergeToCorrect: 'Demander à Concierge AI de corriger une dépense...',
addColleagueWithMention: 'Ajoutez un collègue avec une mention « @ »...',
},
reportActionContextMenu: {
copyMessage: 'Copier le message',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: 'Emoji',
collapse: 'Comprimi',
expand: 'Espandi',
askConciergeToCreate: 'Chiedi a Concierge AI di creare una spesa...',
askConciergeToUpdate: 'Chiedi a Concierge AI di aggiornare una spesa...',
askConciergeToCorrect: 'Chiedi a Concierge AI di correggere una spesa...',
addColleagueWithMention: 'Aggiungi un collega con una menzione "@"...',
},
reportActionContextMenu: {
copyMessage: 'Copia messaggio',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: '絵文字',
collapse: '折りたたむ',
expand: '展開',
askConciergeToCreate: 'Concierge AI に経費を作成するよう依頼…',
askConciergeToUpdate: 'Concierge AI に経費の更新を依頼する…',
askConciergeToCorrect: 'Concierge AI に経費の修正を依頼する…',
addColleagueWithMention: '「@」メンションで同僚を追加…',
},
reportActionContextMenu: {
copyMessage: 'メッセージをコピー',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: 'Emoji',
collapse: 'Samenvouwen',
expand: 'Uitvouwen',
askConciergeToCreate: 'Vraag Concierge AI om een uitgave aan te maken...',
askConciergeToUpdate: 'Vraag Concierge AI om een uitgave bij te werken...',
askConciergeToCorrect: 'Vraag Concierge AI om een uitgave te corrigeren...',
addColleagueWithMention: 'Voeg een collega toe met een “@”-vermelding...',
},
reportActionContextMenu: {
copyMessage: 'Bericht kopiëren',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: 'Emoji',
collapse: 'Zwiń',
expand: 'Rozwiń',
askConciergeToCreate: 'Poproś Concierge AI o utworzenie wydatku…',
askConciergeToUpdate: 'Poproś Concierge AI o zaktualizowanie wydatku...',
askConciergeToCorrect: 'Poproś Concierge AI o skorygowanie wydatku...',
addColleagueWithMention: 'Dodaj współpracownika, wspominając go za pomocą „@”…',
},
reportActionContextMenu: {
copyMessage: 'Kopiuj wiadomość',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: 'Emoji',
collapse: 'Recolher',
expand: 'Expandir',
askConciergeToCreate: 'Peça para o Concierge AI criar uma despesa...',
askConciergeToUpdate: 'Peça ao Concierge AI para atualizar uma despesa...',
askConciergeToCorrect: 'Peça à Concierge AI para corrigir uma despesa...',
addColleagueWithMention: 'Adicione um colega com uma menção "@"...',
},
reportActionContextMenu: {
copyMessage: 'Copiar mensagem',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,10 @@ const translations: TranslationDeepObject<typeof en> = {
emoji: '表情符号',
collapse: '折叠',
expand: '展开',
askConciergeToCreate: '让 Concierge AI 创建一笔报销…',
askConciergeToUpdate: '让 Concierge AI 更新一笔报销…',
askConciergeToCorrect: '让 Concierge AI 更正一笔报销…',
addColleagueWithMention: '使用“@”提及来添加同事…',
},
reportActionContextMenu: {
copyMessage: '复制消息',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import DualDropZone from '@components/DropZone/DualDropZone';
import EmojiPickerButton from '@components/EmojiPicker/EmojiPickerButton';
import ExceededCommentLength from '@components/ExceededCommentLength';
import ImportedStateIndicator from '@components/ImportedStateIndicator';
import type {LocalizedTranslate} from '@components/LocaleContextProvider';
import type {Mention} from '@components/MentionSuggestions';
import OfflineIndicator from '@components/OfflineIndicator';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
Expand Down Expand Up @@ -52,6 +53,7 @@ import {
isConciergeChatReport,
isGroupChat,
isInvoiceReport,
isMoneyRequestReport,
isReportApproved,
isReportTransactionThread,
isSettled,
Expand Down Expand Up @@ -121,6 +123,18 @@ const shouldFocusInputOnScreenFocus = canFocusInputOnScreenFocus();

const willBlurTextInputOnTapOutside = willBlurTextInputOnTapOutsideFunc();

/**
* Returns an array of AI-aware placeholders for expense threads
*/
function getAIPlaceholders(translate: LocalizedTranslate): string[] {
return [
translate('reportActionCompose.askConciergeToCreate'),
translate('reportActionCompose.askConciergeToUpdate'),
translate('reportActionCompose.askConciergeToCorrect'),
translate('reportActionCompose.addColleagueWithMention'),
];
}

// eslint-disable-next-line import/no-mutable-exports
let onSubmitAction = noop;

Expand Down Expand Up @@ -176,6 +190,8 @@ function ReportActionCompose({
return !draftComment || !!draftComment.match(CONST.REGEX.EMPTY_COMMENT);
});

const [randomPlaceholderIndex] = useState(() => Math.floor(Math.random() * 4));

/**
* Updates the visibility state of the menu
*/
Expand Down Expand Up @@ -247,13 +263,24 @@ function ReportActionCompose({
return !isRoomOrGroupChat && (canModifyReceipt || hasMoneyRequestOptions) && !isInvoiceReport(report);
}, [shouldAddOrReplaceReceipt, report, reportParticipantIDs, policy, isReportArchived, isRestrictedToPreferredPolicy]);

// Check if this is an expense-related report (IOU, expense report, or transaction thread)
const isExpenseRelatedReport = useMemo(() => isTransactionThreadView || isMoneyRequestReport(report), [isTransactionThreadView, report]);

// Placeholder to display in the chat input.
const inputPlaceholder = useMemo(() => {
if (includesConcierge && userBlockedFromConcierge) {
return translate('reportActionCompose.blockedFromConcierge');
}

// Show AI-aware placeholder for expense-related reports where user can write
// to encourage using Concierge AI for expense management
if (isExpenseRelatedReport && canUserPerformWriteAction) {
const placeholders = getAIPlaceholders(translate);
return placeholders.at(randomPlaceholderIndex) ?? placeholders.at(0) ?? '';
}

return translate('reportActionCompose.writeSomething');
}, [includesConcierge, translate, userBlockedFromConcierge]);
}, [includesConcierge, translate, userBlockedFromConcierge, isExpenseRelatedReport, canUserPerformWriteAction, randomPlaceholderIndex]);

const {displayLabel: agentZeroDisplayLabel, kickoffWaitingIndicator} = useAgentZeroStatusIndicator(reportID, isConciergeChat);

Expand Down
Loading