MitMaro / git-interactive-rebase-tool

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.
https://gitrebasetool.mitmaro.ca/
GNU General Public License v3.0
1.55k stars 48 forks source link

Show help if there's spare screen space #53

Closed alok closed 3 years ago

alok commented 6 years ago

At least in my case, there's often a bunch of unused screen real estate, and displaying the help menu (or changing the display of the Actions: bar at the bottom) would be nice. Sort of like WordStar

alok commented 6 years ago

Something like the vim git-rebase message could also be handy since it reminds me that commands are run top to bottom and that squash is melded into the commit above (which i have a weirdly large amount of trouble remembering).

Rustin170506 commented 4 years ago

@MitMaro Can I work on it? I want to contributing. I think this maybe is a great place to get started.

MitMaro commented 4 years ago

@Rustin-Liu Absolutely! Contributions are welcome!

MitMaro commented 4 years ago

Also, in case you missed it, if you get a PR up in October it can count towards the Hacktoberfest!

https://hacktoberfest.digitalocean.com/

Rustin170506 commented 4 years ago

Also, in case you missed it, if you get a PR up in October it can count towards the Hacktoberfest!

https://hacktoberfest.digitalocean.com/

Got it! Thank you very much.

Rustin170506 commented 4 years ago

Hey @MitMaro! I want to show help in header, if window's height twice the help lines length.

But, now I am confused about how to design the layout.

I want declare a const variable in constants.rs. _pub const HEADER_HELP_ITEMLENGTH: i32 = 46; I want to use this const length to align the each help item. I want to display three entries per line. So the show help condition is window's height twice the help lines length and window's width three times HEADER_HELP_ITEM_LENGTH.

I think the final look like: image

Do you think I can do this, do you have other solutions?

Rustin170506 commented 4 years ago

Hey @MitMaro! I want to show help in header, if window's height twice the help lines length.

But, now I am confused about how to design the layout.

I want declare a const variable in constants.rs. _pub const HEADER_HELP_ITEMLENGTH: i32 = 46; I want to use this const length to align the each help item. I want to display three entries per line. So the show help condition is window's height twice the help lines length and window's width three times HEADER_HELP_ITEM_LENGTH.

I think the final look like: image

Do you think I can do this, do you have other solutions?

@MitMaro ping~

MitMaro commented 4 years ago

Hey @Rustin-Liu , I missed your previous comment. Thanks for the ping!

I think it would be better to have the expanded help replace the existing help line that is on the bottom when there is room. With the help on the top, there would be a UI flicker when the screen is resized large enough to add the additional help.

As for the alignment with three items, I think that will be fairly difficult with the current setup. I would look into what the GNU nano editor does for the help line for inspiration. However, unlike nano it would make sense to expand the number of help lines as there is available screen size. It may be possible to use a constant width for each help item and add more items as the screen expands.

Example

Done with a text editor so by no means a final idea.

Screenshot from 2019-10-28 10-43-55

Nano

Screenshot from 2019-10-28 10-20-22

Screenshot from 2019-10-28 10-20-40

Rustin170506 commented 4 years ago

Hey @Rustin-Liu , I missed your previous comment. Thanks for the ping!

I think it would be better to have the expanded help replace the existing help line that is on the bottom when there is room. With the help on the top, there would be a UI flicker when the screen is resized large enough to add the additional help.

As for the alignment with three items, I think that will be fairly difficult with the current setup. I would look into what the GNU nano editor does for the help line for inspiration. However, unlike nano it would make sense to expand the number of help lines as there is available screen size. It may be possible to use a constant width for each help item and add more items as the screen expands.

Example

Done with a text editor so by no means a final idea.

Screenshot from 2019-10-28 10-43-55

Nano

Screenshot from 2019-10-28 10-20-22

Screenshot from 2019-10-28 10-20-40

Got it.
I can try it.

But I have a problem about help item. Do you mean we just display short description, help item not same to help page?

By the way, I finished my hacktobefest challenge. Thank you!

MitMaro commented 4 years ago

Do you mean we just display short description, help item not same to help page?

Yeah, I think a short description would be okay.

I haven't put much thought into this, so I am also open to other ideas. Feel free to send along some other concepts. And ping me if I don't respond in a couple days! :)

MitMaro commented 3 years ago

I've decided to completely remove the inline help in the next release. It had grown large enough that it was meaningless and there built-in help display is always a key press away.