Im-Beast / deno_tui

🦕 Deno module for creating Terminal User Interfaces
https://deno.land/x/tui
MIT License
266 stars 18 forks source link

feat req: Improve Table component's border #45

Closed ngdangtu-vn closed 8 months ago

ngdangtu-vn commented 8 months ago

What this feature is meaning to achieve

Better developer experience by offering description that be easy to understand, and new options to improve the lib quality.

Solution

Note: 1 & 2 is connected to each other. If you want to keep the term 'frame', we can ignore 2. But if you think 'border' is a good term, we should update 2 as well.

  1. Rename TableOptions.charMap to TableOptions.borderStyle. I believe it will help dev who try to modify the border understand where to look for.
  2. Rename TableOptions.theme.frame to TableOptions.theme.border .
  3. TableOptions.charMap should have an option none to completely remove border.

Describe alternatives you've considered

For suggestion 3, I set crayon.hidden in theme.frame for now. But I think it make more sense in TableOptions.charMap right?

I trid the GridLayout in replace of no broder but it doesn't feel right when I have a table data and use grid on it.

ngdangtu-vn commented 8 months ago

I think I can work on this if my proposal got approved.

Im-Beast commented 8 months ago

I'd rather not add any breaking changes to Tui 2 right now, unless completely necessary. I'm slowly working on Tui 3 and it'd most likely become wasted work when it releases.

ngdangtu-vn commented 8 months ago

I'm sorry but what do you mean "wasted work"? Do you already have a new table component in Tui 3?

Im-Beast commented 8 months ago

Tui 3 API will be completely different from current one, and for the most part components won't be able to be reused.

ngdangtu-vn commented 8 months ago

That's cool, my app is not too big so I don't mind to migrate to newer version. But coming from CSS background, I really like to use the term "border". Do you mind if I suggest it for Tui 3? The term "frame" can be useful for other case so it is kinda waste to use it on visual feature like table border.

Im-Beast commented 8 months ago

Nice already uses the term border, and it will translate its way to Tui 3