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

Header truncation #142

Open
9999years opened this issue Apr 5, 2024 · 3 comments
Open

Header truncation #142

9999years opened this issue Apr 5, 2024 · 3 comments
Labels
f: help wanted Feel free to start working on this t: feature A new feature

Comments

@9999years
Copy link

9999years commented Apr 5, 2024

A detailed description of the feature you would like to see added.

I'd like the ability to truncate column headers to the column width.

Explain your usecase of the requested feature

To preserve space, I'd like the column headers to not take up more space than the column contents. Therefore, I have a truncated column header. However, when there's lots of free space, this looks pretty silly! I'd like to only use the truncated column header if it's needed for space constraints.

@9999years 9999years added the t: feature A new feature label Apr 5, 2024
@Nukesor
Copy link
Owner

Nukesor commented Apr 5, 2024

Could you provide a few examples of the current behavior and the wanted behavior :)?

@9999years
Copy link
Author

9999years commented Apr 6, 2024

Current behavior:

     #  Subject                               Updat  Owner   Status
   682  Format Nix code with `nixfmt`         22:25  rbt     open     ✗
   778  Add `nixfmt`                          22:17  rbt     wip      ✗

Here I've chosen the column header Updat for the updated timestamp column so that it doesn't need to be any wider.

On a wider terminal, it renders like this:

        #  Subject                                                    Updat  Owner      Status
      682  Format Nix code with `nixfmt`                              22:25  rbt        open        ✗
      778  Add `nixfmt`                                               22:17  rbt        wip         ✗

Here we have plenty of space for the full Updated header, so that's what I'd like:

        #  Subject                                                  Updated  Owner      Status
      682  Format Nix code with `nixfmt`                              22:25  rbt        open        ✗
      778  Add `nixfmt`                                               22:17  rbt        wip         ✗

(Aside: I'm not sure why there's padding on the left/right sides of the table...)

@Nukesor
Copy link
Owner

Nukesor commented Apr 6, 2024

Hmm.

My first approach on this would be to add a "priority" to columns. Based on that priority, space is distributed to those columns with a higher priority first. It would be important to work with MinWidth constraints as soon as different priorities are used, as a single column might use the whole width otherwise.

Additionally, we would need a display mode where content is just cut of if it doesn't fit into a column.

@Nukesor Nukesor added the f: help wanted Feel free to start working on this label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: help wanted Feel free to start working on this t: feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants