-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resize/redraw issues with small terminal #224
Comments
Your VIT currently does all column size calculations when:
The underlying Urwid library handles the hiding of columns when the current screen width gets too small to view them all. There is already some dynamic resizing code in The only option I see is to do a similar kind of detection for horizontal changes, and completely rebuild the column display every time. Re-rendering the display would need to be kept separate from re-reading the report data from TaskWarrior, otherwise the operation would be prohibitively slow. We'd have to figure out which of the display calculations from the initial render we could cache for efficiency, and which would need to be re-calculated. Even then I'm not totally sure how efficient the redraws would be. We're talking about an awful lot of work, when hitting All this to say that, yes, there is some display logic that could be more automated, but it's pretty low on my priority list to do the work to address it. So most likely, to move this issue forward, it would take:
|
Thanks for thoughtful response. The workaround of I believe this is the dynamic vertical sizing code you're referring to, handlers for user events that trigger redraw: I'll leave it to you to close this out or to keep it open as a low priority, pipe-dream ticket. |
Yes, that's the event fired that can be caught for the purpose of handling the resize. I believe it passes the new size along. VIT has a stateful representation of the data, and the configuration, which is all that's necessary. The potential challenge is that currently We can keep it open, maybe somebody will take a stab at it. |
Just wanted to add my experience to this. The above mentioned workarounds helped me to figure this out, and I also had the reload key remapped in tmux so i had to map it to CTRL+r for vit instead. On a large monitor, I still run into this issue. I have annotations and "long" descriptions, (ranging from 5 to ~20 words). The description column goes hidden, making for a rather unuseful list. What I do to fix it each time is:
I can then read the descriptions until I do another filter. rephrased question: Does there exist a way to hook onto the filter action? |
I'm not willing to do that. The correct approach is detailed above, I look forward to a PR to review! |
For me, 8d885c2 no longer has this issue for me. Updated the Arch AUR package accordingly. |
What
When the terminal is resized smaller, columns are dropped if they don't fit. But it seems that forcing a redraw makes them reappear again.
It feels like there is a bug in not recalculating and evaluating column widths before truncating the columns.
Impact
This is not necessarily broken or bad behaviour, it's merely inconsistent.
Repro Steps
pip install
vit
from source: 811c480Run the test script and this command generate data:
Resize terminal to <120 char
Launch
vit
withready
Decrease terminal width, this will drop description column
Invoke the ready report again. i.e.
:ready
Column widths are resized, description column is visible again. Note that the issue can be continually reproduced, but only for subsequently smaller widths.
Let me know if you feel it's useful to have screenshot but this is easily reproducible.
The text was updated successfully, but these errors were encountered: