forge
Explore
Log in

Don't you dare go Hollow

The task names itself at the 200th comment

Browse files at this commit

5c90078c5c8bacdeed30f3fdc5ea1434497e508dAhmet Kaan GümüşParent: 75600c3
  • feat
    • the task names itself at the 200th comment
Show full message
🎨 feat(web): the task names itself at the 200th comment

Key, title, state and the tab strip ride together as one masthead. On the
panel it was already outside the scrolling body; on the paper page it
panned away with everything else, so by the 200th comment nothing on
screen said which task you were reading. The masthead holds at the top of
the paper now, carrying the page's top margin in its own padding so it
sits flush, and the body runs beneath it.
crates/izlek-web/src/detail.rsmodified+48 -43
@@ -1438,50 +1438,55 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab)
14381438 cx =>
14391439 <div class="modal-scrim">
14401440 <div class="modal modal-task" tabindex="-1">
1441- <header class="detail-head">
1442- <div class="detail-headline">
1443- <span class="detail-key">(detail.task_key.clone())</span>
1444- (title_control(cx, &detail, may_write, lang).await?)
1445- </div>
1446- <span class="detail-state">
1447- if may_write {
1448- <form class="status-form" method="post" action="/api/move_card">
1449- <input type="hidden" name="task_id" value=(detail.id.clone())>
1450- <input type="hidden" name="from_column_id" value=(detail.column.id.clone())>
1451- <span class=(class!("status-dot", "status-dot-done" if detail.column.is_done))></span>
1452- <select class="status-select" name="to_column_id" data-autosubmit="">
1453- for column in &detail.columns {
1454- <option value=(column.id.clone()) selected=(column.id == detail.column.id)>(column.name.clone())</option>
1455- }
1456- </select>
1457- (glyph::chevron(cx).await?)
1458- </form>
1459- } else {
1460- <span class="field-box">
1461- <span class="status-dot"></span>
1462- <span class="field-text">(detail.column.name.clone())</span>
1463- </span>
1464- }
1465- </span>
1466- <div class="spacer"></div>
1467- <span class="detail-esc">(t(lang, Key::Esc))</span>
1468- <a class="detail-close" href="/" aria-label=(t(lang, Key::CloseThisTask))>(glyph::cross(cx).await?)</a>
1469- <a class="quiet detail-board" href="/">(format!("<- {}", t(lang, Key::NavBoard)))</a>
1470- </header>
1441+ // Key, title, state and the tabs ride together as one masthead:
1442+ // pinned, so the task still names itself at the 200th comment.
1443+ <div class="detail-mast">
1444+ <header class="detail-head">
1445+ <div class="detail-headline">
1446+ <span class="detail-key">(detail.task_key.clone())</span>
1447+ (title_control(cx, &detail, may_write, lang).await?)
1448+ </div>
1449+ <span class="detail-state">
1450+ if may_write {
1451+ <form class="status-form" method="post" action="/api/move_card">
1452+ <input type="hidden" name="task_id" value=(detail.id.clone())>
1453+ <input type="hidden" name="from_column_id" value=(detail.column.id.clone())>
1454+ <span class=(class!("status-dot", "status-dot-done" if detail.column.is_done))></span>
1455+ <select class="status-select" name="to_column_id" data-autosubmit="">
1456+ for column in &detail.columns {
1457+ <option value=(column.id.clone()) selected=(column.id == detail.column.id)>(column.name.clone())</option>
1458+ }
1459+ </select>
1460+ (glyph::chevron(cx).await?)
1461+ </form>
1462+ } else {
1463+ <span class="field-box">
1464+ <span class="status-dot"></span>
1465+ <span class="field-text">(detail.column.name.clone())</span>
1466+ </span>
1467+ }
1468+ </span>
1469+ <div class="spacer"></div>
1470+ <span class="detail-esc">(t(lang, Key::Esc))</span>
1471+ <a class="detail-close" href="/" aria-label=(t(lang, Key::CloseThisTask))>(glyph::cross(cx).await?)</a>
1472+ <a class="quiet detail-board" href="/">(format!("<- {}", t(lang, Key::NavBoard)))</a>
1473+ </header>
1474+
1475+ <nav class="detail-tabs">
1476+ <a class=(tab_class(tab, Tab::Task)) href=(format!("/?task={}&tab={}", detail.id, Tab::Task.slug()))>(t(lang, Key::TabTask))</a>
1477+ <a class=(tab_class(tab, Tab::Files)) href=(format!("/?task={}&tab={}", detail.id, Tab::Files.slug()))>
1478+ (t(lang, Key::Files))
1479+ if !detail.files.is_empty() { <span class="detail-tab-count">(detail.files.len())</span> }
1480+ </a>
1481+ <a class=(tab_class(tab, Tab::Comments)) href=(format!("/?task={}&tab={}", detail.id, Tab::Comments.slug()))>
1482+ (t(lang, Key::Comments))
1483+ if !detail.comments.is_empty() { <span class="detail-tab-count">(detail.comments.len())</span> }
1484+ </a>
1485+ <a class=(tab_class(tab, Tab::Activity)) href=(format!("/?task={}&tab={}", detail.id, Tab::Activity.slug()))>(t(lang, Key::Activity))</a>
1486+ <a class=(tab_class(tab, Tab::Mail)) href=(format!("/?task={}&tab={}", detail.id, Tab::Mail.slug()))>(t(lang, Key::TabMail))</a>
1487+ </nav>
1488+ </div>
14711489
1472- <nav class="detail-tabs">
1473- <a class=(tab_class(tab, Tab::Task)) href=(format!("/?task={}&tab={}", detail.id, Tab::Task.slug()))>(t(lang, Key::TabTask))</a>
1474- <a class=(tab_class(tab, Tab::Files)) href=(format!("/?task={}&tab={}", detail.id, Tab::Files.slug()))>
1475- (t(lang, Key::Files))
1476- if !detail.files.is_empty() { <span class="detail-tab-count">(detail.files.len())</span> }
1477- </a>
1478- <a class=(tab_class(tab, Tab::Comments)) href=(format!("/?task={}&tab={}", detail.id, Tab::Comments.slug()))>
1479- (t(lang, Key::Comments))
1480- if !detail.comments.is_empty() { <span class="detail-tab-count">(detail.comments.len())</span> }
1481- </a>
1482- <a class=(tab_class(tab, Tab::Activity)) href=(format!("/?task={}&tab={}", detail.id, Tab::Activity.slug()))>(t(lang, Key::Activity))</a>
1483- <a class=(tab_class(tab, Tab::Mail)) href=(format!("/?task={}&tab={}", detail.id, Tab::Mail.slug()))>(t(lang, Key::TabMail))</a>
1484- </nav>
14851490
14861491 <div class="detail-body">
14871492 if tab == Tab::Task {
style/_ledger.scssmodified+14 -4
@@ -269,10 +269,10 @@
269269 [data-ui="ledger"] .modal-scrim:has(> .modal-task) {
270270 background: var(--bg);
271271 justify-content: center;
272- // No bottom padding: the sticky foot below carries the page's trailing
273- // margin in its own padding, so it can sit flush on the pan surface's edge
274- // instead of floating with text showing beneath it.
275- padding: 36px 40px 0;
272+ // Neither top nor bottom padding: the sticky masthead and foot carry the
273+ // page's margins in their own padding, so both sit flush on the pan
274+ // surface's edges instead of floating with text showing past them.
275+ padding: 0 40px;
276276 }
277277
278278 [data-ui="ledger"] .modal-task {
@@ -306,6 +306,16 @@
306306 margin-top: 14px;
307307 }
308308
309+// The masthead holds at the top of the paper: the task names itself however
310+// far down the comments you are.
311+[data-ui="ledger"] .detail-mast {
312+ position: sticky;
313+ top: 0;
314+ z-index: 2;
315+ padding: 36px 0 6px;
316+ background: var(--bg);
317+}
318+
309319 [data-ui="ledger"] .modal-task .detail-esc,
310320 [data-ui="ledger"] .modal-task .detail-close,
311321 [data-ui="ledger"] .detail-body .detail-field-status {
style/main.scssmodified+4 -0
@@ -1088,6 +1088,10 @@ img.avatar {
10881088 overflow: visible;
10891089 }
10901090
1091+.detail-mast {
1092+ flex: none;
1093+}
1094+
10911095 .detail-body {
10921096 flex: 1;
10931097 min-height: 0;