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

chore(app): UI improvements for runs history step slider #3780

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,15 @@ const PanelRunHistoryTablesStepper: React.FC<
{steps.length > 0 && (
<div
style={{
padding: '2px',
height: '1.7em',
padding: '8px',
borderTop: '1px solid #ddd',
backgroundColor: '#f8f8f8',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
marginTop: '8px',
}}>
Step:{' '}
<SliderInput
min={steps[0]}
max={steps[steps.length - 1]}
Expand Down
15 changes: 14 additions & 1 deletion weave-js/src/components/Panel2/PanelTable/PanelTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,20 @@ export const PanelTable: React.FC<
if (typedInputNodeUse.loading) {
return <Panel2Loader />;
} else if (typedInputNode && isAssignableTo(typedInputNode.type, 'none')) {
return <div>-</div>;
return (
<div
style={{
height: '100%',
width: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: '#666',
fontSize: '14px',
}}>
No items to display
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already an improvement over the existing behavior 👍

If the PanelTable is a Run History Step Slider, could we display a different message saying there's "no items to display for this step" and default to "No items to display" for all other table types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit finnicky ... I'm not using the PanelTable component directly, it's rendering via PanelComp2. I think there are instances where we directly render the final component (i.e. PanelTable) but it requires manually setting up the config and all. I'm gonna merge these simple changes in first and then I'll address the empty message in a different PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, thanks for looking into it!

</div>
);
} else if (!nodeIsValidList(typedInputNode)) {
console.warn(
'PanelTable returning empty state because of Invalid input type: ',
Expand Down