Fix resizer-narrowed transactions column: overflow, not a viewport bug

Dragging the resizer narrow on a wide screen never triggered the
existing @media(max-width:640px) stacked layout, since that only
watches the viewport, not the column itself - so the balance fields
and Recheck Balance button just overflowed the column's right edge
instead. Gave .txn-col container-type:inline-size and replaced that
media query with an equivalent @container rule, which also covers
the genuine-mobile case the old rule handled (the column is just as
narrow as the viewport there too).

Same root cause was squeezing the transactions table's Description
column unreadable: table-layout:fixed + width:100% shrinks every
column proportionally to fit, fixed-pixel ones included. Gave the
table a min-width (fixed columns' sum + a legible floor for
Description) so .table-wrap's overflow-x:auto takes over with a
horizontal scrollbar instead of compressing Description further.
This commit is contained in:
JasonFraser 2026-10-12 18:09:16 -04:00
parent 7af1749887
commit 94864273c8
2 changed files with 53 additions and 8 deletions

View File

@ -585,7 +585,26 @@ restructure; the behavior itself predates it and is unchanged:
`view=FitH` gives).
- PDF/image ("Source Document") and Transactions sit side-by-side with a draggable resizer
(`ResizablePanels.vue`, the handle styled as a vertical grip-knob), both wrapped in one
sticky flex row so they scroll as one unit (not the source-doc column alone).
sticky flex row so they scroll as one unit (not the source-doc column alone). `.txn-col`
has `container-type:inline-size`/`container-name:txncol` (added 2026-10-12) so layout
rules that need to react to *this column's own* width — not the viewport's — can use
`@container txncol (...)` instead of `@media`. This matters because the resizer can
narrow this column well below a comfortable width on an otherwise-wide screen, a case a
`@media` breakpoint never sees at all (confirmed as a real bug: the balance fields +
Recheck Balance button used to only switch to a stacked, narrow-friendly layout under an
actual narrow *viewport* — dragging the resizer narrow on a wide screen left them
overflowing the column's right edge instead, since no rule was watching the column's own
width). The `@container txncol (max-width:520px)` rule that replaced the old
`@media (max-width:640px)` one covers both cases now with one mechanism — real mobile
included, since `.txn-col` is just as narrow as the viewport there too (see the 860px
breakpoint below). Same root cause nearly broke the transactions table's own Description
column: `table-layout:fixed` + `width:100%` shrinks EVERY column proportionally
(including the fixed-pixel ones) to fit whatever width it's given, which would otherwise
squeeze Description unreadable long before the column hit its absolute 260px floor. Fixed
with `min-width:664px` on the `<table>` itself (the fixed columns' own widths sum to
504px; 160px is a legible floor for Description) — below that, `.table-wrap`'s own
`overflow-x:auto` takes over and the table scrolls horizontally instead of compressing
further, while at or above 664px `width:100%` still governs exactly as before.
- A Hide/Show toggle in the Transactions header (`TransactionsTable.vue`, driven by
`uiStore.pdfColHidden`, labeled "Hide Source Doc"/"Show Source Doc") collapses the
source-doc column so Transactions fills the row.

View File

@ -166,7 +166,18 @@ h1{ font-family:var(--fd); font-weight:800; font-size:30px; letter-spacing:-.01e
.tag.not_available{ background:rgba(16,24,40,.06); color:var(--t4); }
.table-wrap{ overflow-x:auto; margin-top:4px; }
table{ width:100%; border-collapse:collapse; font-size:12.5px; table-layout:fixed; }
/* min-width stops the Description column from being squeezed unreadable
when this panel is narrowed via the resizer - table-layout:fixed
otherwise shrinks EVERY column (including the fixed-pixel ones)
proportionally to fit width:100%, Description included, down to
illegible slivers. The fixed columns' own widths sum to 504px; 160px
is a legible floor for Description (fits several words before
wrapping) - below that combined 664px, .table-wrap's own
overflow-x:auto takes over and the table scrolls horizontally
instead of compressing further. At or above 664px, width:100% still
governs exactly as before - Description just gets whatever's left
over the fixed columns, same as it always did. */
table{ width:100%; min-width:664px; border-collapse:collapse; font-size:12.5px; table-layout:fixed; }
th{
text-align:left; padding:9px 10px; font-family:var(--fm); font-size:10px; font-weight:600;
letter-spacing:.06em; text-transform:uppercase; color:var(--t4); border-bottom:1px solid var(--border-2);
@ -333,7 +344,14 @@ tr.editing td{ background:rgba(37,99,235,.03); }
space is left after the header/fields/notes above it, rather than the
whole column growing past its sibling's height the way it did when
only .table-wrap itself had a height cap. */
.txn-col{ flex:1 1 auto; min-width:260px; display:flex; flex-direction:column; height:82vh; }
/* container-type lets the fields-row/table rules below respond to
THIS column's own rendered width (via @container) rather than the
viewport's - needed because the resizer can narrow this column on an
otherwise-wide screen, which a @media viewport breakpoint never sees. */
.txn-col{
flex:1 1 auto; min-width:260px; display:flex; flex-direction:column; height:82vh;
container-type:inline-size; container-name:txncol;
}
.txn-col-head{
display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; flex-shrink:0;
}
@ -370,11 +388,19 @@ tr.editing td{ background:rgba(37,99,235,.03); }
.resizer{ display:none; }
.txn-col{ width:100%; }
}
/* Mobile: the Recheck Balance button drops below the closing-balance
field instead of sitting beside the fields at the row's right edge -
860px (the breakpoint above) still has plenty of width for both side
by side, so this is its own, narrower cutoff. */
@media (max-width: 640px){
/* The Recheck Balance button drops below the closing-balance field
instead of sitting beside the fields at the row's right edge, once
THIS COLUMN (not the viewport) gets too narrow for both side by side -
a @container query, not @media, because the resizer can narrow this
column on an otherwise-wide screen; a viewport breakpoint never saw
that case, which is what let the fields/button overflow the column's
right edge instead of wrapping (reported 2026-10-12). 520px is comfortably
above the ~500px the row's content actually needs, so this switches
before the overflow, not after. Also covers the genuine-mobile case
the old @media (max-width:640px) rule handled, since the column is
just as narrow as the viewport once the two panels stack (see the
860px breakpoint above) - one mechanism for both causes now. */
@container txncol (max-width: 520px){
.fields-row{ flex-direction:column; align-items:stretch; }
.recheck-spacer{ display:none; }
.btn-recheck{ align-self:flex-end; }