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

feat: support fixed column widths #71

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

mdonnalley
Copy link
Contributor

  • Add width property to column configuration to support fixed width columns
  • Add width property to table configuration to support fixed width tables

@W-17486159@

@cristiand391
Copy link
Member

cristiand391 commented Jan 6, 2025

QA notes:

setup:
tested with Alacritty and Ghoshtty's inspector 😎
https://ghostty.org/

fixed width for for tables

✅ no width set, takes all space available
✅ percentages correctly calculated, can see the expected width in the inspector
✅ fixed cell respected
✅ percentages/qty of cells bigger than space available, table takes all available width
✅ negative values don't cause crash, table cells wrapped
Screenshot 2025-01-06 at 4 32 19 PM

fixed width for columns

✅ >1 padding doesn't affect fixed column width
✅ column char separator doesn't count as part an additional column width (so a table with 2 columns with 10cell fixed each renders a 21cell table)

EDIT: fixed
🟡 fixed width cell or percentages , additional cells in printed table

If I modify the fixed-width-columns example to set fixed column widths like this (or even the default with percentages):

  columns: [
    {key: 'test', width: 10},
    {key: 'result', width: 10},
    {key: 'expected', width: 10},
    {key: 'actual', width: 30},
  ],

The first 3 columns have a 13cell width and the last 33 cells:
Screenshot 2025-01-06 at 4 51 50 PM
Screenshot 2025-01-06 at 4 53 20 PM

@cristiand391 cristiand391 merged commit dbe7be8 into main Jan 6, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants