You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(console): add dynamic constraints layout in task details screen (#614)
The changes I've made is for accommodating long location names.
I've changed the .. to the long name; it widens the task rectangle if its longer
than the default (50%) and goes to the next line if its longer than what we can
accommodate in a single line. This fixes issue #523, I have attached screenshots
of the same in the PR, before and after changes.
Fixes#523
Co-authored-by: Hayden Stainsby <[email protected]>
Copy file name to clipboardExpand all lines: tokio-console/src/view/task.rs
+47-31
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,18 @@ impl TaskView {
68
68
})
69
69
.collect();
70
70
71
+
let location_heading = "Location: ";
72
+
let max_width_stats_area = area.width - 45;//NOTE: 45 is min width needed, this is a calculated number according to the string: 'Last woken: 75.831727ms ago' but with some more extra pixels.
73
+
let location_lines_vector:Vec<String> = task
74
+
.location()
75
+
.to_string()
76
+
.chars()
77
+
.collect::<Vec<char>>()
78
+
.chunks(max_width_stats_area asusize)
79
+
.map(|chunk| chunk.iter().collect())
80
+
.collect();
81
+
let task_stats_height = 9 + location_lines_vector.len()asu16;
82
+
// Id, Name, Target, Location (multiple), total, busy, scheduled, and idle times + top/bottom borders
0 commit comments