[GH-ISSUE #533] Help menu flickers when viewing in vertical orientation #220

Closed
opened 2026-02-28 14:47:50 +03:00 by kerem · 5 comments
Owner

Originally created by @isaacdchan on GitHub (Jul 22, 2020).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/533

Currently have spt on a 1080 x 1920 screen. Problem disappears with small enough font size

Understand vertical orientation usage is probably the minority so no rush.

Screen flickers between these two screens:
image
image
With smaller font:
image

Thanks again for such a cool project!

Originally created by @isaacdchan on GitHub (Jul 22, 2020). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/533 Currently have spt on a 1080 x 1920 screen. Problem disappears with small enough font size Understand vertical orientation usage is probably the minority so no rush. Screen flickers between these two screens: ![image](https://user-images.githubusercontent.com/33741008/88128760-77dbaf00-cb8b-11ea-9a83-eb08580137e4.png) ![image](https://user-images.githubusercontent.com/33741008/88128822-95107d80-cb8b-11ea-98bb-35256171a7cd.png) With smaller font: ![image](https://user-images.githubusercontent.com/33741008/88128925-bcffe100-cb8b-11ea-97ce-9e2c3517ae51.png) Thanks again for such a cool project!
kerem closed this issue 2026-02-28 14:47:51 +03:00
Author
Owner

@Rigellute commented on GitHub (Jul 22, 2020):

I also experience this - haven't found a fix yet.

Thanks for opening the issue 👍

<!-- gh-comment-id:662352830 --> @Rigellute commented on GitHub (Jul 22, 2020): I also experience this - haven't found a fix yet. Thanks for opening the issue 👍
Author
Owner

@Nil-Cipher commented on GitHub (Jul 25, 2020):

I'm also having this issue.
glitchy
normal

<!-- gh-comment-id:663907049 --> @Nil-Cipher commented on GitHub (Jul 25, 2020): I'm also having this issue. ![glitchy](https://user-images.githubusercontent.com/20496131/88466458-787d8980-ce9a-11ea-9a49-9acb594868fd.png) ![normal](https://user-images.githubusercontent.com/20496131/88466471-93e89480-ce9a-11ea-9568-091dc7e77bc1.png)
Author
Owner

@dp304 commented on GitHub (Oct 28, 2020):

Hi!

I'm also having this with a "standard" 80x24 terminal (my default).

The problem seems to be that the Cassowary solver (which is used by tui to calculate the column widths in a table) has some non-determinism if the constraints cannot be satisfied; which is the case when the terminal is too narrow to hold all the columns.
In its documentation, there is more explanation to this, as well as a suggested solution to a related problem.

Perhaps a similar fix could be applied to tui: in Table::render(), one could add extra (stronger) constraints on the width ratio of neighbouring columns, but I'm not sure if this would actually work. Possibly related issues in tui: fdehau/tui-rs#161, fdehau/tui-rs#314

Until this problem is somehow handled in tui, I suggest a workaround (PR coming up), where the rows of the table are formatted "manually" into one column.

Another thing I've tried is playing around with the width constraints. For example, one could use Constraint::Percentages instead of Constraint::Lengths, but there are some problems with this:

  • If the terminal is very narrow, it still flickers.
  • If the terminal is moderately narrow (e.g. 80 characters), then the first two columns are shrunk in favour of the third one. It is better to simply omit the third column, so that the first two are properly visible, because these are the important parts of the help text.
<!-- gh-comment-id:717959775 --> @dp304 commented on GitHub (Oct 28, 2020): Hi! I'm also having this with a "standard" 80x24 terminal (my default). The problem seems to be that the Cassowary solver (which is used by `tui` to calculate the column widths in a table) has some non-determinism if the constraints cannot be satisfied; which is the case when the terminal is too narrow to hold all the columns. In its [documentation](https://docs.rs/cassowary/0.3.0/cassowary/#a-simple-example), there is more explanation to this, as well as a suggested solution to a related problem. Perhaps a similar fix could be applied to `tui`: in [`Table::render()`](https://github.com/fdehau/tui-rs/blob/v0.12.0/src/widgets/table.rs#L244-L268), one could add extra (stronger) constraints on the width ratio of neighbouring columns, but I'm not sure if this would actually work. Possibly related issues in `tui`: fdehau/tui-rs#161, fdehau/tui-rs#314 Until this problem is somehow handled in `tui`, I suggest a workaround (PR coming up), where the rows of the table are formatted "manually" into one column. Another thing I've tried is playing around with the width constraints. For example, one could use `Constraint::Percentage`s instead of `Constraint::Length`s, but there are some problems with this: * If the terminal is _very_ narrow, it still flickers. * If the terminal is moderately narrow (e.g. 80 characters), then the first two columns are shrunk in favour of the third one. It is better to simply omit the third column, so that the first two are properly visible, because these are the important parts of the help text.
Author
Owner

@Rigellute commented on GitHub (Oct 30, 2020):

Thank you for the insight into this @dp304, that is interesting ideed!

<!-- gh-comment-id:719448657 --> @Rigellute commented on GitHub (Oct 30, 2020): Thank you for the insight into this @dp304, that is interesting ideed!
Author
Owner

@Rigellute commented on GitHub (Oct 30, 2020):

Closed by #638

<!-- gh-comment-id:719452390 --> @Rigellute commented on GitHub (Oct 30, 2020): Closed by #638
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-tui#220
No description provided.