Skip to content

Commit 2922c66

Browse files
Merge pull request #116 from niteeshkanna-sh/claude/stoic-rubin-fnglq7
Records lists: scroll the table, pin the actions
2 parents d255036 + e058ec1 commit 2922c66

3 files changed

Lines changed: 78 additions & 20 deletions

File tree

‎admin/admin.css‎

Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,15 +1360,34 @@ label.finance-toggle {
13601360
}
13611361
.rec-icon-btn:hover { background: var(--bg); color: var(--ink); }
13621362

1363+
/* A window onto the table rather than the whole of it.
1364+
1365+
Both ways: sideways because a row is one line now and a line of eight
1366+
columns is wider than the panel, and downwards because a page of records is
1367+
taller than the screen and scrolling the whole page took the column names
1368+
away with it. Capped rather than fixed, so three bookings still make a short
1369+
table.
1370+
1371+
overscroll-behavior stops a flick that reaches the bottom of this box from
1372+
carrying on and scrolling the page behind it. */
13631373
.rec-tablewrap {
13641374
background: var(--surface); border: 1px solid var(--border);
1365-
border-radius: 16px; overflow-x: auto;
1375+
border-radius: 16px; overflow: auto;
1376+
max-height: min(72vh, 700px);
1377+
overscroll-behavior: contain;
13661378
}
1367-
.rec-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
1379+
1380+
/* separate, not collapse: a collapsed border belongs to the table rather than
1381+
to the cell, and a sticky cell carries its own borders with it or carries
1382+
none at all. With no vertical rules in this table the two look identical. */
1383+
.rec-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.86rem; }
13681384
.rec-table th {
13691385
text-align: left; padding: 13px 12px; white-space: nowrap;
13701386
font-size: 0.71rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
13711387
color: var(--ink-faint); border-bottom: 1px solid var(--border); background: var(--surface);
1388+
/* Stays on screen while the rows go past it. A column of dates with no
1389+
heading is a column of numbers. */
1390+
position: sticky; top: 0; z-index: 2;
13721391
}
13731392
.rec-table th.is-sortable { cursor: pointer; user-select: none; }
13741393
.rec-table th.is-sortable:hover { color: var(--ink); }
@@ -1387,20 +1406,20 @@ label.finance-toggle {
13871406
cost the row a line for nothing. */
13881407
.rec-table .rec-when { white-space: nowrap; }
13891408

1390-
/* A cell laid out across instead of down.
1409+
/* A cell laid out across instead of down, and kept that way.
13911410
1392-
It wraps rather than forcing the table sideways. Nowrap on the whole line
1393-
would have made the column's minimum width its full length, and eight such
1394-
columns come to about 1390 pixels -- fine on a desk, a horizontal scrollbar
1395-
on a 1280 laptop. Wrapping means the line is one line wherever it fits and
1396-
quietly becomes two where it does not, which is what the old stacked layout
1397-
was doing everywhere.
1411+
It used to wrap when the panel ran out of room, which kept the table inside
1412+
the window at the cost of the thing the layout was for: at 1440 the rows
1413+
folded back to two lines and no two rows folded in the same place, so the
1414+
columns stopped lining up. The box above scrolls instead. A row is one line
1415+
at every width now, every row the same height, and the eye can run down a
1416+
column.
13981417
1399-
The parts themselves never break: half a phone number on each of two lines
1400-
is worse than either. */
1418+
Nothing inside breaks either: half a phone number on each of two lines is
1419+
worse than either half. */
14011420
.rec-table .rec-line {
1402-
display: flex; flex-wrap: wrap; align-items: baseline;
1403-
column-gap: 7px; row-gap: 1px; min-width: 0;
1421+
display: flex; align-items: baseline;
1422+
gap: 7px; min-width: 0; white-space: nowrap;
14041423
}
14051424
.rec-table .rec-line > * { flex: none; white-space: nowrap; }
14061425

@@ -1421,8 +1440,31 @@ label.finance-toggle {
14211440

14221441
/* Two pills read as one unit, and sit centred on each other rather than on a
14231442
baseline their padding has already moved. */
1424-
.rec-table .rec-line-chips { align-items: center; column-gap: 6px; row-gap: 5px; }
1425-
.rec-table .rec-act { width: 1%; white-space: nowrap; }
1443+
.rec-table .rec-line-chips { align-items: center; gap: 6px; }
1444+
/* The actions stay against the right edge while the rest of the row slides
1445+
under them. They are the reason most people are looking at the list at all,
1446+
and hunting for them by scrolling is a strange thing to ask.
1447+
1448+
Opaque, because the row passes behind it -- including on hover, which the
1449+
row's own background change would otherwise leave stranded here. The rule
1450+
down its left edge is what says the column is pinned rather than merely
1451+
last. */
1452+
.rec-table .rec-act {
1453+
width: 1%; white-space: nowrap;
1454+
position: sticky; right: 0; z-index: 1;
1455+
background: var(--surface);
1456+
border-left: 1px solid var(--border);
1457+
}
1458+
/* The shadow only when there is something passing underneath. On a screen
1459+
wide enough for the whole table this is simply the last column, and an edge
1460+
drawn there would be an edge drawn for no reason. The class is set by
1461+
renderRecTable, which is the only thing that knows. */
1462+
.rec-tablewrap.has-overflow-x .rec-act {
1463+
box-shadow: -10px 0 10px -10px rgb(0 0 0 / 0.18);
1464+
}
1465+
.rec-table tbody tr:hover .rec-act { background: var(--bg); }
1466+
/* The corner: pinned both ways, so it must sit above both. */
1467+
.rec-table thead .rec-act { z-index: 3; }
14261468
.rec-unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
14271469
/* On the last part of the name line rather than on the name itself. The name
14281470
clips with an ellipsis now, so a marker inside it would vanish exactly when

‎admin/admin.js‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,12 @@ function renderRecTable(opts) {
15821582
<th class="rec-sno">S. No</th>
15831583
${columns.map((c) => `
15841584
<th class="is-sortable${c.key === view.sort ? ' is-sorted' : ''}${
1585-
c.hide ? ' rec-hide-sm' : ''}" data-sort="${c.key}"
1585+
c.hide ? ' rec-hide-sm' : ''}${
1586+
// The column's own class on the heading as well as the cells.
1587+
// Width, alignment and -- the reason it was added -- being
1588+
// pinned to an edge are properties of the column, and a
1589+
// heading that does not share them slides off on its own.
1590+
c.cls ? ` ${c.cls}` : ''}" data-sort="${c.key}"
15861591
aria-sort="${c.key === view.sort ? (view.dir === 'asc' ? 'ascending' : 'descending') : 'none'}">
15871592
${escapeHTML(c.label)}<span class="ord">${
15881593
c.key === view.sort ? (view.dir === 'asc' ? '▲' : '▼') : '⇅'}</span>
@@ -1600,6 +1605,17 @@ function renderRecTable(opts) {
16001605
</table>
16011606
</div>`;
16021607

1608+
// Whether the pinned Action column has anything sliding under it. CSS
1609+
// cannot ask that question, and the answer changes with the window, with
1610+
// the sidebar, and with the longest name in the current page of rows.
1611+
const box = wrap.querySelector('.rec-tablewrap');
1612+
const table = box.querySelector('.rec-table');
1613+
const markOverflow = () => {
1614+
box.classList.toggle('has-overflow-x', table.scrollWidth > box.clientWidth + 1);
1615+
};
1616+
markOverflow();
1617+
new ResizeObserver(markOverflow).observe(box);
1618+
16031619
wrap.querySelectorAll('th[data-sort]').forEach((th) => {
16041620
th.addEventListener('click', () => {
16051621
const key = th.dataset.sort;

‎build.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"publishedAt": "2026-10-01T07:48:03.413Z",
3-
"commit": "54970509",
4-
"commitAt": "2026-09-30T12:01:16+05:30",
5-
"sourceHash": "04add428efb68d32",
2+
"publishedAt": "2026-10-01T08:06:37.036Z",
3+
"commit": "d255036d",
4+
"commitAt": "2026-10-01T13:19:43+05:30",
5+
"sourceHash": "9a1db0a8e403649e",
66
"assets": [
77
"About-BzCVrfp8.js",
88
"Bikes-Dv_LRU5Z.js",

0 commit comments

Comments
 (0)