Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clark/page/shell.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/clark/page/src/edit/edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ body > .gt-menu.leaving hr { border: 0; border-top: 1px solid var(--border); mar
}

/* 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. */
@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; } }
@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; } }

/* 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. */
@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; } }
Expand Down
4 changes: 3 additions & 1 deletion tests/test_edit_cells_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
const walker = document.createTreeWalker(v, NodeFilter.SHOW_TEXT); let n;
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++; } }
out.push({ field, text: v.textContent.trim().slice(0, 30), pick: Math.round(b.getBoundingClientRect().height), val: Math.round(v.getBoundingClientRect().height),
lines: lines(v), reach: Math.round(v.getBoundingClientRect().right - b.closest('td').getBoundingClientRect().right), broken, over: b.scrollWidth > b.clientWidth + 1, spill: spill(v) });
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; })()) });
}
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
return JSON.stringify({ cells: out, pills, sw: document.documentElement.scrollWidth, vw: innerWidth });
Expand Down Expand Up @@ -90,6 +90,8 @@ def test_every_edit_cell_is_one_tidy_box_at_both_widths_in_both_looks(self):
label = f"{where}: {c['field']} '{c['text']}'"
self.assertEqual(c["broken"], 0, label + " has a word broken in the middle")
self.assertFalse(c["over"], label + " runs outside its box")
if c["field"] == "priority": # row 1195 S2: a wider font (the Mac's) must still fit the pill and its caret in the cell
self.assertGreaterEqual(c["spare"], 12, label + " leaves less than 12 px spare in its cell")
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
self.assertLessEqual(c["spill"], 1, label + " runs past its value box into the caret")
self.assertLessEqual(c["pick"] - c["val"], 12, label + ": the caret has a line of its own (the box is taller than the value)")
Expand Down
Loading