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

fix(console): stop truncating task fields column #82

Merged
merged 1 commit into from Aug 4, 2021

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Aug 4, 2021

Currently, there's a bug where the console's task list view truncates
the fields column to the first ten characters, even when there are
characters remaining in the window to display more of the fields column.
This is due to tui's layout constraints system apparently choosing to
give that column only the minimum number of characters specified,
instead of giving it all the remaining characters not used by other
columns.

I couldn't figure out how to get tui to actually do what we want
(there doesn't seem to be a Constrait for saying "use any remaining
characters not needed for satisfying previous layout constraints"), so I
just kind of hacked around it by adding up all the other columns,
subtracting their widths from the total width of the window, and
specifying that as a "minimum" constraint.

This is kinda ugly, but it seems to work.

Before:

image

After:

image

Signed-off-by: Eliza Weisman eliza@buoyant.io

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw self-assigned this Aug 4, 2021
@hawkw hawkw requested a review from seanmonstar August 4, 2021 16:31
@hawkw
Copy link
Member Author

hawkw commented Aug 4, 2021

Apparently there is some known weird behavior with tui's constraint system: fdehau/tui-rs#499

@hawkw hawkw merged commit 1abf13d into main Aug 4, 2021
@hawkw hawkw deleted the eliza/fix-constraints branch August 4, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant