Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

[0.16] Regression in Constraint::Min for tables #525

Closed
extrawurst opened this issue Aug 15, 2021 · 1 comment
Closed

[0.16] Regression in Constraint::Min for tables #525

extrawurst opened this issue Aug 15, 2021 · 1 comment
Labels

Comments

@extrawurst
Copy link
Contributor

Description

Before 0.16 our table layout worked with all columns being precisely sized and then using Constraint::Min(0) to use all the rest of available space to fill. This worked and 0.16 did not mentioned anything about this being changes but it does not work anymore.

To Reproduce

Switching to Constraint::Percentage(100) luckily workaround the issue.
See: https://github.com/extrawurst/gitui/pull/845/files

Expected behavior

The previous behaviour.

Screenshots

Before we upgraded to 0.16:

Screenshot 2021-08-15 at 17 12 15

After we upgraded to 0.16:

Screenshot 2021-08-15 at 17 12 45

Environment

  • OS: MacOS
  • Terminal Emulator: iterm2
  • Crate version: 0.16
  • Backend: crossterm

Additional context

I assume this regression was introduced in: #514

@Ninja-Koala
Copy link

I noticed that the table example only shows 2 rows in 0.16 instead of 3 rows which are provided in the code and
which can be seen in the example build with version 0.15 . Is this the same bug or should i report it seperately?

Screenshot from 2021-11-03 18-29-34
Screenshot from 2021-11-03 18-28-57

fdehau added a commit that referenced this issue Nov 21, 2021
Third column in table example was using the `Max` constraint.

But since version 0.16, the layout system does not add a hidden constraint on the last column which would ensure that it fills the remaining available space (a change that was already mentioned in #525). In addition, `tui` does not support sizing based on content because of its immediate mode nature. Therefore, `Max` is now resolved to `0`. Replacing with `Min` fixes the issue.

A new way of specifying constraints is being worked on at #519 which should for more deterministic and advanced layout.
@fdehau fdehau mentioned this issue Nov 21, 2021
3 tasks
fdehau added a commit that referenced this issue Nov 21, 2021
Third column in table example was using the `Max` constraint.

But since version 0.16, the layout system does not add a hidden constraint on the last column which would ensure that it fills the remaining available space (a change that was already mentioned in #525). In addition, `tui` does not support sizing based on content because of its immediate mode nature. Therefore, `Max` is now resolved to `0`. Replacing with `Min` fixes the issue.

A new way of specifying constraints is being worked on at #519 which should for more deterministic and advanced layout.
@fdehau fdehau closed this as completed Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants