forge
Explore
Log in

Don't you dare go Hollow

A subtask says where it sits on one line, in order

Browse files at this commit

b84949c59c61513afbe6a406d83e4e71d4b07063Ahmet Kaan GümüşParent: 68a303e
  • fix
    • a subtask says where it sits on one line, in order
Show full message
🎨 fix(web): a subtask says where it sits on one line, in order

The masthead stacked two keys in the same mono a line apart — the
parent's above, the task's own below — and nothing said which was which.
An arrow was the only hint, and it pointed at a line that read as a
caption rather than a way out.

They are one breadcrumb now: the whole, then this, left to right, ending
in the key the page already showed. The parent's title rides with its
key, because `DZ-5NJJM` on its own names nothing a person can recognise,
and it is the part that truncates when the line runs out — a key broken
across two lines is not a key any more.

The link carries a solid underline at rest. The ledger skin marks a
record's own key with a *dotted* one, so before this the only thing on
the line that looked clickable was the one thing that wasn't.

A task with no parent renders exactly what it rendered before: its key,
alone.
crates/izlek-web/src/detail.rsmodified+13 -8
@@ -1711,14 +1711,19 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab)
1711 <div class="detail-mast">1711 <div class="detail-mast">
1712 <header class="detail-head">1712 <header class="detail-head">
1713 <div class="detail-headline">1713 <div class="detail-headline">
1714- if let Some(parent) = detail.parent.clone() {1714+ // One line, read left to right: the whole, then
1715- <a class="detail-parent" href=(format!("/?task={}", parent.id))>1715+ // this. Two keys stacked in the same mono said
1716- <span class="detail-parent-arrow">"\u{2190}"</span>1716+ // nothing about which was which — order does.
1717- <span class="detail-parent-key">(parent.task_key.clone())</span>1717+ <div class="detail-crumbs">
1718- <span class="detail-parent-title">(parent.title.clone())</span>1718+ if let Some(parent) = detail.parent.clone() {
1719- </a>1719+ <a class="detail-crumb detail-crumb-up" href=(format!("/?task={}", parent.id))>
1720- }1720+ <span class="detail-crumb-key">(parent.task_key.clone())</span>
1721- <span class="detail-key">(detail.task_key.clone())</span>1721+ <span class="detail-crumb-title">(parent.title.clone())</span>
1722+ </a>
1723+ <span class="detail-crumb-sep" aria-hidden="true">"\u{203a}"</span>
1724+ }
1725+ <span class="detail-key">(detail.task_key.clone())</span>
1726+ </div>
1722 (title_control(cx, &detail, may_write, lang).await?)1727 (title_control(cx, &detail, may_write, lang).await?)
1723 </div>1728 </div>
1724 <span class="detail-state">1729 <span class="detail-state">
crates/izlek-web/tests/http.rsmodified+2 -2
@@ -1521,7 +1521,7 @@ async fn taking_a_task_in_and_letting_it_out_are_the_same_form() {
1521 let page = String::from_utf8_lossy(&page.bytes);1521 let page = String::from_utf8_lossy(&page.bytes);
1522 // The way back up: a link that names the whole, not a caption.1522 // The way back up: a link that names the whole, not a caption.
1523 assert!(1523 assert!(
1524- page.contains("detail-parent") && page.contains(&format!("/?task={parent}")),1524+ page.contains("detail-crumb-up") && page.contains(&format!("/?task={parent}")),
1525 "the part does not link back to its whole"1525 "the part does not link back to its whole"
1526 );1526 );
1527 assert!(1527 assert!(
@@ -1805,7 +1805,7 @@ async fn the_parts_have_a_tab_and_a_subtask_is_not_offered_one() {
1805 "a subtask rendered the Subtasks tab"1805 "a subtask rendered the Subtasks tab"
1806 );1806 );
1807 assert!(1807 assert!(
1808- forced.contains("detail-parent"),1808+ forced.contains("detail-crumb-up"),
1809 "the fallback did not render the task itself"1809 "the fallback did not render the task itself"
1810 );1810 );
1811 }1811 }
style/main.scssmodified+48 -12
@@ -1446,35 +1446,71 @@ img.avatar {
1446 color: var(--muted-soft);1446 color: var(--muted-soft);
1447 }1447 }
1448 1448
1449-// A subtask names the whole it belongs to, above its own key, and that name1449+// Where this task sits, on one line above its title. A subtask stacked its
1450-// is the way back up. An arrow and the parent's title rather than a bare1450+// parent's key above its own read as two near-identical mono strings with
1451-// caption: "Part of DZ-14" read as a label, and nobody tried to click it.1451+// nothing to say which was which; left-to-right order says it instead, and
1452-.detail-parent {1452+// the parent's title is what makes its key legible at all.
1453+.detail-crumbs {
1453 display: flex;1454 display: flex;
1454- align-items: center;1455+ align-items: baseline;
1455 gap: 6px;1456 gap: 6px;
1456- font-size: 11px;1457+ min-width: 0;
1458+ // The parent's title is the only part allowed to give way; a key broken
1459+ // across two lines is not a key any more.
1460+ flex-wrap: nowrap;
1461+
1462+ .detail-key {
1463+ flex: none;
1464+ white-space: nowrap;
1465+ }
1466+}
1467+
1468+.detail-crumb {
1469+ display: flex;
1470+ align-items: baseline;
1471+ gap: 6px;
1472+ min-width: 0;
1473+ flex: 0 1 auto;
1457 color: var(--muted);1474 color: var(--muted);
1458 text-decoration: none;1475 text-decoration: none;
1459- width: fit-content;
1460 1476
1461 &:hover {1477 &:hover {
1462 color: var(--ink);1478 color: var(--ink);
1463 1479
1464- .detail-parent-title { text-decoration: underline; }1480+ .detail-crumb-title { text-decoration: underline; }
1465 }1481 }
1466 }1482 }
1467 1483
1468-.detail-parent-arrow,1484+.detail-crumb-key {
1469-.detail-parent-key {1485+ flex: none;
1470 font-family: var(--font-mono);1486 font-family: var(--font-mono);
1487+ font-size: 11px;
1471 }1488 }
1472 1489
1473-.detail-parent-title {1490+// Underlined at rest, solid: the ledger skin marks a record's own key with a
1491+// *dotted* underline, so without this the one thing on the line that is not
1492+// a link was the only thing that looked like one.
1493+.detail-crumb-title {
1474 overflow: hidden;1494 overflow: hidden;
1475 text-overflow: ellipsis;1495 text-overflow: ellipsis;
1476 white-space: nowrap;1496 white-space: nowrap;
1477- max-width: 30ch;1497+ max-width: 28ch;
1498+ flex: 0 1 auto;
1499+ min-width: 3ch;
1500+ font-size: 12px;
1501+ text-decoration: underline;
1502+ text-decoration-color: var(--border-strong);
1503+ text-underline-offset: 3px;
1504+}
1505+
1506+.detail-crumb:hover .detail-crumb-title {
1507+ text-decoration-color: currentColor;
1508+}
1509+
1510+.detail-crumb-sep {
1511+ flex: none;
1512+ font-size: 11px;
1513+ color: var(--muted-soft);
1478 }1514 }
1479 1515
1480 .detail-title {1516 .detail-title {