Add confirmation modal after creating first agent rule#93466
Conversation
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
b1741fe to
11ea76d
Compare
|
@shawnborton Implementation:
|
…navigation Updated the agent creation confirmation modal to include HTML rendering for the description, allowing for clickable links. This change improves user experience by providing direct navigation to the agent settings. Additionally, the title of the modal has been updated for consistency across multiple languages.
|
@QichenZhu Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index 11ef133d59d..a041633ace3 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -7401,9 +7401,9 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
describeRuleTitle: 'Beschreiben Sie Ihre Regel',
describeRuleSubtitle: 'Beschreiben Sie Ihre Regel und Concierge erstellt sie',
disclaimer: 'KI-Agenten können Fehler machen.',
- agentCreatedTitle: 'RuleBot wurde zu Ihrem Arbeitsbereich hinzugefügt!',
+ agentCreatedTitle: 'RuleBot wurde zu Ihrem Workspace hinzugefügt!',
agentCreatedDescription: (agentsRoute: string) =>
- `Um Ihre Agent-Regeln durchzusetzen, haben wir einen Agenten für Sie erstellt und ihn als Administrator zu Ihrem Arbeitsbereich hinzugefügt.<br><br>Bearbeiten Sie die Details Ihres Agenten unter <a href="${agentsRoute}">Konto > Agenten</a>.`,
+ `Um Ihre Agentenregeln durchzusetzen, haben wir einen Agenten für Sie erstellt und ihn als Admin zu Ihrem Workspace hinzugefügt.<br><br>Bearbeiten Sie die Details Ihres Agenten unter <a href="${agentsRoute}">Konto > Agenten</a>.`,
},
},
planTypePage: {
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 73447e6497f..b5bc72fcd6d 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1753,7 +1753,6 @@ const translations: TranslationDeepObject<typeof en> = {
}
},
[CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_MARK_AS_DONE]: (actor, actorType, _eta, _etaType) => {
- // eslint-disable-next-line default-case
switch (actorType) {
case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
return `Esperando a que <strong>tú</strong> lo marques como listo.`;
@@ -7299,7 +7298,7 @@ ${amount} para ${merchant} - ${date}`,
disclaimer: 'Los agentes de IA pueden cometer errores.',
agentCreatedTitle: '¡RuleBot se ha añadido a tu espacio de trabajo!',
agentCreatedDescription: (agentsRoute: string) =>
- `Para aplicar tus reglas de agente, hemos creado un agente para ti y lo hemos añadido como administrador de tu espacio de trabajo.<br><br>Edita los datos de tu agente en <a href="${agentsRoute}">Cuenta > Agentes</a>.`,
+ `Para aplicar tus reglas de agente, hemos creado un agente para ti y lo hemos añadido como administrador a tu espacio de trabajo.<br><br>Edita los detalles de tu agente en <a href="${agentsRoute}">Cuenta > Agentes</a>.`,
},
},
emptyDomain: {
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index c986383b271..bcb4ec7ea29 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1,6 +1,7 @@
/**
* _____ __ __
* / ___/__ ___ ___ _______ _/ /____ ___/ /
+ * / (_ / -_) _ \/ -_) __/ _ \`/ __/ -_) _ /
* \___/\__/_//_/\__/_/ \_,_/\__/\__/\_,_/
*
* This file was automatically generated. Please consider these alternatives before manually editing it:
@@ -862,7 +863,7 @@ const translations: TranslationDeepObject<typeof en> = {
beginningOfChatHistory: (users: string) => `Cette discussion est avec ${users}.`,
beginningOfChatHistoryPolicyExpenseChat: (workspaceName: string, submitterDisplayName: string) =>
`C’est ici que <strong>${submitterDisplayName}</strong> soumettra des dépenses à <strong>${workspaceName}</strong>. Utilisez simplement le bouton +.`,
- beginningOfChatHistoryPolicyExpenseChatTrack: 'C\u2019est ici que vous suivrez vos dépenses',
+ beginningOfChatHistoryPolicyExpenseChatTrack: 'C’est ici que vous suivrez vos dépenses',
beginningOfChatHistorySelfDM: 'Ceci est votre espace personnel. Utilisez-le pour vos notes, tâches, brouillons et rappels.',
beginningOfChatHistorySystemDM: 'Bienvenue ! Procédons à la configuration.',
chatWithAccountManager: 'Discutez avec votre gestionnaire de compte ici',
@@ -7427,9 +7428,9 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
describeRuleTitle: 'Décrivez votre règle',
describeRuleSubtitle: 'Décrivez votre règle et Concierge la créera',
disclaimer: 'Les agents IA peuvent faire des erreurs.',
- agentCreatedTitle: 'RuleBot a été ajouté à votre espace de travail !',
+ agentCreatedTitle: 'RuleBot a été ajouté à votre espace de travail !',
agentCreatedDescription: (agentsRoute: string) =>
- `Pour appliquer vos règles d’agent, nous avons créé un agent pour vous et l’avons ajouté comme administrateur de votre espace de travail.<br><br>Modifiez les détails de votre agent dans <a href="${agentsRoute}">Compte > Agents</a>.`,
+ `Pour appliquer vos règles d’agent, nous avons créé un agent pour vous et l’avons ajouté en tant qu’administrateur à votre espace de travail.<br><br>Modifiez les détails de votre agent dans <a href="${agentsRoute}">Compte > Agents</a>.`,
},
},
planTypePage: {
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 68881b24ca0..2adab7eb90c 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -7387,7 +7387,7 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
disclaimer: 'Gli agenti IA possono commettere errori.',
agentCreatedTitle: 'RuleBot è stato aggiunto al tuo spazio di lavoro!',
agentCreatedDescription: (agentsRoute: string) =>
- `Per applicare le tue regole dell’agente, abbiamo creato un agente per te e lo abbiamo aggiunto come amministratore del tuo spazio di lavoro.<br><br>Modifica i dettagli del tuo agente in <a href="${agentsRoute}">Account > Agenti</a>.`,
+ `Per applicare le regole del tuo agente, abbiamo creato un agente per te e l'abbiamo aggiunto come amministratore al tuo spazio di lavoro.<br><br>Modifica i dettagli del tuo agente in <a href="${agentsRoute}">Account > Agenti</a>.`,
},
},
planTypePage: {
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 6d9ab199b95..89313e11f10 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7303,9 +7303,9 @@ ${reportName}
describeRuleTitle: 'ルールの内容を記入してください',
describeRuleSubtitle: 'ルールの内容を入力すると、Concierge が自動作成します',
disclaimer: 'AI エージェントは間違える場合があります。',
- agentCreatedTitle: 'RuleBot がワークスペースに追加されました!',
+ agentCreatedTitle: 'RuleBot がワークスペースに追加されました。',
agentCreatedDescription: (agentsRoute: string) =>
- `エージェント ルールを適用するために、エージェントを作成し、ワークスペースの管理者として追加しました。<br><br>エージェントの詳細は <a href="${agentsRoute}">「アカウント」>「エージェント」</a> で編集できます。`,
+ `エージェントルールを適用するために、お客様のエージェントを作成し、ワークスペースの管理者として追加しました。<br><br><a href="${agentsRoute}">アカウント > エージェント</a> でエージェントの詳細を編集できます。`,
},
},
planTypePage: {
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index da54d8adbc1..d18720fd29e 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -7362,7 +7362,7 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
disclaimer: 'AI-agents kunnen fouten maken.',
agentCreatedTitle: 'RuleBot is toegevoegd aan je werkruimte!',
agentCreatedDescription: (agentsRoute: string) =>
- `Om je agentregels af te dwingen, hebben we een agent voor je gemaakt en deze als beheerder aan je werkruimte toegevoegd.<br><br>Bewerk de gegevens van je agent in <a href="${agentsRoute}">Account > Agents</a>.`,
+ `Om je agentregels te handhaven, hebben we een agent voor je aangemaakt en deze als beheerder aan je werkruimte toegevoegd.<br><br>Bewerk de gegevens van je agent in <a href="${agentsRoute}">Account > Agents</a>.`,
},
},
planTypePage: {
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 24db6808d8a..5dd94b4aafc 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -7353,9 +7353,9 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
describeRuleTitle: 'Opisz swoją regułę',
describeRuleSubtitle: 'Opisz swoją regułę, a Concierge ją utworzy',
disclaimer: 'Agenci AI mogą popełniać błędy.',
- agentCreatedTitle: 'RuleBot został dodany do Twojego obszaru roboczego!',
+ agentCreatedTitle: 'RuleBot został dodany do twojego workspace’a!',
agentCreatedDescription: (agentsRoute: string) =>
- `Aby egzekwować Twoje reguły agenta, utworzyliśmy dla Ciebie agenta i dodaliśmy go jako administratora do Twojego obszaru roboczego.<br><br>Edytuj dane swojego agenta w sekcji <a href="${agentsRoute}">Konto > Agenci</a>.`,
+ `Aby wymusić przestrzeganie zasad twojego agenta, utworzyliśmy dla ciebie agenta i dodaliśmy go jako administratora w twoim obszarze roboczym.<br><br>Edytuj szczegóły swojego agenta w <a href="${agentsRoute}">Konto > Agenci</a>.`,
},
},
planTypePage: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 4ad6872cb84..a71e1fc9d8c 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -7359,9 +7359,9 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
describeRuleTitle: 'Descreva sua regra',
describeRuleSubtitle: 'Descreva sua regra e a Concierge vai criá-la',
disclaimer: 'Os agentes de IA podem cometer erros.',
- agentCreatedTitle: 'O RuleBot foi adicionado ao seu espaço de trabalho!',
+ agentCreatedTitle: 'RuleBot foi adicionado ao seu workspace!',
agentCreatedDescription: (agentsRoute: string) =>
- `Para aplicar suas regras de agente, criamos um agente para você e o adicionamos como administrador do seu espaço de trabalho.<br><br>Edite os detalhes do seu agente em <a href="${agentsRoute}">Conta > Agentes</a>.`,
+ `Para aplicar suas regras de agente, criamos um agente para você e o adicionamos como administrador ao seu workspace.<br><br>Edite os detalhes do seu agente em <a href="${agentsRoute}">Conta > Agentes</a>.`,
},
},
planTypePage: {
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index b5b2daa3c55..2e75880df53 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7171,9 +7171,9 @@ ${reportName}
describeRuleTitle: '描述你的规则',
describeRuleSubtitle: '描述你的规则,我们会由 Concierge 为你创建',
disclaimer: 'AI 智能体可能会犯错。',
- agentCreatedTitle: 'RuleBot 已添加到你的工作区!',
+ agentCreatedTitle: 'RuleBot 已添加到你的工作区!',
agentCreatedDescription: (agentsRoute: string) =>
- `为了执行你的代理规则,我们为你创建了一个代理,并将其添加为你工作区的管理员。<br><br>你可以在 <a href="${agentsRoute}">“账户”>“代理”</a> 中编辑代理的详细信息。`,
+ `为便于执行你的代理规则,我们已为你创建了一个代理,并将其作为管理员添加到你的工作区。<br><br>你可以在<a href="${agentsRoute}">账户 > 代理</a>中编辑你的代理详情。`,
},
},
planTypePage: {
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@aimane-chnaif @NicolasBonet One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a526c145bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
🚧 @NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|

Details
When a user creates their first agent rule on a workspace, the backend silently creates the "RuleBot" agent and adds it as a workspace admin. This PR surfaces a one-time confirmation modal explaining that side effect so the behavior is no longer silent.
The modal is shown in
src/pages/workspace/rules/AgentRules/AddAgentRulePage.tsx. On submit, we determine whether this is the first rule viaisEmptyObject(policy?.rules?.agentRules). If it is, after dispatchingaddPolicyAgentRule(...)we show a confirmation modal (using theuseConfirmModalhook) with title "RuleBot has been added to your workspace" and a description explaining the agent was created and added as an admin, with a single "Got it" style confirm button. Navigation back happens only after the modal is dismissed. For subsequent rules the behavior is unchanged (navigate back immediately).New copy was added to
workspace.rules.agentRules(agentCreatedTitleandagentCreatedDescription) inen.tsand translated across all 9 other locale files. "RuleBot" is kept as a proper noun across locales.Fixed Issues
$ #93448
PROPOSAL: #93448 (comment)
Tests
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Note for reviewers:
npm run typecheck-tsgoreports 10 pre-existing errors insrc/libs/API/types.ts(Duplicate identifier WRITE_COMMANDS). These are unrelated to this PR — that file is not part of this change. The files modified in this PR produce zero type errors, and lint/tests pass.