From 58cf5cb762adf88e6bbba1a95b2f67d2447b3635 Mon Sep 17 00:00:00 2001 From: Padreug Date: Sat, 6 Jun 2026 23:05:55 +0200 Subject: [PATCH] refactor(libra): drop status icons, add Income/Expense badges Per the iteration: the title-row status icons (green check / yellow clock / red X) were doing the same job as the new status badges and amount color, so each row had three signals fighting for the same meaning. Drop the icons and lean on badges instead. Badge row order (left-to-right): Voided > Income/Expense > Pending > user tags. Type badge sits between the high-attention Voided marker and the secondary Pending marker, so the type chip is easy to spot on every row. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../expenses/views/TransactionsPage.vue | 76 +++++++------------ 1 file changed, 26 insertions(+), 50 deletions(-) diff --git a/src/modules/expenses/views/TransactionsPage.vue b/src/modules/expenses/views/TransactionsPage.vue index fafee56..fdf34a8 100644 --- a/src/modules/expenses/views/TransactionsPage.vue +++ b/src/modules/expenses/views/TransactionsPage.vue @@ -12,10 +12,6 @@ import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { Input } from '@/components/ui/input' import { - CheckCircle2, - Clock, - Flag, - XCircle, RefreshCw, Calendar, Filter @@ -137,25 +133,6 @@ function formatAmount(amount: number): string { return new Intl.NumberFormat('en-US').format(amount) } -// Get status icon and color. Voided entries (per libra convention) keep -// flag='!' and carry a 'voided' tag — surface that as the icon regardless -// of the underlying flag. -function getStatusInfo(transaction: Transaction) { - if (isVoided(transaction)) { - return { icon: XCircle, color: 'text-muted-foreground', label: 'Voided' } - } - switch (transaction.flag) { - case '*': - return { icon: CheckCircle2, color: 'text-green-600', label: 'Cleared' } - case '!': - return { icon: Clock, color: 'text-yellow-500', label: 'Pending' } - case '#': - return { icon: Flag, color: 'text-red-600', label: 'Flagged' } - default: - return null - } -} - // Income gets a leading '+', expense a leading '-'. function getAmountSign(t: Transaction): string { if (isIncome(t)) return '+' @@ -380,25 +357,14 @@ onMounted(() => {
-
- - -

- {{ transaction.description }} -

-
+

+ {{ transaction.description }} +

{{ formatDate(transaction.date) }}

@@ -433,13 +399,9 @@ onMounted(() => { Ref: {{ transaction.reference }}
- -
+ +
{ Voided + Income + + + Expense + +