GothenburgBitFactory/taskwarrior

Layout breaks if report does not fit in the available width

ad-si opened this issue ยท 11 comments

ad-si commented

I'm getting the warning The report has a minimum width of 225 and does not fit in the available width of 211. when running task all because of a really long line:

screen shot 2018-05-13 at 07 23 52

The native wrapping of the the terminal then unfortunately breaks the whole layout, as every line which was just one line height before is now two lines high:

screen shot 2018-05-13 at 07 27 33

The problem is that every line is padded to same length as the longest line.
I guess the correct fix for this would be to support native wrapping in taskwarrior, so that the description line gets wrapped properly. However, I don't know how time-consuming this will be.
Maybe as a quick-fix there could be a config flag to not pad lines with spaces?
This will make the highlighted lines look jagged, but still better than this awful wrapping.

What do you think?

It's a bug alright. There is support for hyphenation, but somewhere along the line, it broke. Hyphenation is supposed to only kick in when this situation happens. Thanks for reporting.

The padding is actually necessary for color support, so I'd rather fix hyphenation.

ad-si commented

So if this is a bug, when is the "โ€ฆ does not fit in the available width" warning then actually necessary?

looks like proper hyphenation support has been in backlog for a while: #74

This is now fixed on our latest releases. Tested on 2.5.2, 2.5.3, 2.6.0.

[warrior@tw-v2.5.2 ~]$ task add test
Created task 1.
[warrior@tw-v2.5.2 ~]$ task 1 ann https://github.com/GothenburgBitFactory/taskwarrior/issues/2023/liebherr.com/shared/media/aerospace-and-transportation/aerospace/downloads/magazines/aets-magazines-recent/liebherr-aerospace-magazine-2016-de.pdf
Annotating task 1 'test'.
Annotated 1 task.
[warrior@tw-v2.5.2 ~]$ task
[task next]

ID Age  Description                                                                                                       Urg 
 1 4s   test                                                                                                               0.8
          2021-06-19
        https://github.com/GothenburgBitFactory/taskwarrior/issues/2023/liebherr.com/shared/media/aerospace-and-transpor-
        tation/aerospace/downloads/magazines/aets-magazines-recent/liebherr-aerospace-magazine-2016-de.pdf

1 task
bjce commented

Dear @tbabej

First a huge thanks to you and all the other developpers for developping and maintaining taskwarrior which is awesome.

I just installed taskwarrior yesterday (I have version 2.5.3 on MacOS) but I still got the error message: The report has a minimum width of 96 and does not fit in the available width of 60. Am I doing something wrong?

i noticed that the bug seems to be fixed, if the long text in question is applied as an Annotation. If the task main description itself, has a very long name (say a URL), then the report display seems broken.

tldr: this fix works on annotations, not the main task description itself.

I used the same long URL to the description and also the annotation.
image

@mhalano what version are you on?

I'm using 2.5.3.

I see. I think what is happening here is that the description stretches the width (the other half of this bug), so the annotation does not get wrapped, because it doesn't have to.

I'll reopen this and try to see if we can fix this in 2.6.0.

This is now fixed on 2.6.0:

$ task add https://github.com/GothenburgBitFactory/taskwarrior/compare/handle_neg_overage?expand=1https://github.com/GothenburgBitFactory/taskwarrior/compare/handle_neg_overage?expand=1
Created task 1.
The project 'Inbox' has changed.  Project 'Inbox' is 0% complete (1 task remaining).

$ task 1 annotate https://github.com/GothenburgBitFactory/taskwarrior/compare/handle_neg_overage?expand=1https://github.com/GothenburgBitFactory/taskwarrior/compare/handle_neg_overage?expand=1
Annotating task 1 'https://github.com/GothenburgBitFactory/taskwarrior/compare/handle_neg_overage?expand=1https://github.com/GothenburgBitFactory/taskwarrior/compare/handle_neg_overage?expand=1'.
Annotated 1 task.
Project 'Inbox' is 0% complete (1 task remaining).

$ task

 ID Age   Project Description                          Urg 
  1 14s   Inbox   https://github.com/GothenburgBitFac-    0
                  tory/taskwarrior/compare/handle_neg-
                  _overage?expand=1https://github.com-
                  /GothenburgBitFactory/taskwarrior/c-
                  ompare/handle_neg_overage?expand=1
                    2021-09-16
                  https://github.com/GothenburgBitFac-
                  tory/taskwarrior/compare/handle_neg-
                  _overage?expand=1https://github.com-
                  /GothenburgBitFactory/taskwarrior/c-
                  ompare/handle_neg_overage?expand=1

1 task