Skip to content
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

Layout breaks if report does not fit in the available width #2023

Closed
ad-si opened this issue May 13, 2018 · 11 comments · Fixed by #2602
Closed

Layout breaks if report does not fit in the available width #2023

ad-si opened this issue May 13, 2018 · 11 comments · Fixed by #2602
Labels
type:bug Something isn't working
Milestone

Comments

@ad-si
Copy link

ad-si commented May 13, 2018

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?

@pbeckingham pbeckingham added the type:bug Something isn't working label May 13, 2018
@pbeckingham
Copy link
Member

pbeckingham commented May 13, 2018

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
Copy link
Author

ad-si commented May 13, 2018

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

@chaseadam
Copy link

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

0xACE added a commit to 0xACE/taskwarrior that referenced this issue Oct 11, 2019
This addresses GothenburgBitFactory#2023

For many years linewrap has been broken in taskwarrior, rendering the
application basically useless in terminals with short widths and tasks
containing URLs in them... This janky line wrap patch sort of works but
introduces other minor graphical glitches.

But seeing as no one took the time to fix it over the years, here some a
small salvation to those who suffer as much as me.

One problem of this patch is, when a line is wrapped, it may be 1 column
smaller than the terminal width, resulting in each line not fully
utilizing the terminal width.

This patch is not polished and could probably need to be tended by
someone who cares more.
pbeckingham pushed a commit that referenced this issue Mar 12, 2020
This addresses #2023

For many years linewrap has been broken in taskwarrior, rendering the
application basically useless in terminals with short widths and tasks
containing URLs in them... This janky line wrap patch sort of works but
introduces other minor graphical glitches.

But seeing as no one took the time to fix it over the years, here some a
small salvation to those who suffer as much as me.

One problem of this patch is, when a line is wrapped, it may be 1 column
smaller than the terminal width, resulting in each line not fully
utilizing the terminal width.

This patch is not polished and could probably need to be tended by
someone who cares more.
@tbabej tbabej added this to the 2.6.0 milestone Jun 19, 2021
@tbabej
Copy link
Member

tbabej commented Jun 19, 2021

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
Copy link

bjce commented Jul 6, 2021

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?

@kaushikgopal
Copy link

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.

@mhalano
Copy link

mhalano commented Aug 28, 2021

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

@tbabej
Copy link
Member

tbabej commented Aug 28, 2021

@mhalano what version are you on?

@mhalano
Copy link

mhalano commented Aug 28, 2021

I'm using 2.5.3.

@tbabej
Copy link
Member

tbabej commented Aug 28, 2021

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.

@tbabej
Copy link
Member

tbabej commented Sep 16, 2021

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

tbabej added a commit that referenced this issue Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
7 participants