diff --git a/app/static/app.css b/app/static/app.css index a85cd93..71de555 100644 --- a/app/static/app.css +++ b/app/static/app.css @@ -284,14 +284,6 @@ desk-jobs, desk-schedules, auth-account { --desk-jobs-gap: var(--gap); --desk-jobs-radius: var(--radius); } -/* pipeline 21c5faa gave the schedule table a narrow layout, but its - kind/next/last columns are sized to their untruncated content rather than - the width their own ellipsis implies, which still squeezes the name and - cadence columns to a sliver at 375px -- a fix that has to land in - ../boilerplate first, or the next refresh reverts it (see CLAUDE.md). Kept - until then so the odd pixel that still overflows scrolls inside its own - box rather than widening the page. */ -desk-schedules { overflow-x: auto; } /* -- roledesk's tabs ------------------------------------------------------ */ /* Roles, Applications, Agents and Companies, drawn by static/roles.js. */ diff --git a/pipeline/web/static/schedules.js b/pipeline/web/static/schedules.js index c6a7cd9..9276b51 100644 --- a/pipeline/web/static/schedules.js +++ b/pipeline/web/static/schedules.js @@ -128,17 +128,24 @@ button[disabled] { opacity: .4; cursor: default; } input[type="checkbox"] { width: 1.4rem; height: 1.4rem; } } -/* A phone: seven columns do not fit in 375 pixels, so each row folds to two - * lines instead -- name, kind and the switch on top, cadence, next, last and - * the actions underneath -- and the header goes, since there is nothing left - * to label. */ +/* A phone: seven columns do not fit in 375 pixels, so each row folds to + * three lines instead -- name, kind and the switch on top, cadence, next + * and last in the middle, the two buttons across the bottom -- and the + * header goes, since there is nothing left to label. + * + * The middle and last columns are sized with minmax(0, ...) rather than + * auto: auto sizes a track to its content's natural, unwrapped width, which + * for a nowrap cell is the whole string -- so a long kind or timestamp + * pushed the name column down to nothing. minmax(0, ...) caps how wide a + * track may grow but still lets it shrink to fit, and each of those cells + * gets its own ellipsis instead. */ @media (max-width: 40rem) { .panel { padding: 0; } table, tbody { display: block; } thead { display: none; } tr { display: grid; - grid-template-columns: 1fr auto auto auto; + grid-template-columns: minmax(0, 1fr) minmax(0, 6rem) minmax(0, 5rem); column-gap: 8px; row-gap: 2px; align-items: center; @@ -148,19 +155,23 @@ button[disabled] { opacity: .4; cursor: default; } tr:last-child { border-bottom: 0; } td, th { display: block; padding: 0; border: 0; min-width: 0; } td:empty { display: none; } - td.name { grid-column: 1; grid-row: 1; font-size: 14px; } - td.kind { grid-column: 2 / 4; grid-row: 1; } - td.on { grid-column: 4; grid-row: 1; justify-self: end; } + td.name { grid-column: 1; grid-row: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + td.kind { grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + td.on { grid-column: 3; grid-row: 1; justify-self: end; } td.cadence { grid-column: 1; grid-row: 2; } td.next { grid-column: 2; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } td.last { grid-column: 3; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } td.actions { - grid-column: 4; grid-row: 2; justify-self: end; + grid-column: 1 / -1; grid-row: 3; justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; } td.actions button { margin: 0; } - /* A box that looks like text until hovered has nothing to hover with. */ - input.cadence { border-color: color-mix(in srgb, var(--desk-jobs-fg) 20%, transparent); min-width: 0; width: 100%; } + /* A box that looks like text until hovered has nothing to hover with. + * box-sizing: border-box, because the base rule's padding and border are + * content-box -- width: 100% of a border-box cell plus that padding and + * border is wider than the cell, which is exactly the sliver this media + * query exists to not reintroduce. */ + input.cadence { border-color: color-mix(in srgb, var(--desk-jobs-fg) 20%, transparent); min-width: 0; width: 100%; box-sizing: border-box; } /* The add row: label over field, each field the width of the card. */ tr.adder { grid-template-columns: 1fr; } tr.adder td { grid-column: 1; } @@ -171,7 +182,10 @@ button[disabled] { opacity: .4; cursor: default; } color: var(--desk-jobs-dim); font-weight: 600; } - tr.adder input, tr.adder select { width: 100%; min-width: 0; border-color: color-mix(in srgb, var(--desk-jobs-fg) 20%, transparent); } + tr.adder input, tr.adder select { + width: 100%; min-width: 0; box-sizing: border-box; + border-color: color-mix(in srgb, var(--desk-jobs-fg) 20%, transparent); + } } `;