Repository navigation
[NoQA][Insights polish] Replace the Top violations donut with a table - #106872
luacmartins merged 23 commits into
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
🦜 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 a6cd6833..3ad74a31 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1243,6 +1243,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: 'Durchschnitt über alle Händler',
allCategoryAverage: 'Durchschnitt aller Kategorien',
averageValue: (amount: string) => `${amount} durchschnittl.`,
+ allViolationAverage: 'Durchschnitt aller Verstöße',
+ noChange: 'Keine Änderung',
},
compliance: 'Compliance',
runningTotal: 'Laufende Summe',
@@ -1267,6 +1269,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: 'Am längsten bis zur Einreichung',
slowestToApprove: 'Am langsamsten bei der Genehmigung',
mostTimeToPay: 'Längste Zahlungsfrist',
+ percentChange: '% Änderung',
+ share: 'Anteil',
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index e888695e..3d57bb2d 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -1289,6 +1289,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: 'Μέσος όρος όλων των εμπόρων',
allCategoryAverage: 'Μέσος όρος όλων των κατηγοριών',
averageValue: (amount: string) => `${amount} κατά μέσο όρο`,
+ allViolationAverage: 'Μέσος όρος όλων των παραβάσεων',
+ noChange: 'Χωρίς αλλαγή',
},
compliance: 'Συμμόρφωση',
runningTotal: 'Τρέχον σύνολο',
@@ -1313,6 +1315,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: 'Περισσότερος χρόνος για υποβολή',
slowestToApprove: 'Πιο αργοί στην έγκριση',
mostTimeToPay: 'Περισσότερος χρόνος για πληρωμή',
+ percentChange: '% μεταβολή',
+ share: 'Μερίδιο',
},
allSettingsScreen: {
subscription: 'Συνδρομή',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 5e5a6359..ae2c881c 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1237,6 +1237,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: 'Promedio de todos los comercios',
allCategoryAverage: 'Promedio de todas las categorías',
averageValue: (amount: string) => `${amount} prom de media`,
+ allViolationAverage: 'Media de todas las infracciones',
+ noChange: 'Sin cambios',
},
compliance: 'Cumplimiento',
runningTotal: 'Total acumulado',
@@ -1261,6 +1263,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: 'Más lento en enviar',
slowestToApprove: 'Más lento en aprobar',
mostTimeToPay: 'Más tiempo para pagar',
+ percentChange: '% de cambio',
+ share: 'Porcentaje de participación',
},
allSettingsScreen: {
subscription: 'Suscripcion',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 25294bb4..fcf4f7ef 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1250,6 +1250,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: 'Moyenne tous marchands',
allCategoryAverage: 'Moyenne toutes catégories',
averageValue: (amount: string) => `${amount} en moyenne`,
+ allViolationAverage: 'Moyenne de toutes les infractions',
+ noChange: 'Aucun changement',
},
compliance: 'Conformité',
runningTotal: 'Total cumulé',
@@ -1274,6 +1276,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: 'Le plus long à soumettre',
slowestToApprove: 'Plus lent à approuver',
mostTimeToPay: 'Délai de paiement le plus long',
+ percentChange: '% de changement',
+ share: 'Part de la part totale (%)',
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 27bd6949..a1716bdf 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1246,6 +1246,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: 'Media tutti gli esercenti',
allCategoryAverage: 'Media di tutte le categorie',
averageValue: (amount: string) => `${amount} in media`,
+ allViolationAverage: 'Media di tutte le violazioni',
+ noChange: 'Nessuna modifica',
},
compliance: 'Conformità',
runningTotal: 'Totale progressivo',
@@ -1270,6 +1272,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: 'Più lungo per l’invio',
slowestToApprove: 'I più lenti ad approvare',
mostTimeToPay: 'Tempo massimo per pagare',
+ percentChange: '% variazione',
+ share: 'Quota%',
},
allSettingsScreen: {
subscription: 'Abbonamento',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 4bc64761..49ece2b6 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1231,6 +1231,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: '全加盟店の平均',
allCategoryAverage: '全カテゴリ平均',
averageValue: (amount: string) => `平均 ${amount}`,
+ allViolationAverage: 'すべての違反の平均',
+ noChange: '変更なし',
},
compliance: 'コンプライアンス',
runningTotal: '累計合計',
@@ -1255,6 +1257,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: '提出まで最も長い順',
slowestToApprove: '承認が最も遅い',
mostTimeToPay: '支払いまで最も時間がかかる',
+ percentChange: '% 変化',
+ share: 'シェア割合',
},
allSettingsScreen: {
subscription: 'サブスクリプション',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 8b9d8457..2ea22d69 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1242,6 +1242,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: 'Gemiddelde voor alle handelaren',
allCategoryAverage: 'Gemiddelde voor alle categorieën',
averageValue: (amount: string) => `${amount} gem.`,
+ allViolationAverage: 'Gemiddelde over alle overtredingen',
+ noChange: 'Geen wijziging',
},
compliance: 'Naleving',
runningTotal: 'Doorlopend totaal',
@@ -1266,6 +1268,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: 'Langste om in te dienen',
slowestToApprove: 'Traagst om goed te keuren',
mostTimeToPay: 'Meeste tijd om te betalen',
+ percentChange: '% wijziging',
+ share: 'Aandeel',
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index eeafb23c..7de9a231 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1269,6 +1269,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: 'Średnia dla wszystkich sprzedawców',
allCategoryAverage: 'Średnia dla wszystkich kategorii',
averageValue: (amount: string) => `średnio ${amount}`,
+ allViolationAverage: 'Średnia wszystkich naruszeń',
+ noChange: 'Bez zmian',
},
compliance: 'Zgodność',
runningTotal: 'Suma narastająco',
@@ -1293,6 +1295,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: 'Najdłużej oczekujące na wysłanie',
slowestToApprove: 'Najwolniejszy w zatwierdzaniu',
mostTimeToPay: 'Najdłuższy czas na zapłatę',
+ percentChange: '% zmiana',
+ share: 'Udział',
},
allSettingsScreen: {
subscription: 'Subskrypcja',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index f2bda196..9258f7fa 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1245,6 +1245,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: 'Média de todos os estabelecimentos',
allCategoryAverage: 'Média de todas as categorias',
averageValue: (amount: string) => `${amount} média`,
+ allViolationAverage: 'Média de todas as violações',
+ noChange: 'Sem alteração',
},
compliance: 'Conformidade',
runningTotal: 'Total acumulado',
@@ -1269,6 +1271,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: 'Mais demorados para enviar',
slowestToApprove: 'Mais lento para aprovar',
mostTimeToPay: 'Maior prazo para pagar',
+ percentChange: '% de mudança',
+ share: 'Participação',
},
allSettingsScreen: {
subscription: 'Assinatura',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 145b9424..26319c9d 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1196,6 +1196,8 @@ const translations: TranslationDeepObject<typeof en> = {
allMerchantAverage: '所有商户平均值',
allCategoryAverage: '所有类别平均值',
averageValue: (amount: string) => `${amount} 平均`,
+ allViolationAverage: '所有违规平均值',
+ noChange: '无更改',
},
compliance: '合规',
runningTotal: '累计总额',
@@ -1216,6 +1218,8 @@ const translations: TranslationDeepObject<typeof en> = {
longestToSubmit: '提交所用时间最长',
slowestToApprove: '审批最慢',
mostTimeToPay: '最长付款时间',
+ percentChange: '百分比变动',
+ share: '占比',
},
allSettingsScreen: {
subscription: '订阅',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Dang this is looking good. Can we run an ad hoc build to test? I think we should probably use the same line style for the average line in the table on desktop as the one from the charts above. Also @JmillsExpensify are we expecting to be able to click on these rows and open a details RHP? |
|
Awesome, sounds good to me. @mhawryluk hopefully a quick change once you're back online. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-11-17.at.11.34.01.moviOS: mWeb SafariScreen.Recording.2026-11-17.at.11.34.01.movMacOS: Chrome / SafariScreen.Recording.2026-11-17.at.11.31.56.mov |
| }; | ||
|
|
||
| /** Splits the charts, in order, into sections: a full-width chart on its own, or the charts between two full-width ones, which share a two-column grid */ | ||
| function getDashboardSections(charts: InsightsDashboardChart[]): Array<InsightsDashboardChart | InsightsDashboardChart[]> { |
There was a problem hiding this comment.
Good find! We could also move the chart down to the bottom for this case.
There was a problem hiding this comment.
Nice, I think that works and we can merge with that solution in mind. Another potential future option is always showing that graph for approvers and simply showing it with the empty state. The reality is that most accounts have approvals enabled.
There was a problem hiding this comment.
Super down to roll with it at the bottom, but this also doesn't sound like a bad idea to me:
Another potential future option is always showing that graph for approvers and simply showing it with the empty state
|
🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
JmillsExpensify
left a comment
There was a problem hiding this comment.
Latest changes are looking great. Let's get this merged.
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.41-0 🚀
|
|
No help site update needed — the table change remains behind the existing compliance beta gate, and no existing article sentence becomes incorrect. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.41-2 🚀
Bundle Size Analysis (Sentry): |



Explanation of Change
Replaces the Top violations donut on the Compliance dashboard with a full-width table, moved below Violations by submitter and Violations by approver.
Each row shows the violation, its share of all violation types' expenses, the number of expenses and their amount. Rows are sorted by expenses and open the chart's Spend query when pressed. With Compare: Previous period, a change column shows how each violation's expenses changed. With Compare: Average, a line marks the all-violation average on the share bars. On mobile, the table becomes a list with the same rows.
The table is built as a generic ranking table, so other Insights charts will be able to use it.
The table is built from plain views rather than the shared Table component, because Table is built around a page-level virtualized list, while this one sits inside a dashboard card with at most 15 rows, like the other tables inside Insights cards.
Fixed Issues
$ #106841
PROPOSAL: N/A
Tests
insightsCompliancebeta.Offline tests
QA Steps
No tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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
Nagranie.z.ekranu.2026-11-16.o.17.17.50.mov
Android: mWeb Chrome
iOS: Native
Simulator.Screen.Recording.-.iPhone.17.-.2026-11-16.at.17.06.32.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-11-16.o.17.06.53.mov