Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/tui/src/tui/work_surface/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ fn finished_shell_outcome(locale: Locale, entry: &TaskPanelEntry) -> String {
}

/// Row ids of the plan-step (to-do) nodes in the cached graph.
fn plan_step_row_ids(app: &App) -> HashSet<String> {
pub(super) fn plan_step_row_ids(app: &App) -> HashSet<String> {
app.work_surface
.cached_graph
.as_ref()
Expand Down
11 changes: 9 additions & 2 deletions crates/tui/src/tui/work_surface/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use codewhale_palette::{ChromeInk, chrome_style};

use super::model::{
DockTabHitbox, DockTabTarget, RailPanel, WorkHitbox, WorkRow, WorkSurfacePlacement, WorkTone,
visible_rows_for, visible_rows_for_panel,
plan_step_row_ids, visible_rows_for, visible_rows_for_panel,
};

mod layout;
Expand Down Expand Up @@ -121,6 +121,7 @@ pub fn render(frame: &mut Frame, area: Rect, app: &mut App) {
HashMap::new()
};
let ordinal_width = todo_ordinals.len().max(1).to_string().len();
let todo_ids = plan_step_row_ids(app);
let goal_title = placement.is_strip().then(|| top_goal_title(app)).flatten();
let todo_progress = placement
.is_strip()
Expand Down Expand Up @@ -357,7 +358,13 @@ pub fn render(frame: &mut Frame, area: Rect, app: &mut App) {
};
let prefix_width = UnicodeWidthStr::width(prefix.as_str());
let row_width = usize::from(content_area.width);
let label_budget = row_width.saturating_sub(prefix_width).max(1);
let detail_room = if todo_ids.contains(&row.id.0) {
UnicodeWidthStr::width(detail_candidate.as_str())
.min(row_width.saturating_sub(prefix_width) / 2)
} else {
0
};
let label_budget = row_width.saturating_sub(prefix_width + detail_room).max(1);
let label = truncate_line_to_width(&row.label, label_budget);
let detail_budget =
row_width.saturating_sub(prefix_width + UnicodeWidthStr::width(label.as_str()));
Expand Down
Loading