From 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 20:00:02 -0400 Subject: feat: terminal talk action, typed pai gow poker phase --- internal/ui/table.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/ui') diff --git a/internal/ui/table.go b/internal/ui/table.go index 8a056fb..437c445 100644 --- a/internal/ui/table.go +++ b/internal/ui/table.go @@ -38,6 +38,13 @@ type Table struct { Rows [][]string } +// FitWidths shrinks colWidths in place so their sum fits budget, using the +// same fair-share algorithm Table.Render uses. Exported so callers that +// pre-wrap cells can size them consistently instead of reimplementing it. +func FitWidths(colWidths []int, budget int) { + rebalanceWidths(colWidths, budget) +} + // rebalanceWidths shrinks column widths in place so their sum fits budget. // Rather than crushing only the last column, every column wider than the // fair share (budget/nCols) is capped first, then columns are trimmed one -- cgit v1.2.3