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
In the task detail screen, there are two panels which split the width of the screen in half. The Task panel and the Waker panel.
The task panel is 7 or 8 lines high (depending on whether the task has a name defined). The Waker panel is just 2 lines high. Additionally, the location of the task can sometimes overflow the width of the Task panel, causing the beginning of the location to not be visible.
See the screenshot below which illustrates how the location can't be seen yet we have plenty of space elsewhere:
Additionally, if the task doesn't have a name, we don't list the name line at all, which results in an empty line at the bottom of the Task panel:
How should the problem be solved?
The space on that panel should be better optimised.
The Waker panel could be split onto more lines. So instead of looking like this:
This would free up more horizontal space. Then the Task panel could be made wider and the Waker panel narrower.
Additionally, the hight should depend on how many lines are actually needed. If the task has no name, then we can make the Task and Waker panels one line shorter.
For bonus points, the Location field in the Task panel could be split onto multiple lines (up to some reasonable maximum like 2 or 3) in case it still doesn't fit into the space provided. If done, it would make sense to submit this change as a separate PR.
This could end up with the two panels looking like this:
Currently we hard code the height of the Task and Waker panels here in two places depending on whether there is an active warning for the task being viewed. That happens here:
We could make that height dependent on the real height of those panels.
The Task and Waker panel contents are created inline in the render function. This is done after the constraints have already been calculated. Instead of that, the creation of each panel could be factored out into separate functions (or actual widget implementations). If the creation of each panel contents also returns the minimum area that it needs (width and height), then the "chunking" of the total area could be performed a bit more dynamically.
What problem are you trying to solve?
In the task detail screen, there are two panels which split the width of the screen in half. The Task panel and the Waker panel.
The task panel is 7 or 8 lines high (depending on whether the task has a name defined). The Waker panel is just 2 lines high. Additionally, the location of the task can sometimes overflow the width of the Task panel, causing the beginning of the location to not be visible.
See the screenshot below which illustrates how the location can't be seen yet we have plenty of space elsewhere:
Additionally, if the task doesn't have a name, we don't list the
name
line at all, which results in an empty line at the bottom of the Task panel:How should the problem be solved?
The space on that panel should be better optimised.
The Waker panel could be split onto more lines. So instead of looking like this:
It could be split onto multiple lines:
This would free up more horizontal space. Then the Task panel could be made wider and the Waker panel narrower.
Additionally, the hight should depend on how many lines are actually needed. If the task has no name, then we can make the Task and Waker panels one line shorter.
For bonus points, the Location field in the Task panel could be split onto multiple lines (up to some reasonable maximum like 2 or 3) in case it still doesn't fit into the space provided. If done, it would make sense to submit this change as a separate PR.
This could end up with the two panels looking like this:
However, if the location isn't so long, we should probably not squash the Waker panel up any more than necessary:
Implementation hints
Currently we hard code the height of the Task and Waker panels here in two places depending on whether there is an active warning for the task being viewed. That happens here:
console/tokio-console/src/view/task.rs
Line 86 in 28a27fc
and here:
console/tokio-console/src/view/task.rs
Line 108 in 28a27fc
We could make that height dependent on the real height of those panels.
The Task and Waker panel contents are created inline in the render function. This is done after the constraints have already been calculated. Instead of that, the creation of each panel could be factored out into separate functions (or actual widget implementations). If the creation of each panel contents also returns the minimum area that it needs (width and height), then the "chunking" of the total area could be performed a bit more dynamically.
Task panel:
console/tokio-console/src/view/task.rs
Lines 142 to 187 in 28a27fc
Waker panel:
console/tokio-console/src/view/task.rs
Lines 189 to 222 in 28a27fc
Keep in mind that the self wakes count is optional, the waker panel will have a different minimum height if it is present!
console/tokio-console/src/view/task.rs
Line 213 in 28a27fc
Any alternatives you've considered?
We could only split the Location field onto multiple lines, and leave the rest of the layout where it is.
The text was updated successfully, but these errors were encountered: