-
Notifications
You must be signed in to change notification settings - Fork 318
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
fix/feat: Adjust progress_table_cell_type not to increase table row height #1921 #2215
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks @kaitlyncliu! The python/R API is autogenerated, not written by hand. Run make generate
to generate it properly.
The PR needs:
- Python example with the new feature.
- Include the new feature in the documentation so that people can find it. (https://wave.h2o.ai/docs/widgets/form/table/)
ui/src/progress_table_cell_type.tsx
Outdated
/** The type of progress cell to be displayed. One of 'bar', 'spinner'. Defaults to 'spinner'. */ | ||
type?: 'bar' | 'spinner' |
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.
Let's go with compact?: B
, defaulting to false.
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.
done
ui/src/progress_table_cell_type.tsx
Outdated
position: 'relative', | ||
display: 'inline-flex', | ||
width: 100, |
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.
The width should be fluid - always take the full column width instead of being fixed. Same for both types.
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.
Not sure what you mean about having the width be fluid.
The existing code before I changed anything had the width and height set to 50, which is the size of the spinner (this is what increased the row height of the table). I used this idea to create the bar, setting the bar width to 50 as well.
I'll remove the barContainer's width and use a margin for making the percentage sign appear next to the bar instead of setting it as 100. Is that ok?
ui/src/progress_table_cell_type.tsx
Outdated
bar: { | ||
position: 'absolute', | ||
top: '50%', left: 0, | ||
width: 50, | ||
}, | ||
|
||
spinner: { | ||
position: 'absolute', | ||
top: 0, left: 0, bottom: 0, right: 0, |
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.
What is absolute positioning here for?
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 just reused the previous code. It positions the percentage inside the spinner. I'll organize the code a bit better to make it more clear.
…to fix/issue-1921
Hi @mturoci |
The changes look better now. Good job @kaitlyncliu!
I meant this: Screen.Recording.2023-12-13.at.10.17.59.AM.movHint: Have a look at flexbox and its flex-grow prop :) |
The PR fulfills these requirements: (check all the apply)
main
branch.feat: Add a button #xxx
, where "xxx" is the issue number).Closes #xxx
, where "xxx" is the issue number.ui
folder, unit tests (make test
) still pass.@kellyycha and I fixed this issue by adding a new keyword argument
type
in the progress_table_cell_type that allows users to implement a bar style progress cell with the progress value indicated to the left of the bar, reducing the height of the row.This is how the table.py example looks originally:
Without the Progress column, the row height would look like this, which has a row height that is noticeably shorter than with the Progress:
Our implementation results in a bar that looks like the following and maintains a similar row height to the row without a progress cell:
We default
type
to the spinner/arc progress indicator so that previously implemented tables will continue to look the same.The UI and unit tests still pass:
Closes #1921