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
would like to try this out in nushell #143
Comments
Hi @fdncred
I was actually thinking about creating a binary of this kind a bunch of times.
Sure, Then do you propose me to create a prototype? |
Yes, exactly. :) Feel free to say, "No!". What I was thinking and hoping for was to create a My biggest concern is that we truncate columns with |
nice |
how exactly are you generating these cool graphs? |
Well it's not me. Also see #139 I've put there a few more |
Hi @fdncred I've created a small patchwork here https://github.com/zhiburt/nushell/tree/checkout-tabled. I did not made any refactoring and stuff like this; As I see there's a difference in logic of alignment to terminal width. |
and oh, I finally understand your second screenshot. you made the terminal smaller and wow that makes columns kind of disappear. very interesting. it's still cool though, you're doing a great job with |
We could do it by Am I right that nushell just prints headers and the bottom and the top? ref: #126
Quite interesting.
I did a right alignment
Correct By the way I've just noticed that on one of your screenshots table has colored borders. I mean as I understand this theme is not in a default list. |
Couldn't we do both? By certainly the default must be decided. After some work; (not yet finished). I feel like this is similar to your approach right? |
ya, but there's a config setting in nushell that controls when to print it.
in the two screenshots of the regular I'm using a custom theme to make the borders purple and change some other colors. I have this in my config.nu.
and then later on in the
|
we could probably have a config setting to use tabled versus nushell tables. I'm just wondering if tabled needs to support column truncation where we show
I think it's looking better. size isn't right aligned. It would be nice to have a side-by-side nushell table vs tabled table - it's hard to spot differences without comparing, but it's looking good! |
oh, i almost forgot, we have this option too on nushell tables to turn off the first column.
|
So we can either truncate or wrap; See ref: #152 |
So yes there're quite a few things to do to cover the whole nu_table usage.
Don't say we need tests 😄 |
I'd like to be able to prove that tabled can replace nushell tables somehow, even if tabled doesn't have all the features. I'm wondering if we can make it configurable to use tabled in nushell. Either put it behind a feature or add a config.nu flag. At least then we can spot issues and log them on your repo. If you're not really interested in doing this, that's ok too. I just really like tabled. :) yes, we'd need tests somehow. lol. |
I tend to think I've covered most of the mentioned things? You can check this out on the same branch https://github.com/zhiburt/nushell/tree/checkout-tabled. |
todo: handle the case when table can't be rendered because not enough space. |
IIRC, the way it works in nushell is that data types are assigned an alignment. It's in the color_config.rs https://github.com/nushell/nushell/blob/f5519e2a0958112ce371fcab57b4bdbbc8f929ef/crates/nu-color-config/src/color_config.rs#L234-L385 |
Great; |
nice job. are these changes in your latest checkout-tabled branch? I'll try to try later if so. |
Yes they are. Take care then :) |
looking very nice! good work. the next challenge, if you choose to accept it, is to get this working a good as possible. Run your tabled version of nushell and To be clear, this is a big problem in nushell and I'm not sure if there even is a "fix" for it since it depends on how each terminal renders emojis. I'm also interested in caching, maybe related to above. for instance, read the first 1000 lines of the emoji file (or other files) before deciding how wide to set the columns. so, this caching isn't necessarily for speed but for determining proper column width. |
one of the core team members asked if string truncation is possible in tabled. for instance, if you're running nushell and type |
wow, this stuff is so confusing/hard/weird |
Just verified; This Just checked; It's just not expected. |
I'd suggest checking weird behaviour in different terminals to rule out quirks in your current terminal. |
@fdncred https://github.com/zhiburt/tabled/blob/master/examples/README.md
Hi @panicbit I think it's right approach. [WIP] |
whoop! whoop! that looks great! |
Just keep you posted. So it's still WIP; PS: If you have any 'corner cases' let me know; so I could check it.
|
Looking good. Thanks for the update. |
What's the difference between the last two? What about adding dim like 2; before the foreground one and/or the background one? |
Probably I did a mistake when do copy&paste. But I've updated https://github.com/zhiburt/nushell/tree/nu-table-to-tabled branch. |
@zhiburt very nice work! |
@zhiburt head's up. we're releasing 0.65.0 sometime today. then we'll wait for a day or so looking for bugs that slipped in. after that window I'd like to land your tabled PR in nushell so we can start using tabled for ~3weeks testing it. Is that ok with you? You might get some bugs filed and such that we'd need to fix in the next few weeks if we decide to keep tabled. |
Sounds good; Although I have 1 concern; is a wrap logic; Originally while printing I just want to highlight it once again; ref: #97 BTW: And |
Seems like we do less of them any wayfor So 2k allocations is presumably done in PS: It's all synthetic assumptions any way. |
whenever you're ready to push a PR, we can probably land it on 0.65.1 and start testing. |
I hope you meant me to open it; |
Yup. That's what I meant. Just need to fix the clippy lints and we can probably land it. |
@zhiburt we have our first bug report. We're setting up a |
Here's the issue nushell/nushell#5972. Note that you can search by label too in order to see all the "tabled" issues in the future. |
Just an update, everyone is loving the speed of tabled now in nushell. We're planning on keeping it for the next release. You probably know this but I wanted to mention it anyway. In order to publish, we'll need all the crates we're using published in crates.io. i.e. we can't have dependencies that point to git. So, if you don't mind, sometime before our next release, can you please publish the crates we're using? Our next release is on 26th of July. |
Hi
Actually I didn't know what you've lean to. I hope it will not be very error prone (in terms of issues).
It's actually something I started to prepare for a last days. Hope you have a good weekend. |
@zhiburt We had a request. It's not an emergency but something to think about. When using the truncation_suffix, would it be possible to color it the same color as what proceeded it. For example, here's some headers that I just created. The text is green but the truncation suffix is white.
Thank you very much.
Thanks for that. |
Created some snippet for it. |
ooooh, that looks nice! |
@zhiburt it appears that we have a regression. Lists now are acting like tables again by putting the first element into a header.
|
Line 2005 in 0ac6b7b
Was caused by this line I've added. Mistake... The said thing is it was not covered by tests. |
no worries, thank you for fixing it! |
heads-up. we're publishing nushell 0.66.0 today with tabled 🎉. thanks for all your excellent help on getting this done. i'm closing the issue for now. i have another question but i'll open a separate issue on that. |
hey @zhiburt,
i'd love to try your tabled crate out in nushell just to see how it stacks up and if it could work for us, what the performance is like, how it handles emojis, etc. are you interested and available to help with this?
if so, i'd see it initially working this way as a prototype. right now most commands automatically call
table
which creates the normal nushell tables. i figured we could create a new command calledtabled
and then just dols | tabled
andblah | tabled
just to see how it works.what are your thoughts?
The text was updated successfully, but these errors were encountered: