From 5dcb5f5435fa252ee744d1a42cff650f2b20ee0e Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Fri, 6 Nov 2026 21:13:54 +0000 Subject: [PATCH 1/8] feat(frontend): kanban column expand with compacted siblings One kanban column expands to 4fr while the other five compact to 1fr at 1280px and wider, driven by an inline --kanban-grid-cols property and one unlayered rule in input.css. Re-clicking the expanded column toggle is the reset path: a separate reset control needed a conditionally rendered element above the grid and made the board jump vertically. Toggles are hidden below the 1280px breakpoint and the expanded column carries a ring marker. Task cards keep filling their column with no width constraints. --- .../src/components/task_components.rs | 91 +++++++++++++++---- crates/context-frontend/src/public/style.css | 15 +++ .../context-frontend/src/tailwind/input.css | 9 ++ 3 files changed, 98 insertions(+), 17 deletions(-) diff --git a/crates/context-frontend/src/components/task_components.rs b/crates/context-frontend/src/components/task_components.rs index e3bbe6eb..dcdc2603 100644 --- a/crates/context-frontend/src/components/task_components.rs +++ b/crates/context-frontend/src/components/task_components.rs @@ -67,12 +67,33 @@ fn status_bg_color(status: &str) -> &'static str { } } +/// Kanban column order and labels - drives both the rendered columns and the expanded grid template. +const KANBAN_STATUSES: [(&str, &str); 6] = [ + ("backlog", "Backlog"), + ("todo", "Todo"), + ("in_progress", "In Progress"), + ("review", "Review"), + ("done", "Done"), + ("cancelled", "Cancelled"), +]; + +/// Build the `grid-template-columns` value for one expanded column. +fn kanban_grid_template(expanded: &str) -> String { + KANBAN_STATUSES + .iter() + .map(|(status, _)| if *status == expanded { "4fr" } else { "1fr" }) + .collect::>() + .join(" ") +} + #[component] pub fn KanbanColumn( status: &'static str, label: &'static str, list_id: String, total_count: usize, + expanded: Signal, + on_toggle: Callback<()>, ) -> impl IntoView { let (tasks, set_tasks) = signal(Vec::::new()); let (offset, set_offset) = signal(0); @@ -208,12 +229,32 @@ pub fn KanbanColumn( } }; + let column_class = move || { + if expanded.get() { + format!( + "{bg_color} rounded-lg p-4 flex flex-col h-full overflow-hidden ring-1 ring-ctp-blue" + ) + } else { + format!("{bg_color} rounded-lg p-4 flex flex-col h-full overflow-hidden") + } + }; + view! { -
-

- {label} - - {total_count} +
+

+ {label} + + + {total_count} + +

) -> impl IntoView { let (stats_data, set_stats_data) = signal(None::>); + // At most one kanban column is expanded at a time + let expanded_status = RwSignal::new(None::<&'static str>); + + // Inline custom property that drives the expanded grid template + let board_style = move || match expanded_status.get() { + Some(status) => format!("--kanban-grid-cols: {}", kanban_grid_template(status)), + None => String::new(), + }; + // WebSocket updates - refetch trigger for stats let (stats_refetch_trigger, set_stats_refetch_trigger) = signal(0u32); let ws_updates = crate::websocket::use_websocket_updates(); @@ -1228,15 +1278,6 @@ pub fn TaskListContent(task_list: Signal) -> impl IntoView { }); }); - let statuses = vec![ - ("backlog", "Backlog"), - ("todo", "Todo"), - ("in_progress", "In Progress"), - ("review", "Review"), - ("done", "Done"), - ("cancelled", "Cancelled"), - ]; - view! { "Loading task list..."

} @@ -1286,9 +1327,11 @@ pub fn TaskListContent(task_list: Signal) -> impl IntoView { } })} -
- {statuses - .clone() +
+ {KANBAN_STATUSES .into_iter() .map(|(status, label)| { // Get total count for this status from stats @@ -1302,12 +1345,26 @@ pub fn TaskListContent(task_list: Signal) -> impl IntoView { _ => 0, }; + let is_expanded = + Signal::derive(move || expanded_status.get() == Some(status)); + let on_toggle = Callback::new(move |_: ()| { + expanded_status.update(|current| { + *current = if *current == Some(status) { + None + } else { + Some(status) + }; + }); + }); + view! { } }) diff --git a/crates/context-frontend/src/public/style.css b/crates/context-frontend/src/public/style.css index 515b9207..e2e69be4 100644 --- a/crates/context-frontend/src/public/style.css +++ b/crates/context-frontend/src/public/style.css @@ -1039,6 +1039,13 @@ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor); box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); } + .ring-1 { + --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor); + box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + } + .ring-ctp-blue { + --tw-ring-color: var(--ctp-blue); + } .outline { outline-style: var(--tw-outline-style); outline-width: 1px; @@ -1199,6 +1206,9 @@ } } @media (width >= 80rem) { + .xl\:inline-flex { + display: inline-flex; + } .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } @@ -1800,6 +1810,11 @@ body { margin: 1in; } } +@media (min-width: 1280px) { + .kanban-board-grid { + grid-template-columns: var(--kanban-grid-cols, repeat(6, minmax(0, 1fr))); + } +} @property --tw-translate-x { syntax: "*"; inherits: false; diff --git a/crates/context-frontend/src/tailwind/input.css b/crates/context-frontend/src/tailwind/input.css index 3f7302ca..531ee0d4 100644 --- a/crates/context-frontend/src/tailwind/input.css +++ b/crates/context-frontend/src/tailwind/input.css @@ -781,3 +781,12 @@ body { margin: 1in; } } + +/* Kanban board column expansion. + --kanban-grid-cols is set inline by TaskListContent while one column is expanded. + The fallback matches Tailwind's xl:grid-cols-6 exactly, so the default render is unchanged. */ +@media (min-width: 1280px) { + .kanban-board-grid { + grid-template-columns: var(--kanban-grid-cols, repeat(6, minmax(0, 1fr))); + } +} From 63f32c1952a950deb55c689cf94ba31270cfe699 Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Fri, 6 Nov 2026 21:21:08 +0000 Subject: [PATCH 2/8] refactor(frontend): make TaskDetailContent a pure detail pane The two-pane task dialog renders child tasks in its own left pane, so TaskDetailContent must stop owning subtask navigation: remove the subtask fetch effect, the SubtaskStack accordion, the SubtaskStackItem component and the initial_open_subtask_id prop. TaskDetailDialog keeps its initial_open_subtask_id prop (unused until the two-pane shell lands) so its signature and the KanbanColumn call site stay untouched. Until then the dialog shows no children, which is the intended interim state. --- .../src/components/task_components.rs | 226 +----------------- 1 file changed, 8 insertions(+), 218 deletions(-) diff --git a/crates/context-frontend/src/components/task_components.rs b/crates/context-frontend/src/components/task_components.rs index dcdc2603..86bbadec 100644 --- a/crates/context-frontend/src/components/task_components.rs +++ b/crates/context-frontend/src/components/task_components.rs @@ -1,4 +1,3 @@ -use leptos::ev; use leptos::prelude::*; use leptos::task::spawn_local; use thaw::*; @@ -381,126 +380,6 @@ pub fn KanbanColumn( } } -/// SubtaskStackItem - Individual collapsible subtask in the stack -#[component] -pub fn SubtaskStackItem( - subtask: Task, - is_open: Signal, - on_click: Callback, -) -> impl IntoView { - let subtask_id = subtask.id.clone(); - let subtask_id_for_click = subtask.id.clone(); - let border_color = priority_border_color(subtask.priority); - let is_expanded = move || is_open.get(); - - view! { -
- // Header: CopyableId + Title (left) | Badges (right: Priority → Status) -
- // Left side: CopyableId + Title -
-
- -
-
- {move || { - let title = &subtask.title; - let truncated = !is_expanded() && title.len() > 60; - if truncated { - format!("{}...", &title[..60]) - } else { - title.clone() - } - }} -
-
- - // Right side: Priority → Status badges -
- {subtask.priority.map(|p| { - view! { - - "P"{p} - - } - })} - - {status_badge_label(&subtask.status)} - -
-
- - // Description (only when expanded, with separator) - {move || { - (is_expanded() && subtask.description.is_some()).then(|| { - view! { -
-
- -
-
- } - }) - }} - - // Metadata section (only when expanded) - {move || is_expanded().then(|| { - view! { -
- // Timestamps (right-aligned) -
- {subtask.created_at.clone().map(|created| { - view! { -
- "Created: " - {created} -
- } - })} - - {subtask.updated_at.clone().map(|updated| { - view! { -
- "Updated: " - {updated} -
- } - })} -
- - // Tags (below, left-aligned) - {(!subtask.tags.is_empty()).then(|| { - view! { -
- {subtask.tags.iter().map(|tag| { - view! { - - {tag.clone()} - - } - }).collect::>()} -
- } - })} -
- } - })} -
- } -} - #[component] pub fn TaskCard( task: Task, @@ -819,43 +698,9 @@ pub fn MiniParentCard( } } -/// TaskDetailContent component - reusable task detail content (used in both drawer and split view) +/// TaskDetailContent component - renders one task's detail pane; it does not own subtask navigation #[component] -pub fn TaskDetailContent( - task: Task, - #[prop(optional)] initial_open_subtask_id: Option, -) -> impl IntoView { - // Fetch subtasks - let (subtasks, set_subtasks) = signal(Vec::::new()); - let task_id_for_fetch = task.id.clone(); - let list_id_for_fetch = task.list_id.clone(); - - Effect::new(move || { - let task_id = task_id_for_fetch.clone(); - let list_id = list_id_for_fetch.clone(); - spawn_local(async move { - match tasks::list_for_task_list( - &list_id, - None, - None, - None, - Some("priority"), - Some("asc"), - Some(&task_id), - None, // task_type - we want subtasks here - ) - .await - { - Ok(paginated) => { - set_subtasks.set(paginated.items); - } - Err(_) => { - set_subtasks.set(Vec::new()); - } - } - }); - }); - +pub fn TaskDetailContent(task: Task) -> impl IntoView { view! {
// Sticky header - pinned while the body scrolls @@ -885,7 +730,7 @@ pub fn TaskDetailContent(
- // Full-width body: description, tags, timestamps, refs, subtasks + // Full-width body: description, tags, timestamps, refs
// Markdown description {task.description.as_ref().map(|desc| { @@ -910,7 +755,7 @@ pub fn TaskDetailContent( } })} - // Timestamps, external refs, and subtasks + // Timestamps and external refs
{task.created_at.clone().map(|created| { view! { @@ -943,55 +788,6 @@ pub fn TaskDetailContent(
} })} - - // SubtaskStack - custom collapsible stack (no accordion arrow, no duplicate content) - {move || { - let tasks_list = subtasks.get(); - if !tasks_list.is_empty() { - // Track which subtask is currently open (only one at a time) - let open_subtask_id = RwSignal::new(initial_open_subtask_id.clone()); - - let handle_click = move |id: String| { - open_subtask_id.update(|current| { - if current.as_ref() == Some(&id) { - *current = None; // Close if already open - } else { - *current = Some(id); // Open clicked item - } - }); - }; - - Some(view! { -
-

- {format!("Subtasks ({})", tasks_list.len())} -

-
- - } - } - /> -
-
- }) - } else { - None - } - }}
} @@ -1007,6 +803,7 @@ pub fn TaskDetailDialog( Option, >, ) -> impl IntoView { + let _ = initial_open_subtask_id; // Reserved for the two-pane child list let task_resource = LocalResource::new(move || { let id = task_id.get(); async move { @@ -1033,16 +830,9 @@ pub fn TaskDetailDialog( .get() .map(|result| { match result { - Ok(task) => { - match initial_open_subtask_id.get() { - Some(id) => view! { - - }.into_any(), - None => view! { - - }.into_any(), - } - } + Ok(task) => view! { + + }.into_any(), Err(e) => { view! {
From 172f7dc0c0aa5a286b3b440d8c5ac53963f88d76 Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Fri, 6 Nov 2026 21:24:59 +0000 Subject: [PATCH 3/8] feat(frontend): two-pane task detail dialog with drill-down path A card click opened a single-column dialog that showed only the selected task; child subtasks sat behind an accordion that could not navigate deeper. The dialog is now a 95vw split surface: the left pane lists the current task's children as TaskCard rows, the right pane renders TaskDetailContent, and activating a child drills down by pushing it onto a root-first path signal. The path bar offers a back control and per-entry truncation, so any depth is reachable without a route change. The bootstrap fetch walks parent_id upward, so a subtask opened from the board through initial_open_subtask_id arrives with its ancestor chain already in the path. Closing the dialog or changing task_id rebuilds the path from scratch, leaving no stale entries. --- .../src/components/task_components.rs | 243 +++++++++++++++--- crates/context-frontend/src/public/style.css | 59 +++-- .../context-frontend/src/tailwind/input.css | 39 ++- 3 files changed, 285 insertions(+), 56 deletions(-) diff --git a/crates/context-frontend/src/components/task_components.rs b/crates/context-frontend/src/components/task_components.rs index 86bbadec..f5ce293f 100644 --- a/crates/context-frontend/src/components/task_components.rs +++ b/crates/context-frontend/src/components/task_components.rs @@ -793,8 +793,8 @@ pub fn TaskDetailContent(task: Task) -> impl IntoView { } } -/// TaskDetailDialog component - shows full task details in a centered modal dialog -/// Fetches fresh data from API using task_id +/// TaskDetailDialog component - two-pane task viewer with a drill-down path +/// The left pane lists the current task's children, the right pane renders the task detail. #[component] pub fn TaskDetailDialog( task_id: ReadSignal, @@ -803,18 +803,91 @@ pub fn TaskDetailDialog( Option, >, ) -> impl IntoView { - let _ = initial_open_subtask_id; // Reserved for the two-pane child list - let task_resource = LocalResource::new(move || { - let id = task_id.get(); - async move { - if id.is_empty() { - Err(crate::api::ApiClientError::Network( - "No task selected".to_string(), - )) - } else { - tasks::get(&id).await - } + // Root-first task path; the last entry is the current task. + let (path, set_path) = signal(Vec::::new()); + let (children, set_children) = signal(Vec::::new()); + let (loading, set_loading) = signal(true); + let (error, set_error) = signal(None::); + + // Bootstrap the path from the selected task or the initially opened subtask. + Effect::new(move || { + let is_open = open.get(); + let selected_id = task_id.get(); + let initial_subtask_id = initial_open_subtask_id.get(); + + if !is_open { + set_path.set(Vec::new()); + return; + } + + let start_id = initial_subtask_id + .filter(|id| !id.is_empty()) + .unwrap_or(selected_id); + + if start_id.is_empty() { + set_path.set(Vec::new()); + set_loading.set(false); + return; } + + set_loading.set(true); + set_error.set(None); + + spawn_local(async move { + match tasks::get(&start_id).await { + Ok(start_task) => { + let mut ancestors = Vec::new(); + let mut cursor = start_task.parent_id.clone(); + while let Some(parent_id) = cursor { + match tasks::get(&parent_id).await { + Ok(parent) => { + cursor = parent.parent_id.clone(); + ancestors.push(parent); + } + Err(_) => break, + } + } + ancestors.reverse(); + ancestors.push(start_task); + set_path.set(ancestors); + set_loading.set(false); + } + Err(e) => { + set_error.set(Some(e.to_string())); + set_path.set(Vec::new()); + set_loading.set(false); + } + } + }); + }); + + // Fetch the children of the current task (last path entry). + Effect::new(move || { + let Some(current) = path.get().last().cloned() else { + set_children.set(Vec::new()); + return; + }; + + let list_id = current.list_id.clone(); + let parent_id = current.id.clone(); + + spawn_local(async move { + match tasks::list_for_task_list( + &list_id, + None, + None, + None, + Some("priority"), + Some("asc"), + Some(&parent_id), + None, + ) + .await + { + Ok(paginated) => set_children.set(paginated.items), + Err(_) => set_children.set(Vec::new()), + } + }); }); view! { @@ -822,28 +895,134 @@ pub fn TaskDetailDialog( - "Loading task..."

} - }> - {move || { - task_resource - .get() - .map(|result| { - match result { - Ok(task) => view! { - - }.into_any(), - Err(e) => { - view! { -
- "Error loading task: " {e.to_string()} -
- }.into_any() + {move || { + if loading.get() { + return view! { +

"Loading task..."

+ } + .into_any(); + } + + if let Some(message) = error.get() { + return view! { +
+ "Error loading task: " {message} +
+ } + .into_any(); + } + + let entries = path.get(); + let Some(current) = entries.last().cloned() else { + return view! { +

"No task selected"

+ } + .into_any(); + }; + + let path_bar = (entries.len() > 1).then(|| { + let items = entries + .iter() + .enumerate() + .map(|(index, entry)| { + let title = entry.title.clone(); + let target_len = index + 1; + let separator = (index > 0).then(|| { + view! { + + "›" + } + }); + view! { +
+ {separator} + +
} }) - }} -
+ .collect::>(); + + view! { +
+ +
+ {items} +
+
+ } + }); + + view! { +
+ {path_bar} +
+
+

+ "Subtasks" + {move || format!(" ({})", children.get().len())} +

+ {move || { + if children.get().is_empty() { + view! { +

"No subtasks"

+ } + .into_any() + } else { + view! { +
+ + } + } + /> +
+ } + .into_any() + } + }} +
+
+ +
+
+
+ } + .into_any() + }}
diff --git a/crates/context-frontend/src/public/style.css b/crates/context-frontend/src/public/style.css index e2e69be4..d597045c 100644 --- a/crates/context-frontend/src/public/style.css +++ b/crates/context-frontend/src/public/style.css @@ -390,9 +390,6 @@ .h-full { height: 100%; } - .max-h-\[40vh\] { - max-height: 40vh; - } .max-h-\[90vh\] { max-height: 90vh; } @@ -435,6 +432,9 @@ .w-full { width: 100%; } + .max-w-\[220px\] { + max-width: 220px; + } .max-w-none { max-width: none; } @@ -506,9 +506,6 @@ .items-center { align-items: center; } - .items-end { - align-items: flex-end; - } .items-start { align-items: flex-start; } @@ -857,12 +854,6 @@ .py-12 { padding-block: calc(var(--spacing) * 12); } - .pt-2 { - padding-top: calc(var(--spacing) * 2); - } - .pt-3 { - padding-top: calc(var(--spacing) * 3); - } .pt-6 { padding-top: calc(var(--spacing) * 6); } @@ -890,6 +881,9 @@ .text-justify { text-align: justify; } + .text-left { + text-align: left; + } .text-right { text-align: right; } @@ -1125,14 +1119,6 @@ .hover\:bg-ctp-overlay0:hover { background-color: var(--ctp-overlay0); } - .hover\:bg-ctp-surface0\/80:hover { - background-color: var(--ctp-surface0); - } - @supports (color: color-mix(in lab, red, red)) { - .hover\:bg-ctp-surface0\/80:hover { - background-color: color-mix(in oklab, var(--ctp-surface0) 80%, transparent); - } - } .hover\:bg-ctp-surface1:hover { background-color: var(--ctp-surface1); } @@ -1349,8 +1335,8 @@ body { margin-bottom: 2em; } .task-detail-dialog-surface { - width: 90vw !important; - max-width: 90vw !important; + width: 95vw !important; + max-width: 95vw !important; max-height: 90vh !important; overflow: hidden !important; } @@ -1371,6 +1357,35 @@ body { min-height: 0 !important; overflow-y: auto !important; } +.task-detail-split { + display: flex; + flex-direction: row; + flex: 1; + min-height: 0; + overflow: hidden; +} +.task-detail-split-side { + width: 360px; + flex-shrink: 0; + border-right: 1px solid var(--ctp-surface1); + overflow-y: auto; +} +.task-detail-split-main { + flex: 1; + min-width: 0; + overflow-y: auto; +} +@media (max-width: 1023px) { + .task-detail-split { + flex-direction: column; + } + .task-detail-split-side { + width: 100%; + max-height: 40vh; + border-right: none; + border-bottom: 1px solid var(--ctp-surface1); + } +} .note-detail-drawer { width: 85vw !important; max-width: 85vw !important; diff --git a/crates/context-frontend/src/tailwind/input.css b/crates/context-frontend/src/tailwind/input.css index 531ee0d4..f6828136 100644 --- a/crates/context-frontend/src/tailwind/input.css +++ b/crates/context-frontend/src/tailwind/input.css @@ -186,8 +186,8 @@ body { /* Task detail dialog - override thaw's max-width: 600px */ .task-detail-dialog-surface { - width: 90vw !important; - max-width: 90vw !important; + width: 95vw !important; + max-width: 95vw !important; max-height: 90vh !important; overflow: hidden !important; } @@ -216,6 +216,41 @@ body { overflow-y: auto !important; } +/* Two-pane task detail: children left, task detail right */ +.task-detail-split { + display: flex; + flex-direction: row; + flex: 1; + min-height: 0; + overflow: hidden; +} + +.task-detail-split-side { + width: 360px; + flex-shrink: 0; + border-right: 1px solid var(--ctp-surface1); + overflow-y: auto; +} + +.task-detail-split-main { + flex: 1; + min-width: 0; + overflow-y: auto; +} + +@media (max-width: 1023px) { + .task-detail-split { + flex-direction: column; + } + + .task-detail-split-side { + width: 100%; + max-height: 40vh; + border-right: none; + border-bottom: 1px solid var(--ctp-surface1); + } +} + /* Thaw UI OverlayDrawer custom styling */ .note-detail-drawer { width: 85vw !important; From dbdf8beebbc5fb1fd9bb78ac6cc8c2b7fc10a2fe Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Fri, 6 Nov 2026 21:37:55 +0000 Subject: [PATCH 4/8] feat(frontend): note-stack selection in the two-pane task dialog User review of the drill-down build picked the note stack view as the literal model: no back button, the active selection drives the right pane, and the left pane never re-roots. The path/history signal, path bar and back control are gone; in their place a single selected_task_id RwSignal is re-bootstrapped on every open (initial subtask when present, else the entry task). The left pane now anchors on task_id: it pins the entry task card above indented child rows and fetches all direct children in one call. Cards carry data-task-id plus a reactively bound data-selected attribute backed by .task-stack-card rules cloned from .note-stack-card, so the highlight matches the note stack instead of the old DOM helper. A child's own children stay unreachable, the same one-level limit the note stack has. --- .../src/components/task_components.rs | 366 +++++++++--------- crates/context-frontend/src/public/style.css | 21 +- .../context-frontend/src/tailwind/input.css | 19 + 3 files changed, 224 insertions(+), 182 deletions(-) diff --git a/crates/context-frontend/src/components/task_components.rs b/crates/context-frontend/src/components/task_components.rs index f5ce293f..88100f28 100644 --- a/crates/context-frontend/src/components/task_components.rs +++ b/crates/context-frontend/src/components/task_components.rs @@ -793,8 +793,8 @@ pub fn TaskDetailContent(task: Task) -> impl IntoView { } } -/// TaskDetailDialog component - two-pane task viewer with a drill-down path -/// The left pane lists the current task's children, the right pane renders the task detail. +/// TaskDetailDialog component - two-pane task viewer modeled on the note stack view +/// The left pane pins the entry task above its direct children; activating a card moves the selection. #[component] pub fn TaskDetailDialog( task_id: ReadSignal, @@ -803,89 +803,96 @@ pub fn TaskDetailDialog( Option, >, ) -> impl IntoView { - // Root-first task path; the last entry is the current task. - let (path, set_path) = signal(Vec::::new()); + // Active selection rendered in the right pane; the left pane always anchors on the entry task. + let selected_task_id = RwSignal::new(String::new()); + let (entry_task, set_entry_task) = signal(None::); let (children, set_children) = signal(Vec::::new()); - let (loading, set_loading) = signal(true); - let (error, set_error) = signal(None::); + let (entry_loading, set_entry_loading) = signal(true); + let (selected_task, set_selected_task) = signal(None::); - // Bootstrap the path from the selected task or the initially opened subtask. + // Re-initialize the selection whenever the dialog opens or the entry task changes. Effect::new(move || { let is_open = open.get(); - let selected_id = task_id.get(); + let entry_id = task_id.get(); let initial_subtask_id = initial_open_subtask_id.get(); if !is_open { - set_path.set(Vec::new()); + selected_task_id.set(String::new()); return; } let start_id = initial_subtask_id .filter(|id| !id.is_empty()) - .unwrap_or(selected_id); + .unwrap_or(entry_id); + selected_task_id.set(start_id); + }); - if start_id.is_empty() { - set_path.set(Vec::new()); - set_loading.set(false); + // Anchor the left pane on the entry task and load its direct children. + Effect::new(move || { + let is_open = open.get(); + let entry_id = task_id.get(); + + if !is_open { + set_entry_task.set(None); + set_children.set(Vec::new()); return; } - set_loading.set(true); - set_error.set(None); + if entry_id.is_empty() { + set_entry_task.set(None); + set_children.set(Vec::new()); + set_entry_loading.set(false); + return; + } + + set_entry_loading.set(true); + set_entry_task.set(None); + set_children.set(Vec::new()); spawn_local(async move { - match tasks::get(&start_id).await { - Ok(start_task) => { - let mut ancestors = Vec::new(); - let mut cursor = start_task.parent_id.clone(); - while let Some(parent_id) = cursor { - match tasks::get(&parent_id).await { - Ok(parent) => { - cursor = parent.parent_id.clone(); - ancestors.push(parent); - } - Err(_) => break, - } - } - ancestors.reverse(); - ancestors.push(start_task); - set_path.set(ancestors); - set_loading.set(false); + match tasks::get(&entry_id).await { + Ok(entry) => { + let list_id = entry.list_id.clone(); + let parent_id = entry.id.clone(); + let items = tasks::list_for_task_list( + &list_id, + None, + None, + None, + Some("priority"), + Some("asc"), + Some(&parent_id), + None, + ) + .await + .map(|paginated| paginated.items) + .unwrap_or_default(); + set_entry_task.set(Some(entry)); + set_children.set(items); } - Err(e) => { - set_error.set(Some(e.to_string())); - set_path.set(Vec::new()); - set_loading.set(false); + Err(_) => { + set_entry_task.set(None); + set_children.set(Vec::new()); } } + set_entry_loading.set(false); }); }); - // Fetch the children of the current task (last path entry). + // Fetch the selected task for the right pane. Effect::new(move || { - let Some(current) = path.get().last().cloned() else { - set_children.set(Vec::new()); + let id = selected_task_id.get(); + + if id.is_empty() { + set_selected_task.set(None); return; - }; + } - let list_id = current.list_id.clone(); - let parent_id = current.id.clone(); + set_selected_task.set(None); spawn_local(async move { - match tasks::list_for_task_list( - &list_id, - None, - None, - None, - Some("priority"), - Some("asc"), - Some(&parent_id), - None, - ) - .await - { - Ok(paginated) => set_children.set(paginated.items), - Err(_) => set_children.set(Vec::new()), + if let Ok(task) = tasks::get(&id).await { + set_selected_task.set(Some(task)); } }); }); @@ -894,136 +901,143 @@ pub fn TaskDetailDialog( - - {move || { - if loading.get() { - return view! { -

"Loading task..."

+
+
+ {move || { + if entry_loading.get() { + return view! { +

"Loading task..."

+ } + .into_any(); } - .into_any(); - } - if let Some(message) = error.get() { - return view! { -
- "Error loading task: " {message} -
- } - .into_any(); - } + let Some(entry) = entry_task.get() else { + return view! { +

"No task selected"

+ } + .into_any(); + }; + + let entry_id = entry.id.clone(); + let entry_id_for_selected = entry_id.clone(); + let entry_id_for_click = entry_id.clone(); + let title = entry.title.clone(); + let description = entry.description.as_ref().map(|desc| { + if desc.chars().count() > 150 { + format!("{}...", desc.chars().take(150).collect::()) + } else { + desc.clone() + } + }); + let tag_count = entry.tags.len(); + let tags = entry.tags.iter().take(3).cloned().collect::>(); - let entries = path.get(); - let Some(current) = entries.last().cloned() else { - return view! { -

"No task selected"

- } - .into_any(); - }; + view! { +
+

+ {title} +

+ {description + .map(|text| { + view! { +
{text}
+ } + })} + {(!tags.is_empty()) + .then(|| { + view! { +
+ {tags + .iter() + .map(|tag| { + view! { + + {tag.clone()} + + } + }) + .collect::>()} + {(tag_count > 3) + .then(|| { + view! { + + "+"{tag_count - 3} + + } + })} +
+ } + })} +
- let path_bar = (entries.len() > 1).then(|| { - let items = entries - .iter() - .enumerate() - .map(|(index, entry)| { - let title = entry.title.clone(); - let target_len = index + 1; - let separator = (index > 0).then(|| { + {move || { + if children.get().is_empty() { view! { - - "›" - +

"No subtasks"

} - }); - view! { -
- {separator} - -
- } - }) - .collect::>(); - - view! { -
-
} - }) + } + /> } - > - "← Back" - -
- {items} -
-
+ .into_any() + } + }} } - }); + .into_any() + }} +
- view! { -
- {path_bar} -
-
-

- "Subtasks" - {move || format!(" ({})", children.get().len())} -

- {move || { - if children.get().is_empty() { - view! { -

"No subtasks"

- } - .into_any() - } else { - view! { -
- - } - } - /> -
- } - .into_any() - } - }} -
-
- -
-
-
- } - .into_any() - }} -
+
+ {move || { + match selected_task.get() { + None => { + view! {

"Loading..."

} + .into_any() + } + Some(task) => { + view! { }.into_any() + } + } + }} +
+
diff --git a/crates/context-frontend/src/public/style.css b/crates/context-frontend/src/public/style.css index d597045c..52079a10 100644 --- a/crates/context-frontend/src/public/style.css +++ b/crates/context-frontend/src/public/style.css @@ -432,9 +432,6 @@ .w-full { width: 100%; } - .max-w-\[220px\] { - max-width: 220px; - } .max-w-none { max-width: none; } @@ -881,9 +878,6 @@ .text-justify { text-align: justify; } - .text-left { - text-align: left; - } .text-right { text-align: right; } @@ -1549,6 +1543,21 @@ body { background-color: var(--ctp-surface1); border: 2px solid var(--ctp-blue); } +.task-stack-card { + background-color: var(--ctp-surface0); + border: 1px solid var(--ctp-surface1); + outline: none; + -webkit-tap-highlight-color: transparent; + overflow-anchor: none; +} +.task-stack-card:hover { + background-color: var(--ctp-surface0); + opacity: 0.8; +} +.task-stack-card[data-selected="true"] { + background-color: var(--ctp-surface1); + border: 2px solid var(--ctp-blue); +} .prose pre { background: var(--ctp-mantle); border: 1px solid var(--ctp-surface1); diff --git a/crates/context-frontend/src/tailwind/input.css b/crates/context-frontend/src/tailwind/input.css index f6828136..24f4941c 100644 --- a/crates/context-frontend/src/tailwind/input.css +++ b/crates/context-frontend/src/tailwind/input.css @@ -478,6 +478,25 @@ body { border: 2px solid var(--ctp-blue); } +/* Task stack card selection - mirrors .note-stack-card */ +.task-stack-card { + background-color: var(--ctp-surface0); + border: 1px solid var(--ctp-surface1); + outline: none; + -webkit-tap-highlight-color: transparent; + overflow-anchor: none; +} + +.task-stack-card:hover { + background-color: var(--ctp-surface0); + opacity: 0.8; +} + +.task-stack-card[data-selected="true"] { + background-color: var(--ctp-surface1); + border: 2px solid var(--ctp-blue); +} + /* === Markdown code blocks (syntect-highlighted) === */ .prose pre { background: var(--ctp-mantle); From dc38ce8e1c0f489e2089dd497a432ff123239d97 Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Fri, 6 Nov 2026 21:43:06 +0000 Subject: [PATCH 5/8] fix(frontend): render the task dialog entry row as a plain TaskCard Round-2 review rejected the bespoke preview card: in the note stack the first row is just another row, so the entry task now uses the same TaskCard as its children and differs only by the missing ml-2 indent. The anchor-only styling is gone (150-char description truncation, tag chips, fixed padding, separate click handler); .task-stack-card stays as the uniform selected-state styling shared by every row, and each row wrapper now carries cursor-pointer for the hover affordance. Also drop the .task-detail-dialog-surface .thaw-dialog-content rule: the dialog no longer renders DialogContent, so the rule can never match. The surface and body rules stay. --- .../src/components/task_components.rs | 60 +++---------------- crates/context-frontend/src/public/style.css | 5 -- .../context-frontend/src/tailwind/input.css | 7 --- 3 files changed, 9 insertions(+), 63 deletions(-) diff --git a/crates/context-frontend/src/components/task_components.rs b/crates/context-frontend/src/components/task_components.rs index 88100f28..64e2f1f4 100644 --- a/crates/context-frontend/src/components/task_components.rs +++ b/crates/context-frontend/src/components/task_components.rs @@ -920,64 +920,22 @@ pub fn TaskDetailDialog( let entry_id = entry.id.clone(); let entry_id_for_selected = entry_id.clone(); - let entry_id_for_click = entry_id.clone(); - let title = entry.title.clone(); - let description = entry.description.as_ref().map(|desc| { - if desc.chars().count() > 150 { - format!("{}...", desc.chars().take(150).collect::()) - } else { - desc.clone() - } - }); - let tag_count = entry.tags.len(); - let tags = entry.tags.iter().take(3).cloned().collect::>(); view! {
-

- {title} -

- {description - .map(|text| { - view! { -
{text}
- } - })} - {(!tags.is_empty()) - .then(|| { - view! { -
- {tags - .iter() - .map(|tag| { - view! { - - {tag.clone()} - - } - }) - .collect::>()} - {(tag_count > 3) - .then(|| { - view! { - - "+"{tag_count - 3} - - } - })} -
- } - })} +
{move || { @@ -996,7 +954,7 @@ pub fn TaskDetailDialog( let child_id_for_selected = child_id.clone(); view! {
Date: Fri, 6 Nov 2026 21:46:19 +0000 Subject: [PATCH 6/8] fix(frontend): show task fetch errors in the detail dialog The selection Effect kept only the Ok branch, so a failed tasks::get left the right pane stuck on "Loading..." forever, and the entry fetch dropped its error the same way. Both signals now hold Option> and the view matches on them, rendering the shared red error block (TaskListContent styling, note_detail.rs Result shape) with the API error text. A later successful selection replaces the error without closing the dialog. The children fetch keeps its lenient empty-list behaviour, so a failed child load still reads "No subtasks". --- .../src/components/task_components.rs | 48 +++++++++++++++---- crates/context-frontend/src/public/style.css | 3 ++ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/crates/context-frontend/src/components/task_components.rs b/crates/context-frontend/src/components/task_components.rs index 64e2f1f4..7a84d847 100644 --- a/crates/context-frontend/src/components/task_components.rs +++ b/crates/context-frontend/src/components/task_components.rs @@ -805,10 +805,10 @@ pub fn TaskDetailDialog( ) -> impl IntoView { // Active selection rendered in the right pane; the left pane always anchors on the entry task. let selected_task_id = RwSignal::new(String::new()); - let (entry_task, set_entry_task) = signal(None::); + let (entry_task, set_entry_task) = signal(None::>); let (children, set_children) = signal(Vec::::new()); let (entry_loading, set_entry_loading) = signal(true); - let (selected_task, set_selected_task) = signal(None::); + let (selected_task, set_selected_task) = signal(None::>); // Re-initialize the selection whenever the dialog opens or the entry task changes. Effect::new(move || { @@ -867,11 +867,11 @@ pub fn TaskDetailDialog( .await .map(|paginated| paginated.items) .unwrap_or_default(); - set_entry_task.set(Some(entry)); + set_entry_task.set(Some(Ok(entry))); set_children.set(items); } - Err(_) => { - set_entry_task.set(None); + Err(err) => { + set_entry_task.set(Some(Err(err))); set_children.set(Vec::new()); } } @@ -891,9 +891,7 @@ pub fn TaskDetailDialog( set_selected_task.set(None); spawn_local(async move { - if let Ok(task) = tasks::get(&id).await { - set_selected_task.set(Some(task)); - } + set_selected_task.set(Some(tasks::get(&id).await)); }); }); @@ -911,13 +909,30 @@ pub fn TaskDetailDialog( .into_any(); } - let Some(entry) = entry_task.get() else { + let Some(result) = entry_task.get() else { return view! {

"No task selected"

} .into_any(); }; + let entry = match result { + Ok(entry) => entry, + Err(err) => { + return view! { +
+

+ "Error loading task" +

+

+ {err.to_string()} +

+
+ } + .into_any(); + } + }; + let entry_id = entry.id.clone(); let entry_id_for_selected = entry_id.clone(); @@ -989,7 +1004,20 @@ pub fn TaskDetailDialog( view! {

"Loading..."

} .into_any() } - Some(task) => { + Some(Err(err)) => { + view! { +
+

+ "Error loading task" +

+

+ {err.to_string()} +

+
+ } + .into_any() + } + Some(Ok(task)) => { view! { }.into_any() } } diff --git a/crates/context-frontend/src/public/style.css b/crates/context-frontend/src/public/style.css index ecea5bef..bd0b39f3 100644 --- a/crates/context-frontend/src/public/style.css +++ b/crates/context-frontend/src/public/style.css @@ -260,6 +260,9 @@ max-width: 96rem; } } + .m-3 { + margin: calc(var(--spacing) * 3); + } .mx-auto { margin-inline: auto; } From 3cc6dc1d26d27791262151fef2f2a17b2d400b42 Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Fri, 6 Nov 2026 22:07:51 +0000 Subject: [PATCH 7/8] chore(nix): upgrade trunk to 0.22.1 via vendored derivation --- flake.nix | 5 +++++ nix/trunk.nix | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 nix/trunk.nix diff --git a/flake.nix b/flake.nix index 5968a386..09f376af 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,11 @@ perSystem = {system, ...}: let overlays = [ inputs.rustnix.lib.rust.overlays.fenix + ( + final: _prev: { + trunk = final.callPackage ./nix/trunk.nix {}; + } + ) ]; pkgs = import inputs.nixpkgs {inherit system overlays;}; diff --git a/nix/trunk.nix b/nix/trunk.nix new file mode 100644 index 00000000..06a1913d --- /dev/null +++ b/nix/trunk.nix @@ -0,0 +1,37 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + pkg-config, + openssl, +}: let + pname = "trunk"; + version = "0.22.1"; +in + rustPlatform.buildRustPackage { + inherit pname version; + + src = fetchFromGitHub { + owner = "trunk-rs"; + repo = "trunk"; + rev = "v${version}"; + hash = "sha256-GXwFLOjmNZL2qNgFLG18pM+jXLvR4u80SUyjH9dsnJM="; + }; + + nativeBuildInputs = [pkg-config]; + + buildInputs = [openssl]; + + # requires network + checkFlags = ["--skip=tools::tests::download_and_install_binaries"]; + + cargoHash = "sha256-k4yQrT3gxjLPL5hI+1LtU0Nrd2a0ksGSAmI2I2AUZn0="; + + meta = { + homepage = "https://github.com/trunk-rs/trunk"; + description = "Build, bundle & ship your Rust WASM application to the web"; + mainProgram = "trunk"; + maintainers = with lib.maintainers; [ctron]; + license = lib.licenses.asl20; + }; + } From 4625d02cbb4bdb872760de5acb12408406beb6ad Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Fri, 6 Nov 2026 22:27:15 +0000 Subject: [PATCH 8/8] fix(frontend): anchor task detail dialog to a fixed 90vh box thaw 0.5.0-beta ships .thaw-dialog-surface with height: fit-content, and the override only capped the surface at max-height: 90vh. The height therefore still followed content up to the cap, so the dialog jumped and grew as different tasks were selected. Set height: 90vh directly on .task-detail-dialog-surface and drop the max-h-[90vh] utility from the DialogSurface class so input.css is the sole height source. Give the main pane min-height: 0 and make the below-1024px stacked side pane a fixed 40vh, so both panes scroll internally instead of pushing the box. The dialog now replicates the note-detail pattern: viewport-fixed height, min-h-0 scroll panes. --- crates/context-frontend/src/components/task_components.rs | 2 +- crates/context-frontend/src/public/style.css | 8 +++----- crates/context-frontend/src/tailwind/input.css | 8 ++++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/crates/context-frontend/src/components/task_components.rs b/crates/context-frontend/src/components/task_components.rs index 7a84d847..2b21a627 100644 --- a/crates/context-frontend/src/components/task_components.rs +++ b/crates/context-frontend/src/components/task_components.rs @@ -897,7 +897,7 @@ pub fn TaskDetailDialog( view! { - +
diff --git a/crates/context-frontend/src/public/style.css b/crates/context-frontend/src/public/style.css index bd0b39f3..415a3d45 100644 --- a/crates/context-frontend/src/public/style.css +++ b/crates/context-frontend/src/public/style.css @@ -393,9 +393,6 @@ .h-full { height: 100%; } - .max-h-\[90vh\] { - max-height: 90vh; - } .min-h-0 { min-height: 0px; } @@ -1334,7 +1331,7 @@ body { .task-detail-dialog-surface { width: 95vw !important; max-width: 95vw !important; - max-height: 90vh !important; + height: 90vh !important; overflow: hidden !important; } .task-detail-dialog-surface.thaw-dialog-surface { @@ -1365,6 +1362,7 @@ body { .task-detail-split-main { flex: 1; min-width: 0; + min-height: 0; overflow-y: auto; } @media (max-width: 1023px) { @@ -1373,7 +1371,7 @@ body { } .task-detail-split-side { width: 100%; - max-height: 40vh; + height: 40vh; border-right: none; border-bottom: 1px solid var(--ctp-surface1); } diff --git a/crates/context-frontend/src/tailwind/input.css b/crates/context-frontend/src/tailwind/input.css index 110b383a..95bcb4ec 100644 --- a/crates/context-frontend/src/tailwind/input.css +++ b/crates/context-frontend/src/tailwind/input.css @@ -188,7 +188,7 @@ body { .task-detail-dialog-surface { width: 95vw !important; max-width: 95vw !important; - max-height: 90vh !important; + height: 90vh !important; overflow: hidden !important; } @@ -198,8 +198,7 @@ body { flex-direction: column; } -/* Body fills remaining space inside the surface (after 48px padding). - No max-height needed — the surface's max-height: 85vh constrains it via flex. */ +/* Body fills the fixed surface height (90vh minus the 24px surface padding on each side). */ .task-detail-dialog-surface .thaw-dialog-body { flex: 1 !important; min-height: 0 !important; @@ -228,6 +227,7 @@ body { .task-detail-split-main { flex: 1; min-width: 0; + min-height: 0; overflow-y: auto; } @@ -238,7 +238,7 @@ body { .task-detail-split-side { width: 100%; - max-height: 40vh; + height: 40vh; border-right: none; border-bottom: 1px solid var(--ctp-surface1); }