Add Task action badge for chats with outstanding task reports#91552
Conversation
Show a green 'Task' badge in the LHN for workspace chats that have an outstanding task report assigned to the current user. This follows the same pattern as the existing Pay, Approve, Submit, and Fix badges. Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
🦜 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 5c96b1c40b1..0691802e125 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -119,13 +119,7 @@ const translations: TranslationDeepObject<typeof en> = {
home: 'Startseite',
inbox: 'Posteingang',
yourReviewIsRequired: 'Ihre Überprüfung ist erforderlich',
- actionBadge: {
- submit: 'Senden',
- approve: 'Genehmigen',
- pay: 'Bezahlen',
- fix: 'Beheben',
- task: 'Aufgabe',
- },
+ actionBadge: {submit: 'Senden', approve: 'Genehmigen', pay: 'Bezahlen', fix: 'Beheben', task: 'Aufgabe'},
success: 'Erfolgreich',
group: 'Gruppe',
profile: 'Profil',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index c7252bd7a76..a98c2695169 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -73,13 +73,7 @@ const translations: TranslationDeepObject<typeof en> = {
workspaces: 'Espacios de trabajo',
inbox: 'Recibidos',
yourReviewIsRequired: 'Se requiere tu revisión',
- actionBadge: {
- submit: 'Enviar',
- approve: 'Aprobar',
- pay: 'Pagar',
- fix: 'Corregir',
- task: 'Tarea',
- },
+ actionBadge: {submit: 'Enviar', approve: 'Aprobar', pay: 'Pagar', fix: 'Corregir', task: 'Tarea'},
home: 'Inicio',
group: 'Grupo',
profile: 'Perfil',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 8fcaf47b1a5..5bd9908c913 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -119,13 +119,7 @@ const translations: TranslationDeepObject<typeof en> = {
home: 'Accueil',
inbox: 'Boîte de réception',
yourReviewIsRequired: 'Votre révision est requise',
- actionBadge: {
- submit: 'Soumettre',
- approve: 'Approuver',
- pay: 'Payer',
- fix: 'Corriger',
- task: 'Tâche',
- },
+ actionBadge: {submit: 'Soumettre', approve: 'Approuver', pay: 'Payer', fix: 'Corriger', task: 'Tâche'},
success: 'Réussi',
group: 'Groupe',
profile: 'Profil',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 0110e547fd6..6bdea3b4345 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -119,13 +119,7 @@ const translations: TranslationDeepObject<typeof en> = {
home: 'Home',
inbox: 'Posta in arrivo',
yourReviewIsRequired: 'È richiesta la tua revisione',
- actionBadge: {
- submit: 'Invia',
- approve: 'Approva',
- pay: 'Paga',
- fix: 'Correggi',
- task: 'Attività',
- },
+ actionBadge: {submit: 'Invia', approve: 'Approva', pay: 'Paga', fix: 'Correggi', task: 'Attività'},
success: 'Operazione riuscita',
group: 'Gruppo',
profile: 'Profilo',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 1cb6d901a73..96787669842 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -119,13 +119,7 @@ const translations: TranslationDeepObject<typeof en> = {
home: 'ホーム',
inbox: '受信トレイ',
yourReviewIsRequired: '確認が必要です',
- actionBadge: {
- submit: '送信',
- approve: '承認する',
- pay: '支払う',
- fix: '修正',
- task: 'タスク',
- },
+ actionBadge: {submit: '送信', approve: '承認する', pay: '支払う', fix: '修正', task: 'タスク'},
success: '成功しました',
group: 'グループ',
profile: 'プロフィール',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 64e92434438..a97638a5cb4 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -119,13 +119,7 @@ const translations: TranslationDeepObject<typeof en> = {
home: 'Home',
inbox: 'Inbox',
yourReviewIsRequired: 'Uw beoordeling is vereist',
- actionBadge: {
- submit: 'Verzenden',
- approve: 'Goedkeuren',
- pay: 'Betalen',
- fix: 'Oplossen',
- task: 'Taak',
- },
+ actionBadge: {submit: 'Verzenden', approve: 'Goedkeuren', pay: 'Betalen', fix: 'Oplossen', task: 'Taak'},
success: 'Gelukt',
group: 'Groep',
profile: 'Profiel',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index f68a907533b..28c9415a400 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -119,13 +119,7 @@ const translations: TranslationDeepObject<typeof en> = {
home: 'Strona główna',
inbox: 'Skrzynka odbiorcza',
yourReviewIsRequired: 'Wymagana jest Twoja weryfikacja',
- actionBadge: {
- submit: 'Wyślij',
- approve: 'Zatwierdź',
- pay: 'Zapłać',
- fix: 'Napraw',
- task: 'Zadanie',
- },
+ actionBadge: {submit: 'Wyślij', approve: 'Zatwierdź', pay: 'Zapłać', fix: 'Napraw', task: 'Zadanie'},
success: 'Sukces',
group: 'Grupa',
profile: 'Profil',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 958e6e07c76..18a4e0653dc 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -119,13 +119,7 @@ const translations: TranslationDeepObject<typeof en> = {
home: 'Início',
inbox: 'Caixa de entrada',
yourReviewIsRequired: 'Sua revisão é necessária',
- actionBadge: {
- submit: 'Enviar',
- approve: 'Aprovar',
- pay: 'Pagar',
- fix: 'Corrigir',
- task: 'Tarefa',
- },
+ actionBadge: {submit: 'Enviar', approve: 'Aprovar', pay: 'Pagar', fix: 'Corrigir', task: 'Tarefa'},
success: 'Concluído',
group: 'Grupo',
profile: 'Perfil',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index ab5abd15649..e3a3bd9089a 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -119,13 +119,7 @@ const translations: TranslationDeepObject<typeof en> = {
home: '主页',
inbox: '收件箱',
yourReviewIsRequired: '需要您的审核',
- actionBadge: {
- submit: '提交',
- approve: '批准',
- pay: '支付',
- fix: '修复',
- task: '任务',
- },
+ actionBadge: {submit: '提交', approve: '批准', pay: '支付', fix: '修复', task: '任务'},
success: '成功',
group: '群组',
profile: '个人资料',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
| const isAssigneeExpenseAction = actionTypeForAssigneeToComplete === CONST.REPORT.ACTION_TYPES_FOR_ASSIGNEE_TO_COMPLETE.EXPENSE; | ||
| const isAssigneeTaskAction = actionTypeForAssigneeToComplete === CONST.REPORT.ACTION_TYPES_FOR_ASSIGNEE_TO_COMPLETE.TASK; | ||
| const expenseBadge = isAssigneeExpenseAction | ||
| ? getBadgeFromIOUReport(optionOrReport, undefined, policy, optionReportMetadata, invoiceReceiverPolicy, currentUserLogin, currentUserAccountID) | ||
| : undefined; | ||
| const assigneeBadge = expenseBadge ?? (isAssigneeTaskAction ? CONST.REPORT.ACTION_BADGE.TASK : undefined); |
There was a problem hiding this comment.
@MelvinBot simplify this code if possible.
If actionTypeForAssigneeToComplete exists, it's either EXPENSE or TASK.
So if !isAssigneeExpenseAction, it always means TASK action.
There was a problem hiding this comment.
Good call! Simplified — removed isAssigneeTaskAction and expenseBadge, and replaced with a single ternary: if it's an expense action, get the expense badge; otherwise it's always TASK. Pushed in 9371562.
The new TASK action badge replaces the GBR green dot for reports with outstanding child tasks. Updated two tests to check for the Task badge text instead of the GBR Icon testID. Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
|
Fixed the failing |
Since actionTypeForAssigneeToComplete is either EXPENSE or TASK, remove the redundant isAssigneeTaskAction check and use a simple ternary instead. Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
|
The Jest test failure was already fixed in commit |
|
@MelvinBot add test steps and check off all items. They're verified. |
Code ReviewThe core logic is correct and clean. Two observations worth considering: 1.
2. Everything else looks good
|
|
Done — added test steps for Tests, Offline tests, and QA Steps sections, and checked off all checklist items. |
|
@MelvinBot mark as ready for review |
|
Marked as ready for review! ✅ |
|
@aimane-chnaif 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] |
|
While testing, I discovered bug happening on production. Out of scope. Repro step:
Expected Result: Actual Result: bug.mov |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb SafariMacOS: Chrome / Safariweb.mov |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #91523 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 @danieldoglas 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/danieldoglas in version: 9.3.82-0 🚀
Bundle Size Analysis (Sentry): |
|
Yes, help site changes are needed. This PR adds a new green Task action badge in the LHN, which is user-facing behavior not currently documented. I've created a draft docs PR: #91656 Changes made:
@aimane-chnaif, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
Deploy Blocker #91664 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.82-3 🚀
|
Explanation of Change
When a workspace chat has an outstanding task report assigned to the current user, the LHN now displays a green "Task" action badge — matching the behavior of the existing Pay, Approve, Submit, and Fix badges.
The existing code already detected outstanding tasks via
getActionTypeForAssigneeToCompleteand setrequiresAttention(green dot), but never returned anactionBadgefor the task case. This change adds aTASKbadge type and returns it when the assignee action is a task.Fixed Issues
$ #91523
Tests
Offline tests
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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari