Skip to content

Commit f8458f9

Browse files
authored
Merge pull request #1904
Row 1195: the Priority column keeps room for the pill and its caret in a wider font
2 parents 8880b8b + f73be96 commit f8458f9

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/clark/page/shell.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/clark/page/src/edit/edit.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ body > .gt-menu.leaving hr { border: 0; border-top: 1px solid var(--border); mar
11491149
}
11501150

11511151
/* row 940 (macOS gate, test_edit_cells_layout): in Edit at 900 px and below the Due, priority and status columns are 8 px wider than the bare minimum, so a font a little wider than Linux's (macOS draws these three 2 to 3 px wider) stays inside its box. EDIT ONLY: shell.css is also the published page's, whose Item column must stay at least 280 px (test_published_item_column), so the widths are not set there. Same specificity as shell.css's 900 px rule and later in the page, so these win without !important. */
1152-
@media (max-width: 900px) { table.items .c-due { width: 139px; } table.items .c-prio { width: 101px; } table.items .c-status { width: 76px; } table.items.arch .c-status { width: 150px; } }
1152+
@media (max-width: 900px) { table.items .c-due { width: 139px; } table.items .c-prio { width: 121px; } table.items .c-status { width: 76px; } table.items.arch .c-status { width: 150px; } }
11531153

11541154
/* row 834: at 900 px an item's meta line (ID, use case, plan) is one line cut short with an ellipsis, as in the prototype (nowrap), so a row is at most two title lines and one meta line (82 px, the prototype's 81) and not three lines of meta. EDIT ONLY: shell.css is also the published page's. */
11551155
@media (max-width: 900px) { table.items .c-owner { width: 130px; } #work table.items .tcell .tx { min-width: 0; } #work table.items .tcell .meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

‎tests/test_edit_cells_layout.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
const walker = document.createTreeWalker(v, NodeFilter.SHOW_TEXT); let n;
3535
while ((n = walker.nextNode())) { const re = /\S+/g; let m; while ((m = re.exec(n.textContent))) { const r = document.createRange(); r.setStart(n, m.index); r.setEnd(n, m.index + m[0].length); if (new Set([...r.getClientRects()].filter((x) => x.width > 0).map((x) => Math.round(x.top))).size > 1) broken++; } }
3636
out.push({ field, text: v.textContent.trim().slice(0, 30), pick: Math.round(b.getBoundingClientRect().height), val: Math.round(v.getBoundingClientRect().height),
37-
lines: lines(v), reach: Math.round(v.getBoundingClientRect().right - b.closest('td').getBoundingClientRect().right), broken, over: b.scrollWidth > b.clientWidth + 1, spill: spill(v) });
37+
lines: lines(v), reach: Math.round(v.getBoundingClientRect().right - b.closest('td').getBoundingClientRect().right), broken, over: b.scrollWidth > b.clientWidth + 1, spill: spill(v), spare: Math.round((() => { const td = b.closest('td'), cs = getComputedStyle(td); return td.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight) - b.getBoundingClientRect().width; })()) });
3838
}
3939
const pills = [...document.querySelectorAll('table.items td.c-item .kb')].map((p) => ({ text: p.getAttribute('title'), h: Math.round(p.getBoundingClientRect().height), broken: false })); // #456: the kind is a one-letter badge now
4040
return JSON.stringify({ cells: out, pills, sw: document.documentElement.scrollWidth, vw: innerWidth });
@@ -90,6 +90,8 @@ def test_every_edit_cell_is_one_tidy_box_at_both_widths_in_both_looks(self):
9090
label = f"{where}: {c['field']} '{c['text']}'"
9191
self.assertEqual(c["broken"], 0, label + " has a word broken in the middle")
9292
self.assertFalse(c["over"], label + " runs outside its box")
93+
if c["field"] == "priority": # row 1195 S2: a wider font (the Mac's) must still fit the pill and its caret in the cell
94+
self.assertGreaterEqual(c["spare"], 12, label + " leaves less than 12 px spare in its cell")
9395
if c["field"] != "owner": # an owner's long name is clipped with an ellipsis (#948): its text box reaches past what is drawn, so its reach (below) is measured instead
9496
self.assertLessEqual(c["spill"], 1, label + " runs past its value box into the caret")
9597
self.assertLessEqual(c["pick"] - c["val"], 12, label + ": the caret has a line of its own (the box is taller than the value)")

0 commit comments

Comments
 (0)