From 87b37a10ff852f0d7899ad0bd1896a82958713c7 Mon Sep 17 00:00:00 2001 From: ZProger Date: Sun, 30 Aug 2026 19:20:00 +0300 Subject: [PATCH] fix: move breakdown button to the start of the row, swap chevron for SquareDivide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Резерв под стрелку справа от суммы отъедал место у самой суммы даже когда у категории нет подкатегорий — суммы во всей колонке смотрелись сдвинутыми от правого края. Кнопка перенесена в начало строки, где резерв под неё не мешает колонке сумм. Иконка заменена на SquareDivide (та же, что уже используется для сплит-транзакций в списке). --- .../dashboard/SpendingByCategoryCard.tsx | 35 ++++++++++--------- .../reports/CategoryRankingCard.tsx | 33 ++++++++--------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/dashboard/SpendingByCategoryCard.tsx b/frontend/src/components/dashboard/SpendingByCategoryCard.tsx index b1ea417..e3939f2 100644 --- a/frontend/src/components/dashboard/SpendingByCategoryCard.tsx +++ b/frontend/src/components/dashboard/SpendingByCategoryCard.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { ChevronRight } from "lucide-react"; +import { SquareDivide } from "lucide-react"; import { Cell, Pie, PieChart, ResponsiveContainer, Tooltip } from "recharts"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card"; import { CategoryBreakdownModal } from "@/components/categories/CategoryBreakdownModal"; @@ -76,7 +76,23 @@ export function SpendingByCategoryCard({ items }: SpendingByCategoryCardProps) { const Icon = getCategoryIcon(item.icon); const hasChildren = item.children.length > 0; return ( -
  • +
  • + {/* Fixed-width slot on every row, populated or not — the + amount column at the row's end must stay flush right + the same way whether or not this row has a + breakdown to open. */} + + {hasChildren && ( + + )} + {formatCurrency(item.amount)} - {/* Fixed-width slot on every row, populated or not — a - chevron shown only on rows with children would shift - their amount left relative to every other row's. */} - - {hasChildren && ( - - )} -
  • ); })} diff --git a/frontend/src/components/reports/CategoryRankingCard.tsx b/frontend/src/components/reports/CategoryRankingCard.tsx index 31ac51a..455c443 100644 --- a/frontend/src/components/reports/CategoryRankingCard.tsx +++ b/frontend/src/components/reports/CategoryRankingCard.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { ChevronRight } from "lucide-react"; +import { SquareDivide } from "lucide-react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card"; import { CategoryBreakdownModal } from "@/components/categories/CategoryBreakdownModal"; import { getCategoryIcon } from "@/lib/icons"; @@ -50,6 +50,22 @@ export function CategoryRankingCard({ items, isLoading, selectedCategoryId, onSe isSelected ? "bg-surface-2" : "" }`} > + {/* Fixed-width slot on every row, populated or not — the + amount column at the row's end must stay flush right + the same way whether or not this row has a + breakdown to open. */} + + {hasChildren && ( + + )} + - {/* Fixed-width slot on every row, populated or not — a - chevron shown only on rows with children would shift - their amount left relative to every other row's. */} - - {hasChildren && ( - - )} - );