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
Resize code has several issues #50
Comments
Thank you very much for taking the time to thoroughly articulate this issue and your proposed fix. I am delighted that you have chosen to continue to improve this project. I welcome your improvements and would be happy to merge your pull requests. Based on our interaction thus far, I've decided to add you as a collaborator to the project. This way you can be certain that your changes will land. Here are my thoughts on your proposal: [1] I've received some interest in adding a feature to merge columns or rows. I've had no need for this, personally...so haven't tackled it. But I would ask that you consider the inevitability of that additional feature as it would relate to your changes. [2] Unit tests for said changes are very much appreciated. [3] I don't have a Changelog in the README, and I've just learned this week about So I would ask that you use this format for your commits, unless you have grounds for objection. I'll add a note in the README to this effect for future PR's. [4] As opposed to separate options for |
I think Table resized to minWidths:
With
With
|
I am a little concerned that the intended default behavior of tty-table has been misunderstood. Let me explain. Currently the Said another way, the only time I made cell wrapping the default because it ensures all data is displayed, regardless of the user's terminal viewport width. Considering this, if |
I pushed fixes for this. You can still submit your pull - I didn't add the |
Yes, good point, the default wouldn't have any affect either way unless the user was getting into more advanced option/headers usage or absurdly narrow terminals. |
Might I recommend changesets given they're using this very library and is very easy to use, with and without conventional commits. 🤗 |
Problem Summary
Resize code has several issues
Expected Result (screen shot if possible)
Formatting should always be correct and the table should always be the desired width
Actual Result (screen shot if possible)
See attached output of https://gist.github.com/mscalora/628b05731b7674a1993115752bafd1ee
resize-table.txt
Environment Information
OS: MacOS
Terminal Emulator: iTerm
Steps to Reproduce
curl https://gist.githubusercontent.com/mscalora/628b05731b7674a1993115752bafd1ee/raw/41a1aab155d4235144513eebefe401fe10169456/resize-table.js | node -
Fixes
I would like to take on fixing these issues and enhancing the table resize functionality with some addition options to better control how resize works:
Proposed new table options:
Proposed new column (header) options:
Notes:
minWidth
would be respected by both resize modesShrink Mode
Discussion
I've actually already started and have most of the work done. I planned on submitting a pull request but wanted to start a discussion and get feedback while I'm still working on it. I understand it may be a a lot of complexity for the scope of this project so I am happy to fork if it is judged to be beyond the desired scope since I need something like this. Also, I can fix some of the issues listed at the top without the new features but it would be a significant amount of extra work to pull that out. I was trying to implement a "legacy" mode but these issues I ran into make that difficult, the broken formatting may only be fixable with some changes like
minWidth
or using a truncated truncation string.The text was updated successfully, but these errors were encountered: