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

[Feature]: addColumn (instead of double or quad) #74

Open
1 of 2 tasks
exetico opened this issue Sep 20, 2023 · 12 comments · Fixed by #75
Open
1 of 2 tasks

[Feature]: addColumn (instead of double or quad) #74

exetico opened this issue Sep 20, 2023 · 12 comments · Fixed by #75
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@exetico
Copy link

exetico commented Sep 20, 2023

What do you want?

Allow columns, too. Like used in Bootstrap's Grid-system (Columns, rows) to give the dev better options on how to setup a given layout. I'd also like to control, if the "Logs" should be be rendered in a specific column or row.

Why do you want it?

It would enable the dev to generate GUI-elements, instead of having to force the design in a "double" or "quad" layout.

How do you implement it?

Two rows, each with two columns:
billede
Yes, that's actually a QuadLayout, but done manually.

I'd also like it to support two "horizontal views", where the first one contains two rows, and no. 2 is a single big one:
billede

Another solution would be to just support a "triple` layout, maybe two (one for 100% left colum height, and one for 100 right column height - like the example).

Also, just to add it:
Personally I had a hard find spotting the "quad" option. Maybe I just missed the example, but after i noticed [https://github.com/Elius94/console-gui-tools/blob/main/docs/QuadLayout.md) in the docs, I though.... The quad-option must be part of the "type" on ConsoleGuiOptions, and luckily it was.

I understand that the addColumn doesnt really fit into the current solution, if I understand the code-base correctly, so the other alternative with two new Layouts would be a good alternative. Maybe even just one, and a "mirror" function (but that's not that logical, for most users).
Yet another take would be to just allow one to be stretched to 100% height, and tell the user to set the proper pageRatio (Like [[0.3, 0.7],[0.3, 0.7]] , where page 2 (1) is defined with 100% height). But right now, I even struggle to find the function to render a 100% height ConsoleManager.

I'm new to the console-gui-tools, but I've looked at terminal-kit (node), and solutions like urwid (python) and bash solutions like whiptail / dialog and a few others. But console-gui-tools looks very great! In urwid I find myself using way too much time creating simple GUI changes, instead of the functions behind it.

Are you interested in developing this feature?

  • Yes, I am interested in developing this feature
  • No, I am not interested in developing this feature
@exetico exetico added the enhancement New feature or request label Sep 20, 2023
@exetico
Copy link
Author

exetico commented Sep 20, 2023

I can see there's a triple option for type, but it looks like it's "just" rendering three "pages" after each other (vertical, like rows). I tried it in ConsoleManager where it's just throwing a error with setPage

TypeError: Cannot read properties of undefined (reading 'setPage')
    at file:///Users/user/Documents/git/node_terminal_flash_tool/node_modules/console-gui-tools/dist/esm/ConsoleGui.mjs:27:73344
    at Array.forEach (<anonymous>)
    at mt.setPages (file:///Users/user/Documents/git/node_terminal_flash_tool/node_modules/console-gui-tools/dist/esm/ConsoleGui.mjs:27:73244)
    at y.setPages (file:///Users/user/Documents/git/node_terminal_flash_tool/node_modules/console-gui-tools/dist/esm/ConsoleGui.mjs:27:83818)
    at y.updateLayout (file:///Users/user/Documents/git/node_terminal_flash_tool/node_modules/console-gui-tools/dist/esm/ConsoleGui.mjs:27:79091)
    at new y (file:///Users/user/Documents/git/node_terminal_flash_tool/node_modules/console-gui-tools/dist/esm/ConsoleGui.mjs:27:78421)
    at file:///Users/user/Documents/git/node_terminal_flash_tool/index.js:30:13
    at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:281:24)

Double and quad works as expected. But I guess this comment should be part of another issue... 👌

billede

@Elius94
Copy link
Owner

Elius94 commented Sep 20, 2023

Hi! thanks for reporting this issue!
It should be planned to feature list!
I hope to get the time as soon as possible.
Any help is well accepted 👍🏼

@exetico
Copy link
Author

exetico commented Sep 20, 2023

While I have your attention, are there any way to force the render to be 100% of my terminal?

billede
So I dont have the space in the buttom, but instead, have all pages to, in total, take up 100% height, even though the content doesn't need it.

So it will always use 100% of the screen?

I've tried to play around with settings and functions, but sadly with no luck.

@Elius94 Elius94 self-assigned this Sep 22, 2023
Elius94 added a commit that referenced this issue Sep 22, 2023
Fixes #74

Added fitHeight layout option
@Elius94
Copy link
Owner

Elius94 commented Sep 22, 2023

Hello!
I've released v3.2.0 that includes "fitHeight" prop in the layout options object. It should solve your secondary issue.
For the main question you hasked. I'll keep in mind but currently I can't spend too much time to this. I hope in autumn to find time.
Thanks

@Elius94
Copy link
Owner

Elius94 commented Sep 22, 2023

image

@exetico
Copy link
Author

exetico commented Sep 25, 2023

@Elius94 Thank you for pushing this. I'll check and let you know 😄 .

For the primary request, what did you think about the work-around, where you just add two more layouts, where it's just growing full height, so you dont have to implement the addColumn()?

@Elius94
Copy link
Owner

Elius94 commented Sep 25, 2023

I think that DynamicLayout (like your idea) should be a feature for the new major release 4.x.x.
I'll add it to the milestone
Thanks

@exetico
Copy link
Author

exetico commented Sep 25, 2023

Thank you Elia!

@exetico
Copy link
Author

exetico commented Sep 27, 2023

@Elius94 Im sorry for pinging you again, but I'd just like to ask id you have a milestone public on GitHub?

I didn't manage to find it by myself.
https://github.com/users/Elius94/projects/1

Thank you for the fitHeight prop, which works as expected 😄 !

billede

@Elius94 Elius94 added this to the 4.0.0 milestone Sep 27, 2023
@Elius94 Elius94 reopened this Sep 27, 2023
@Elius94
Copy link
Owner

Elius94 commented Sep 27, 2023

https://github.com/Elius94/console-gui-tools/milestone/3

Hi! I've updated the 4.0.0 milestone! I will start the development when some other significant feature requests will be asked.

@exetico
Copy link
Author

exetico commented Sep 27, 2023

@Elius94 Thanks 😄 .

One last thing:
I've used the htop example to generate a new Box({}) called Table, as in the htop example.
But I'd like to use the ConsoleManager layout with two or four pages, where I render the Table in one of the pages.

I've tried to run through the examples and docs, but I've not spotted a way to add the table to a specific page (to a PageBuilder, right?).

Is it correct that I can't add a Box inside my PageBuilder, like my Box (table)?

I'm not sure if it's somewhat related to #47.
Fingers crossed that I'm missed something 🤞.

@Elius94
Copy link
Owner

Elius94 commented Sep 27, 2023

Yeah! this is the main intent of #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants