fix: prevent value overflow in Assets vs Liabilities card (#992)

* fix: prevent value overflow in Assets vs Liabilities card

Fixes issue where large asset/liability values overflow the container
when AI side panel is open and reduces horizontal space.

Changes:
- Added flex-wrap to allow values to wrap to next line if needed
- Added break-all to both asset and liability values for long numbers
- Added shrink-0 to minus sign to prevent it from shrinking

Fixes #976

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* refactor: use break-words instead of break-all per code review

Changed from break-all to break-words for currency values to prevent
awkward mid-number breaks (e.g., $1,234,5 / 67.89). break-words only
breaks when content overflows and keeps values intact when possible,
providing cleaner line breaks while still preventing overflow.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
aviu16
2026-02-15 03:31:15 -05:00
committed by GitHub
parent 170bd2858d
commit bd34165426

View File

@@ -28,10 +28,10 @@
<%# Assets vs Liabilities %>
<div class="p-4 bg-surface-inset rounded-lg">
<p class="text-sm text-secondary mb-2"><%= t("reports.net_worth.assets_vs_liabilities") %></p>
<div class="flex items-baseline gap-2">
<span class="text-lg font-semibold text-success"><%= net_worth_metrics[:total_assets].format %></span>
<span class="text-xs text-tertiary">-</span>
<span class="text-lg font-semibold text-destructive"><%= net_worth_metrics[:total_liabilities].format %></span>
<div class="flex items-baseline gap-2 flex-wrap">
<span class="text-lg font-semibold text-success break-words"><%= net_worth_metrics[:total_assets].format %></span>
<span class="text-xs text-tertiary shrink-0">-</span>
<span class="text-lg font-semibold text-destructive break-words"><%= net_worth_metrics[:total_liabilities].format %></span>
</div>
</div>
</div>