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)
17111711 <div class="detail-mast">
17121712 <header class="detail-head">
17131713 <div class="detail-headline">
1714- if let Some(parent) = detail.parent.clone() {
1715- <a class="detail-parent" href=(format!("/?task={}", parent.id))>
1716- <span class="detail-parent-arrow">"\u{2190}"</span>
1717- <span class="detail-parent-key">(parent.task_key.clone())</span>
1718- <span class="detail-parent-title">(parent.title.clone())</span>
1719- </a>
1720- }
1721- <span class="detail-key">(detail.task_key.clone())</span>
1714+ // One line, read left to right: the whole, then
1715+ // this. Two keys stacked in the same mono said
1716+ // nothing about which was which — order does.
1717+ <div class="detail-crumbs">
1718+ if let Some(parent) = detail.parent.clone() {
1719+ <a class="detail-crumb detail-crumb-up" href=(format!("/?task={}", parent.id))>
1720+ <span class="detail-crumb-key">(parent.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>
17221727 (title_control(cx, &detail, may_write, lang).await?)
17231728 </div>
17241729 <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() {
15211521 let page = String::from_utf8_lossy(&page.bytes);
15221522 // The way back up: a link that names the whole, not a caption.
15231523 assert!(
1524- page.contains("detail-parent") && page.contains(&format!("/?task={parent}")),
1524+ page.contains("detail-crumb-up") && page.contains(&format!("/?task={parent}")),
15251525 "the part does not link back to its whole"
15261526 );
15271527 assert!(
@@ -1805,7 +1805,7 @@ async fn the_parts_have_a_tab_and_a_subtask_is_not_offered_one() {
18051805 "a subtask rendered the Subtasks tab"
18061806 );
18071807 assert!(
1808- forced.contains("detail-parent"),
1808+ forced.contains("detail-crumb-up"),
18091809 "the fallback did not render the task itself"
18101810 );
18111811 }
style/main.scssmodified+48 -12
@@ -1446,35 +1446,71 @@ img.avatar {
14461446 color: var(--muted-soft);
14471447 }
14481448
1449-// A subtask names the whole it belongs to, above its own key, and that name
1450-// is the way back up. An arrow and the parent's title rather than a bare
1451-// caption: "Part of DZ-14" read as a label, and nobody tried to click it.
1452-.detail-parent {
1449+// Where this task sits, on one line above its title. A subtask stacked its
1450+// parent's key above its own read as two near-identical mono strings with
1451+// nothing to say which was which; left-to-right order says it instead, and
1452+// the parent's title is what makes its key legible at all.
1453+.detail-crumbs {
14531454 display: flex;
1454- align-items: center;
1455+ align-items: baseline;
14551456 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;
14571474 color: var(--muted);
14581475 text-decoration: none;
1459- width: fit-content;
14601476
14611477 &:hover {
14621478 color: var(--ink);
14631479
1464- .detail-parent-title { text-decoration: underline; }
1480+ .detail-crumb-title { text-decoration: underline; }
14651481 }
14661482 }
14671483
1468-.detail-parent-arrow,
1469-.detail-parent-key {
1484+.detail-crumb-key {
1485+ flex: none;
14701486 font-family: var(--font-mono);
1487+ font-size: 11px;
14711488 }
14721489
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 {
14741494 overflow: hidden;
14751495 text-overflow: ellipsis;
14761496 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);
14781514 }
14791515
14801516 .detail-title {