-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
feature(resize): Non directional resize #520
Conversation
@henil - is this working for you? I can't get it to work with |
@imsnif Yes. Currently it tried to increase/decrease size on two direction at the same time so it would not work when there are only two panes open (without that constraint it would be very ambiguous to find when to resize what 😅 ) . Have you tried with more than 2 panes? |
Yeah, I'm just trying again. Tbh I'm not even reaching the function (put a debug there and I'm not getting to it). Still investigating |
Right! I got it to work :) I think the issue was on my side because of my convoluted environment, sorry! This is a great start and I'm happy to see you picked it up. A few things:
|
Will do.
That shouldn't be any problem, I could just add an extra condition that checks if 2 panes are open and do a normal resize in that case.
I am afraid I don't understand what you mean by increase in both direction, Can we talk about this more on discord. |
4e6b27c
to
28814a6
Compare
Hey @henil - great progress! With 4 panes this works like a charm. That's exactly what I meant and it looks great. I think we need to go about this in a bit of a different way though, because if the same situation exists with more than 4 panes it still reverts to the previous behaviour. To reproduce:
While there are 5 panes on the screen now, we still want it to behave in the same way. |
Yes. That makes sense, but I will need some help about how to go about implementing it. Will reach out to you on discord. |
0a45016
to
f119765
Compare
970b810
to
8e19361
Compare
@henil - this is really awesome!! I haven't looked a the code yet, just trying it out. But I think I noticed a bug, seems like panes can now be reduced in size so that they become too small (both with
The minimum height should be at least one line of "content" (aside from the frame). You can compare the behaviour to how it is in main. |
@imsnif I am able to reproduce that bug on main as well. Also I am only using "higher level" function call so that shouldn't be a problem in this PR I think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@henil - for some reason I stopped being able to reproduce it either here or on main. Oi! Might have to do with more specific circumstances. Let's leave it for now. So, on to the review:
I went over all the code and functionality, and I must say: this is very good work! One can see that you put a lot of thought and effort into this. The changes are elegant and you have a meticulous attention to details. I can very much congratulate you on that!
I left a few comments in the code - but nothing very major I think. I'm eager to get this into main and release it as soon as possible. Please let me know if anything is unclear or you'd like any help.
EDIT:
Almost forgot. Do you think you can add some unit tests for this? Preferably for each case. I think you can start with the resize tests here: https://github.com/zellij-org/zellij/blob/main/zellij-server/src/unit/tab_tests.rs#L2529
@henil - let me know when everything is implemented and you'd like another review. |
@imsnif I have implemented suggested changes and added test, can you take a look when you get time. |
Hey @henil - I think I found a way to simplify the methods and share lots of logic between them. I made the changes (and also fixed some small cosmetic stuff in the status bar). What do you think? I'm good with merging this now if you're cool with it. |
Yes. Looks good to me! |
Awesome! Thank you very much for your hard work on this. You did a great job and I think this is an amazing feature. |
Closes: #163
Feel free to suggest better names for
enum
s andfuntion
s, I am not good with names : )For future reference, I am mentioning what the code does:
panes
are insideviewport
.+
cross section in any of the four corners. If yes then resize accordingly.T
cross section and resize accordingly.