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

switch library to ratatui #91

Closed
blacknon opened this issue Apr 14, 2023 · 4 comments
Closed

switch library to ratatui #91

blacknon opened this issue Apr 14, 2023 · 4 comments
Milestone

Comments

@blacknon
Copy link
Owner

The library (tui-rs) we were using is no longer under development, so we switch to ratatui, which we forked.

@blacknon
Copy link
Owner Author

For some reason, as soon as I switched to ratatui, watch/history disappeared...

b6e4be7

@blacknon
Copy link
Owner Author

blacknon commented Apr 14, 2023

For some reason, as soon as I switched to ratatui, watch/history disappeared...

b6e4be7

The following areas are likely to be the cause of the problem.

hwatch/src/app.rs

Lines 288 to 305 in b6e4be7

// get Area's chunks
let top_chunks = Layout::default()
.constraints([Constraint::Length(header_height), Constraint::Max(0)].as_ref())
.split(total_area);
let main_chunks = Layout::default()
.constraints(
[
Constraint::Max(total_area.width - history_width),
Constraint::Length(history_width),
]
.as_ref(),
)
.direction(Direction::Horizontal)
.split(top_chunks[1]);
self.header_area.set_area(top_chunks[0]);
self.watch_area.set_area(main_chunks[0]);
self.history_area.set_area(main_chunks[1]);


The cause of the bug was found.
Constraint::Max(0) does not calculate the maximum value in ratatui and it is 0.
Therefore, it is corrected to calculate it properly.

f9cc1d6

@blacknon blacknon added this to the 0.3.10 milestone Apr 14, 2023
blacknon added a commit that referenced this issue Apr 15, 2023
@orhun
Copy link
Contributor

orhun commented Apr 18, 2023

Hey, maintainer of ratatui here. Can you point out to me the code/change that broke Constraint::Max for you? I would like to understand what happened there and possibly add a note to the changelog.

@blacknon
Copy link
Owner Author

blacknon commented Jul 9, 2023

Sorry, it was a long time ago and my memory has faded.
I will look into it and if I find out, I will describe it. 🙇

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

No branches or pull requests

2 participants