- if done { (glyph::tick(cx).await?) } else { (glyph::lock(cx).await?) }
-
+ // One link, not two: the key and the title are the same target,
+ // so the whole of the row's text is the way in.
+
+
+ if done { (glyph::tick(cx).await?) } else { (glyph::ring(cx).await?) }
+
+ (part.task_key.clone())
+ (part.title.clone())
+
-
(status)
+
(status)
for face in faces { (face) }
@@ -1683,7 +1702,9 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab)
if let Some(parent) = detail.parent.clone() {
- (format!("{} {}", t(lang, Key::PartOf), parent.task_key))
+ "\u{2190}"
+ (parent.task_key.clone())
+ (parent.title.clone())
}
(detail.task_key.clone())
diff --git a/crates/izlek-web/src/dropdown.rs b/crates/izlek-web/src/dropdown.rs
index 595c89f..3db2770 100644
--- a/crates/izlek-web/src/dropdown.rs
+++ b/crates/izlek-web/src/dropdown.rs
@@ -10,6 +10,33 @@
//! visible trigger — same closed look as the select it replaces — and a
//! `position: fixed` panel of option rows, portaled onto ``, stands
//! in for the OS popup.
+//!
+//! ## The whole box is the hit area
+//!
+//! The trigger is one child among several inside a control box — a status
+//! dot before it, a chevron after it, the box's own padding around all of
+//! them — so a button-only listener leaves dead zones exactly where the
+//! control looks clickable. That bug has been fixed one control at a time
+//! before; this is the version that cannot come back. A delegated listener
+//! walks up from whatever was clicked and, on finding the element that
+//! *directly* contains a single `.dd-trigger`, opens that trigger's panel.
+//!
+//! "Directly contains" is the whole of the rule: it pins the hit area to
+//! the visual box and no further, so a click on a field's outer row or on
+//! the modal around it does not reach in and open something. Nothing has to
+//! be marked up for this to work — a new control gets it by existing, which
+//! is what makes it structural rather than another remembered convention.
+//!
+//! Anything else genuinely interactive keeps its own click — a link, a
+//! button, a text field. `
` is deliberately *not* on that list: the
+//! new-task modal wraps its status box in one, and bailing on labels put
+//! every dead zone straight back.
+//!
+//! The delegated click also calls `preventDefault`. A `` forwards a
+//! click to the control it labels, so without it the browser delivered a
+//! *second* click straight to the trigger, which toggled the panel shut
+//! again in the same gesture — opening and closing looked exactly like the
+//! dead zone the delegation was added to remove.
use topcoat::Result;
use topcoat::context::Cx;
@@ -115,6 +142,8 @@ pub async fn dropdown_script(cx: &Cx) -> Result {
panel.className = 'dd-panel';\
panel.setAttribute('role', 'listbox');\
panel.__ddTrigger = trigger;\
+ trigger.__ddPanel = panel;\
+ trigger.__ddSelect = select;\
var allOpts = opts(select);\
var search = null;\
if (allOpts.length > 7 || select.hasAttribute('data-search')) {\
@@ -189,6 +218,25 @@ pub async fn dropdown_script(cx: &Cx) -> Result {
if (trigger) { trigger.focus(); }\
return true;\
});\
+ document.addEventListener('click', function (e) {\
+ var el = e.target;\
+ if (!el || !el.closest) { return; }\
+ if (el.closest('.dd-panel') || el.closest('.dd-trigger')) { return; }\
+ if (el.closest('a, button, input:not([type=hidden]), textarea')) { return; }\
+ var box = el.nodeType === 1 ? el : el.parentNode;\
+ for (var depth = 0; depth < 3 && box && box.querySelectorAll; depth++) {\
+ var found = box.querySelectorAll('.dd-trigger');\
+ if (found.length === 1 && found[0].parentNode === box && found[0].__ddPanel) {\
+ var t = found[0];\
+ e.stopPropagation();\
+ e.preventDefault();\
+ if (t.__ddPanel.classList.contains('dd-open')) { closeAll(); }\
+ else { openPanel(t.__ddSelect, t, t.__ddPanel); }\
+ return;\
+ }\
+ box = box.parentNode;\
+ }\
+ }, true);\
document.addEventListener('click', closeAll);\
window.addEventListener('scroll', function (e) {\
var t = e.target;\
diff --git a/crates/izlek-web/src/i18n.rs b/crates/izlek-web/src/i18n.rs
index 3aa2316..f7cce6b 100644
--- a/crates/izlek-web/src/i18n.rs
+++ b/crates/izlek-web/src/i18n.rs
@@ -289,7 +289,6 @@ pub enum Key {
NoSubtasks,
NewSubtask,
AddSubtask,
- PartOf,
MakeAPart,
ReleaseThisPart,
ExistingTask,
@@ -844,8 +843,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
(NewSubtask, Tr) => "Alt görev",
(AddSubtask, En) => "Add",
(AddSubtask, Tr) => "Ekle",
- (PartOf, En) => "Part of",
- (PartOf, Tr) => "Şunun parçası:",
(MakeAPart, En) => "Take an existing task",
(MakeAPart, Tr) => "Var olan görevi al",
(ReleaseThisPart, En) => "Release this subtask",
diff --git a/crates/izlek-web/src/layout.rs b/crates/izlek-web/src/layout.rs
index c8b4c42..1b0ec4d 100644
--- a/crates/izlek-web/src/layout.rs
+++ b/crates/izlek-web/src/layout.rs
@@ -262,8 +262,9 @@ pub async fn soft_nav_script(cx: &Cx) -> Result {
document.addEventListener('change', function (e) { \
var control = e.target; \
if (control.classList && control.classList.contains('file-upload-input')) { \
- var name = control.closest('label').querySelector('.file-upload-name'); \
- if (control.files && control.files[0]) { name.textContent = control.files[0].name; } \
+ var label = control.closest('label'); \
+ var name = label ? label.querySelector('.file-upload-name') : null; \
+ if (name && control.files && control.files[0]) { name.textContent = control.files[0].name; } \
control.form.requestSubmit(); \
return; \
} \
diff --git a/crates/izlek-web/tests/http.rs b/crates/izlek-web/tests/http.rs
index c6acf92..e421023 100644
--- a/crates/izlek-web/tests/http.rs
+++ b/crates/izlek-web/tests/http.rs
@@ -1517,9 +1517,14 @@ async fn taking_a_task_in_and_letting_it_out_are_the_same_form() {
// The subtask kept its column: being taken in is not a move.
let page = app.get(&format!("/?task={loose}"), Some(&admin)).await;
let page = String::from_utf8_lossy(&page.bytes);
+ // The way back up: a link that names the whole, not a caption.
assert!(
- page.contains("Part of"),
- "the part does not name its whole"
+ page.contains("detail-parent") && page.contains(&format!("/?task={parent}")),
+ "the part does not link back to its whole"
+ );
+ assert!(
+ page.contains("Ship the exporter"),
+ "the link back does not name the task it goes to"
);
let released = app
@@ -1700,6 +1705,62 @@ async fn a_parents_own_part_is_not_offered_as_a_blocker() {
);
}
+#[tokio::test]
+async fn a_file_input_without_a_name_label_still_submits() {
+ // The shared change handler used to read `.file-upload-name` out of the
+ // input's label and set its text. The profile photo's label holds an
+ // avatar and no such span, so the read threw and the submit that came
+ // after it never ran — the photo silently never uploaded. The handler
+ // tolerates a missing name now; this holds both halves of that.
+ let app = App::open().await;
+ let admin = admin(&app).await;
+ let page = app.get("/settings", Some(&admin)).await;
+ let page = String::from_utf8_lossy(&page.bytes);
+
+ assert!(
+ page.contains("avatar-upload"),
+ "the profile photo control is gone"
+ );
+ assert!(
+ page.contains("var name = label ? label.querySelector('.file-upload-name') : null"),
+ "the file-input handler assumes a name label again"
+ );
+ assert!(
+ page.contains("if (name && control.files && control.files[0])"),
+ "the name write is unguarded again"
+ );
+}
+
+#[tokio::test]
+async fn the_whole_control_box_opens_its_dropdown() {
+ // A status control is a box holding a dot, the trigger and a chevron.
+ // Listening on the trigger alone leaves every other part of the box dead
+ // where it looks clickable. The delegated listener walks up to whatever
+ // *directly* contains a single trigger, which pins the hit area to the
+ // visual box and needs no markup to opt in.
+ let app = App::open().await;
+ let admin = admin(&app).await;
+ let columns = columns_of(&app).await;
+ let task = a_task(&app, &admin, &columns[0], "Anything").await;
+ let page = app.get(&format!("/?task={task}"), Some(&admin)).await;
+ let page = String::from_utf8_lossy(&page.bytes);
+
+ assert!(
+ page.contains("found[0].parentNode === box"),
+ "the dropdown hit area is back to the button alone"
+ );
+ assert!(
+ page.contains("trigger.__ddPanel = panel"),
+ "a delegated click can no longer reach the panel"
+ );
+ // The box really is a box with siblings around the select — which is the
+ // shape that made the button-only listener wrong in the first place.
+ assert!(
+ page.contains("status-dot") && page.contains("status-select"),
+ "the status control changed shape"
+ );
+}
+
#[tokio::test]
async fn a_drop_decided_against_a_stale_board_is_refused() {
let app = App::open().await;
diff --git a/style/main.scss b/style/main.scss
index 6d8ae36..c6ccae1 100644
--- a/style/main.scss
+++ b/style/main.scss
@@ -1446,16 +1446,35 @@ img.avatar {
color: var(--muted-soft);
}
-// A subtask says whose part it is above its own key, so the page it opens on
-// still names the work it belongs to.
+// A subtask names the whole it belongs to, above its own key, and that name
+// is the way back up. An arrow and the parent's title rather than a bare
+// caption: "Part of DZ-14" read as a label, and nobody tried to click it.
.detail-parent {
- display: block;
- font-family: var(--font-mono);
+ display: flex;
+ align-items: center;
+ gap: 6px;
font-size: 11px;
color: var(--muted);
text-decoration: none;
+ width: fit-content;
- &:hover { color: var(--ink); }
+ &:hover {
+ color: var(--ink);
+
+ .detail-parent-title { text-decoration: underline; }
+ }
+}
+
+.detail-parent-arrow,
+.detail-parent-key {
+ font-family: var(--font-mono);
+}
+
+.detail-parent-title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ max-width: 30ch;
}
.detail-title {
@@ -1943,14 +1962,60 @@ img.avatar {
font-size: 13px;
}
-// A finished part reads back the way a finished card does: still there,
-// still legible, plainly no longer in the way.
-.subtask-row-done {
- .dep-key,
- .dep-title,
- .dep-note { color: var(--muted-soft); }
+// A part is a lighter thing than a dependency: no box of its own, a rule
+// between rows instead, so a list of eight does not read as eight cards.
+.subtask-row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 8px 4px;
+ border-bottom: 1px solid var(--border);
+ font-size: 13px;
- .dep-title { text-decoration: line-through; }
+ &:last-child { border-bottom: none; }
+}
+
+// The key and the title are one target, so the row has one way in rather
+// than two adjacent links a pointer can fall between.
+.subtask-open {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ min-width: 0;
+ color: inherit;
+ text-decoration: none;
+
+ &:hover .subtask-title { text-decoration: underline; }
+}
+
+.subtask-mark {
+ display: flex;
+ color: var(--muted-soft);
+}
+
+.subtask-key {
+ font-family: var(--font-mono);
+ font-size: 11px;
+ color: var(--muted);
+}
+
+.subtask-title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.subtask-status {
+ font-family: var(--font-mono);
+ font-size: 11px;
+ color: var(--muted-soft);
+}
+
+// A finished part stays legible and plainly out of the way. The tick and
+// the muted title each say it once; there is no strikethrough on top, which
+// only made the title harder to read and fought the hover underline.
+.subtask-row-done {
+ .subtask-title { color: var(--muted); }
}
.subtask-new {