Compare commits

..

3 Commits

Author SHA1 Message Date
Felipe Coutinho
2fd6e3c323 Prepara versao 2.7.5 2026-06-13 11:05:00 -03:00
Felipe Coutinho
833845b5cf Ajusta widgets do dashboard 2026-06-13 11:04:54 -03:00
Felipe Coutinho
4cbdddb12e corrige importacao de lancamentos compartilhados 2026-06-09 20:41:41 -03:00
15 changed files with 157 additions and 47 deletions

View File

@@ -5,6 +5,25 @@ Todas as mudanças notáveis deste projeto serão documentadas neste arquivo.
O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/), O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/),
e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/). e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/).
## [2.7.5] - 2026-06-13
Esta versão faz um polimento pontual no dashboard, deixando os widgets mais explicativos, consistentes e confiáveis quando há listas maiores ou informações complementares para revisar.
### Alterado
- Dashboard: os indicadores percentuais de faturas por pessoa, despesas por categoria, receitas por categoria e tendências de categorias agora deixam explícito que a comparação é contra o mês anterior.
- Dashboard: pequenos ajustes visuais em widgets melhoram espaçamento, bordas e leitura de itens financeiros.
### Corrigido
- Dashboard: o widget `Lançamentos por categoria` agora recalcula corretamente o overflow quando a lista muda e volta a exibir o botão `Expandir` em listagens grandes.
- Relatórios: em `/reports/installment-analysis`, os cards de parcelamentos agora exibem o ícone de observação ao lado do nome do lançamento quando há anotação cadastrada.
## [2.7.4] - 2026-06-09
Esta versão corrige o fluxo de revisão de lançamentos compartilhados para que o acesso somente leitura proteja os dados originais sem impedir que a pessoa copie movimentos para a própria conta.
### Corrigido
- Pessoas: lançamentos de uma pessoa compartilhada em modo somente leitura agora podem ser selecionados e importados para a conta do usuário logado, tanto individualmente quanto em lote, mantendo edição e remoção bloqueadas no lançamento original.
## [2.7.3] - 2026-06-05 ## [2.7.3] - 2026-06-05
Esta versão melhora pequenos pontos de leitura e configuração para o uso diário e self-hosted. As faturas pagas ficam mais fáceis de identificar na lista de cartões, a configuração de origins confiáveis do Better Auth passa a ficar documentada para Docker e túneis, o dashboard corrige a leitura de tempo dos pré-lançamentos e as dependências seguem atualizadas sem quebrar o build da imagem. Esta versão melhora pequenos pontos de leitura e configuração para o uso diário e self-hosted. As faturas pagas ficam mais fáceis de identificar na lista de cartões, a configuração de origins confiáveis do Better Auth passa a ficar documentada para Docker e túneis, o dashboard corrige a leitura de tempo dos pré-lançamentos e as dependências seguem atualizadas sem quebrar o build da imagem.

View File

@@ -10,7 +10,7 @@
> **Não há versão online hospedada.** Você precisa clonar o repositório e rodar localmente ou no seu próprio servidor. > **Não há versão online hospedada.** Você precisa clonar o repositório e rodar localmente ou no seu próprio servidor.
[![Version](https://img.shields.io/badge/version-2.7.3-blue?style=flat-square)](CHANGELOG.md) [![Version](https://img.shields.io/badge/version-2.7.5-blue?style=flat-square)](CHANGELOG.md)
[![Next.js](https://img.shields.io/badge/Next.js-black?style=flat-square&logo=next.js)](https://nextjs.org/) [![Next.js](https://img.shields.io/badge/Next.js-black?style=flat-square&logo=next.js)](https://nextjs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/) [![TypeScript](https://img.shields.io/badge/TypeScript-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/)
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-blue?style=flat-square&logo=postgresql)](https://www.postgresql.org/) [![PostgreSQL](https://img.shields.io/badge/PostgreSQL-blue?style=flat-square&logo=postgresql)](https://www.postgresql.org/)

View File

@@ -1,6 +1,6 @@
{ {
"name": "openmonetis", "name": "openmonetis",
"version": "2.7.3", "version": "2.7.5",
"private": true, "private": true,
"packageManager": "pnpm@11.1.3", "packageManager": "pnpm@11.1.3",
"scripts": { "scripts": {

View File

@@ -4,7 +4,7 @@
@custom-variant dark (&:is(.dark *)); @custom-variant dark (&:is(.dark *));
@theme { @theme {
--spacing-custom-height-card: 29rem; --spacing-custom-height-card: 30rem;
--spacing-8xl: 90rem; --spacing-8xl: 90rem;
} }
@@ -117,7 +117,7 @@
--destructive: oklch(62% 0.2 28); --destructive: oklch(62% 0.2 28);
--destructive-foreground: oklch(98% 0.005 30); --destructive-foreground: oklch(98% 0.005 30);
--border: oklch(24.576% 0.0072 67.399); --border: oklch(29.675% 0.01144 67.3);
--input: var(--border); --input: var(--border);
--ring: var(--primary); --ring: var(--primary);

View File

@@ -65,7 +65,7 @@ export function BillListItem({ bill, period, onPay }: BillListItemProps) {
<TooltipTrigger asChild> <TooltipTrigger asChild>
<span <span
className={cn( className={cn(
"cursor-help rounded-full py-0.5", "cursor-help",
bill.isSettled && "text-success font-semibold", bill.isSettled && "text-success font-semibold",
overdue && "text-destructive font-semibold", overdue && "text-destructive font-semibold",
)} )}
@@ -80,7 +80,6 @@ export function BillListItem({ bill, period, onPay }: BillListItemProps) {
) : ( ) : (
<span <span
className={cn( className={cn(
"rounded-full py-0.5",
bill.isSettled && "text-success font-semibold", bill.isSettled && "text-success font-semibold",
overdue && "text-destructive font-semibold", overdue && "text-destructive font-semibold",
)} )}

View File

@@ -102,18 +102,19 @@ export function CategoryBreakdownListItem({
className="text-foreground font-medium" className="text-foreground font-medium"
amount={category.currentAmount} amount={category.currentAmount}
/> />
<PercentageChangeIndicator {category.percentageChange !== null ? (
value={category.percentageChange} <span className="flex items-center gap-1 text-xs text-muted-foreground">
label={ <PercentageChangeIndicator
category.percentageChange !== null value={category.percentageChange}
? formatPercentage( label={formatPercentage(
category.percentageChange, category.percentageChange,
config.percentageDigits, config.percentageDigits,
) )}
: undefined positiveTrend={config.positiveTrend}
} />
positiveTrend={config.positiveTrend} <span>vs. mês ant.</span>
/> </span>
) : null}
</div> </div>
</div> </div>
</div> </div>

View File

@@ -2,6 +2,7 @@
import { import {
RiBankCard2Line, RiBankCard2Line,
RiChat1Line,
RiCheckboxCircleFill, RiCheckboxCircleFill,
RiFileList2Line, RiFileList2Line,
RiTimeLine, RiTimeLine,
@@ -30,6 +31,11 @@ import {
DialogTitle, DialogTitle,
} from "@/shared/components/ui/dialog"; } from "@/shared/components/ui/dialog";
import { Progress } from "@/shared/components/ui/progress"; import { Progress } from "@/shared/components/ui/progress";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/shared/components/ui/tooltip";
import { resolveLogoSrc } from "@/shared/lib/logo"; import { resolveLogoSrc } from "@/shared/lib/logo";
import { cn } from "@/shared/utils"; import { cn } from "@/shared/utils";
import type { InstallmentGroup } from "./types"; import type { InstallmentGroup } from "./types";
@@ -83,6 +89,7 @@ export function InstallmentGroupCard({
); );
const cardLogoSrc = resolveLogoSrc(group.cartaoLogo); const cardLogoSrc = resolveLogoSrc(group.cartaoLogo);
const cardName = group.cartaoName ?? "Compra parcelada"; const cardName = group.cartaoName ?? "Compra parcelada";
const hasNote = Boolean(group.note?.trim().length);
const untrackedLabel = const untrackedLabel =
group.untrackedInstallments === 1 group.untrackedInstallments === 1
? "1 parcela anterior fora do acompanhamento" ? "1 parcela anterior fora do acompanhamento"
@@ -121,8 +128,28 @@ export function InstallmentGroupCard({
<div className="flex items-center gap-3 flex-wrap"> <div className="flex items-center gap-3 flex-wrap">
<EstablishmentLogo name={group.name} size={40} /> <EstablishmentLogo name={group.name} size={40} />
<div className="flex-1 min-w-0"> <div className="flex-1 min-w-0">
<CardTitle className="text-base truncate"> <CardTitle className="flex items-center gap-1 text-base">
{group.name} <span className="truncate">{group.name}</span>
{hasNote ? (
<Tooltip>
<TooltipTrigger asChild>
<span className="inline-flex shrink-0 rounded-full p-1 hover:bg-accent transition-colors duration-300">
<RiChat1Line
className="h-4 w-4 text-muted-foreground"
aria-hidden
/>
<span className="sr-only">Ver anotação</span>
</span>
</TooltipTrigger>
<TooltipContent
side="top"
align="start"
className="max-w-xs whitespace-pre-line"
>
{group.note}
</TooltipContent>
</Tooltip>
) : null}
</CardTitle> </CardTitle>
<CardDescription className="flex min-w-0 items-center gap-1 text-xs"> <CardDescription className="flex min-w-0 items-center gap-1 text-xs">
{cardLogoSrc ? ( {cardLogoSrc ? (
@@ -235,8 +262,28 @@ export function InstallmentGroupCard({
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<EstablishmentLogo name={group.name} size={32} /> <EstablishmentLogo name={group.name} size={32} />
<div className="min-w-0"> <div className="min-w-0">
<DialogTitle className="truncate text-base"> <DialogTitle className="flex items-center gap-1 text-base">
{group.name} <span className="truncate">{group.name}</span>
{hasNote ? (
<Tooltip>
<TooltipTrigger asChild>
<span className="inline-flex shrink-0 rounded-full p-1 hover:bg-accent transition-colors duration-300">
<RiChat1Line
className="h-4 w-4 text-muted-foreground"
aria-hidden
/>
<span className="sr-only">Ver anotação</span>
</span>
</TooltipTrigger>
<TooltipContent
side="top"
align="start"
className="max-w-xs whitespace-pre-line"
>
{group.note}
</TooltipContent>
</Tooltip>
) : null}
</DialogTitle> </DialogTitle>
<div className="mt-0.5 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground"> <div className="mt-0.5 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground">
{cardLogoSrc ? ( {cardLogoSrc ? (

View File

@@ -123,9 +123,14 @@ export function InvoiceListItem({ invoice, onPay }: InvoiceListItemProps) {
className="font-medium" className="font-medium"
amount={share.amount} amount={share.amount}
/> />
<PercentageChangeIndicator {share.percentageChange !== null ? (
value={share.percentageChange} <span className="flex items-center gap-1 text-xs text-muted-foreground">
/> <PercentageChangeIndicator
value={share.percentageChange}
/>
<span>vs. mês ant.</span>
</span>
) : null}
</div> </div>
</li> </li>
))} ))}

View File

@@ -81,17 +81,20 @@ export function CategoryTrendsWidget({
</span> </span>
</p> </p>
</div> </div>
<PercentageChangeIndicator <span className="flex shrink-0 items-center gap-1 text-xs text-muted-foreground">
value={change} <PercentageChangeIndicator
label={formatPercentage(change, { value={change}
absolute: true, label={formatPercentage(change, {
minimumFractionDigits: 0, absolute: true,
maximumFractionDigits: 0, minimumFractionDigits: 0,
})} maximumFractionDigits: 0,
positiveTrend="down" })}
className="shrink-0 text-sm font-semibold" positiveTrend="down"
iconClassName="size-3.5" className="text-sm font-semibold"
/> iconClassName="size-3.5"
/>
<span>vs. mês ant.</span>
</span>
</div> </div>
</li> </li>
); );

View File

@@ -144,7 +144,7 @@ export function MyAccountsWidget({
className="flex items-center justify-between py-1.5 transition-all duration-300" className="flex items-center justify-between py-1.5 transition-all duration-300"
> >
<div className="flex min-w-0 flex-1 items-center gap-2 py-1"> <div className="flex min-w-0 flex-1 items-center gap-2 py-1">
<div className="relative flex size-9.5 shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary/10"> <div className="relative flex size-9.5 shrink-0 items-center justify-center overflow-hidden rounded-full">
{logoSrc ? ( {logoSrc ? (
<Image <Image
src={logoSrc} src={logoSrc}

View File

@@ -45,6 +45,7 @@ type InstallmentDetail = {
export type InstallmentGroup = { export type InstallmentGroup = {
seriesId: string; seriesId: string;
name: string; name: string;
note: string | null;
paymentMethod: string; paymentMethod: string;
cardId: string | null; cardId: string | null;
cartaoName: string | null; cartaoName: string | null;
@@ -80,6 +81,7 @@ export async function fetchInstallmentAnalysis(
id: transactions.id, id: transactions.id,
seriesId: transactions.seriesId, seriesId: transactions.seriesId,
name: transactions.name, name: transactions.name,
note: transactions.note,
amount: transactions.amount, amount: transactions.amount,
paymentMethod: transactions.paymentMethod, paymentMethod: transactions.paymentMethod,
currentInstallment: transactions.currentInstallment, currentInstallment: transactions.currentInstallment,
@@ -150,6 +152,7 @@ export async function fetchInstallmentAnalysis(
seriesMap.set(row.seriesId, { seriesMap.set(row.seriesId, {
seriesId: row.seriesId, seriesId: row.seriesId,
name: row.name, name: row.name,
note: row.note,
paymentMethod: row.paymentMethod, paymentMethod: row.paymentMethod,
cardId: row.cardId, cardId: row.cardId,
cartaoName: row.cartaoName, cartaoName: row.cartaoName,

View File

@@ -92,7 +92,7 @@ export function TransactionActionsMenu({
</DropdownMenuItem> </DropdownMenuItem>
) : null} ) : null}
{!item.readonly && !isOwnData ? ( {!isOwnData ? (
<DropdownMenuItem <DropdownMenuItem
onSelect={() => onImport?.(item)} onSelect={() => onImport?.(item)}
disabled={!onImport} disabled={!onImport}

View File

@@ -139,6 +139,7 @@ function buildColumns({
cell: ({ row }) => ( cell: ({ row }) => (
<Checkbox <Checkbox
checked={row.getIsSelected()} checked={row.getIsSelected()}
disabled={!row.getCanSelect()}
onCheckedChange={(value) => row.toggleSelected(!!value)} onCheckedChange={(value) => row.toggleSelected(!!value)}
aria-label="Selecionar linha" aria-label="Selecionar linha"
/> />

View File

@@ -175,7 +175,10 @@ export function TransactionsTable({
: getPaginationRowModel(), : getPaginationRowModel(),
manualPagination: isServerPaginated, manualPagination: isServerPaginated,
pageCount: serverPagination?.totalPages, pageCount: serverPagination?.totalPages,
enableRowSelection: (row) => !row.original.readonly, enableRowSelection: (row) =>
row.original.userId === currentUserId
? !row.original.readonly
: Boolean(onBulkImport),
}); });
const rowModel = table.getRowModel(); const rowModel = table.getRowModel();
@@ -184,11 +187,21 @@ export function TransactionsTable({
? (serverPagination?.totalItems ?? 0) ? (serverPagination?.totalItems ?? 0)
: table.getCoreRowModel().rows.length; : table.getCoreRowModel().rows.length;
const selectedRows = table.getFilteredSelectedRowModel().rows; const selectedRows = table.getFilteredSelectedRowModel().rows;
const selectedOwnRows = selectedRows.filter(
(row) => row.original.userId === currentUserId,
);
const selectedImportRows = selectedRows.filter(
(row) => row.original.userId !== currentUserId,
);
const selectedCount = selectedRows.length; const selectedCount = selectedRows.length;
const selectedTotal = selectedRows.reduce( const selectedTotal = selectedRows.reduce(
(total, row) => total + (row.original.amount ?? 0), (total, row) => total + (row.original.amount ?? 0),
0, 0,
); );
const selectedImportTotal = selectedImportRows.reduce(
(total, row) => total + (row.original.amount ?? 0),
0,
);
const currentPage = isServerPaginated const currentPage = isServerPaginated
? (serverPagination?.page ?? 1) ? (serverPagination?.page ?? 1)
: table.getState().pagination.pageIndex + 1; : table.getState().pagination.pageIndex + 1;
@@ -211,8 +224,8 @@ export function TransactionsTable({
}; };
const handleBulkImport = () => { const handleBulkImport = () => {
if (onBulkImport && selectedCount > 0) { if (onBulkImport && selectedImportRows.length > 0) {
onBulkImport(selectedRows.map((row) => row.original)); onBulkImport(selectedImportRows.map((row) => row.original));
setRowSelection({}); setRowSelection({});
} }
}; };
@@ -326,7 +339,7 @@ export function TransactionsTable({
{selectedCount > 0 && {selectedCount > 0 &&
onBulkDelete && onBulkDelete &&
selectedRows.every((row) => row.original.userId === currentUserId) ? ( selectedOwnRows.length === selectedCount ? (
<TransactionsBulkBar <TransactionsBulkBar
selectedCount={selectedCount} selectedCount={selectedCount}
selectedTotal={selectedTotal} selectedTotal={selectedTotal}
@@ -335,12 +348,10 @@ export function TransactionsTable({
/> />
) : null} ) : null}
{selectedCount > 0 && {selectedCount > 0 && onBulkImport && selectedImportRows.length > 0 ? (
onBulkImport &&
selectedRows.some((row) => row.original.userId !== currentUserId) ? (
<TransactionsBulkBar <TransactionsBulkBar
selectedCount={selectedCount} selectedCount={selectedImportRows.length}
selectedTotal={selectedTotal} selectedTotal={selectedImportTotal}
mode="import" mode="import"
onAction={handleBulkImport} onAction={handleBulkImport}
/> />

View File

@@ -32,6 +32,7 @@ export function ExpandableWidgetCard({
if (!element) return; if (!element) return;
let frameId = 0; let frameId = 0;
const observedElements = new Set<Element>();
const checkOverflow = () => { const checkOverflow = () => {
cancelAnimationFrame(frameId); cancelAnimationFrame(frameId);
@@ -44,13 +45,33 @@ export function ExpandableWidgetCard({
}); });
}; };
const observeContentElements = (resizeObserver: ResizeObserver) => {
for (const child of Array.from(element.children)) {
if (!observedElements.has(child)) {
resizeObserver.observe(child);
observedElements.add(child);
}
}
};
checkOverflow(); checkOverflow();
const resizeObserver = new ResizeObserver(checkOverflow); const resizeObserver = new ResizeObserver(checkOverflow);
resizeObserver.observe(element); resizeObserver.observe(element);
observeContentElements(resizeObserver);
const mutationObserver = new MutationObserver(() => {
observeContentElements(resizeObserver);
checkOverflow();
});
mutationObserver.observe(element, {
childList: true,
subtree: true,
});
return () => { return () => {
cancelAnimationFrame(frameId); cancelAnimationFrame(frameId);
mutationObserver.disconnect();
resizeObserver.disconnect(); resizeObserver.disconnect();
}; };
}, []); }, []);