-
Notifications
You must be signed in to change notification settings - Fork 104
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
Interactive output format #149
Conversation
NEAT! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work on this! A few comments on unifying the table-wide and interactive modes a little more so that we can keep these updated more easily.
Remember to hydrate the pricing caches w/ |
pkg/selector/outputs/bubbletea.go
Outdated
structType := reflect.TypeOf(columnDataStruct) | ||
for i := 0; i < structType.NumField(); i++ { | ||
columnHeader := structType.Field(i).Tag.Get(columnTag) | ||
newCol := table.NewColumn(columnHeader, columnHeader, len(columnHeader)+headerPadding) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that some columns are sized too small for the data (like CPU Arch and GPU Info). You should be able to dynamically calculate the columns header by looking for the max(row entry per column, column header, and some upper bound of column length).
Just one comment on the column sizes and after that, lgtm! Nice job! I'll leave it to @AustinSiu for the final review, but no need to hold-up on my account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you very much for your hard work on this! Left some minor comments that can be addressed in other PRs (if at all), don't want to delay this any further. 👍
gpus := int64(0) | ||
gpuMemory := int64(0) | ||
gpuType := []string{} | ||
if instanceType.GpuInfo != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: when gpuInfo
is nil because we have no gpus, wdyt about about having the default text be "none", "n/a", or etc. to match what we do with other "not present" cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into the reason why there was previously no default text for missing gpuInfo
and then I will address it in my next PR.
Issue #, if available:
Description of changes:
Implemented a new CLI output format using the bubble tea tui. The new format includes a table with the same columns as the
table-wide
format and can be accessed through theinteractive
flag. The table can be resized both vertically and horizontally through resizing the terminal window and it supports vertical and horizontal scrolling.The new output format lives in
/selector/outputs/bubbletea.go
.The following bubble tea component was used to build the table: https://github.com/Evertras/bubble-table
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
bubble.tea.demo.mov