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

Improve plots welcome view when there are no plots #1722

Merged
merged 5 commits into from
May 17, 2022
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
8 changes: 4 additions & 4 deletions webview/src/experiments/components/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describe('App', () => {
})
)

const noColumnsState = screen.queryByText('No Columns Selected')
const noColumnsState = screen.queryByText('No Columns Selected.')
expect(noColumnsState).toBeInTheDocument()
})

Expand All @@ -169,7 +169,7 @@ describe('App', () => {
})
)

const noExperimentsState = screen.queryByText('No Experiments to Display')
const noExperimentsState = screen.queryByText('No Experiments to Display.')
expect(noExperimentsState).toBeInTheDocument()
})

Expand All @@ -190,10 +190,10 @@ describe('App', () => {
const loadingState = screen.queryByText('Loading experiments...')
expect(loadingState).not.toBeInTheDocument()

const noExperimentsState = screen.queryByText('No Experiments to Display')
const noExperimentsState = screen.queryByText('No Experiments to Display.')
expect(noExperimentsState).not.toBeInTheDocument()

const noColumnsState = screen.queryByText('No Columns Selected')
const noColumnsState = screen.queryByText('No Columns Selected.')
expect(noColumnsState).not.toBeInTheDocument()
})

Expand Down
4 changes: 2 additions & 2 deletions webview/src/experiments/components/Experiments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ export const ExperimentsTable: React.FC<{

const hasOnlyDefaultColumns = columns.length <= 2
if (hasOnlyDefaultColumns) {
return <EmptyState>No Columns Selected</EmptyState>
return <EmptyState>No Columns Selected.</EmptyState>
}

const hasOnlyWorkspace = data.length <= 1
if (hasOnlyWorkspace) {
return <EmptyState>No Experiments to Display</EmptyState>
return <EmptyState>No Experiments to Display.</EmptyState>
}

return <Table instance={instance} tableData={tableData} />
Expand Down
2 changes: 1 addition & 1 deletion webview/src/plots/components/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('App', () => {
checkpoint: null,
sectionCollapsed: DEFAULT_SECTION_COLLAPSED
})
const emptyState = await screen.findByText('No Plots to Display')
const emptyState = await screen.findByText('No Plots to Display.')

expect(emptyState).toBeInTheDocument()
})
Expand Down
20 changes: 19 additions & 1 deletion webview/src/plots/components/GetStarted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const GetStarted = ({
return (
<EmptyState>
<div>
<p>No Plots to Display</p>
<p>No Plots to Display.</p>
{hasPlots && (
<div>
{!hasSelectedPlots && (
Expand All @@ -45,6 +45,24 @@ export const GetStarted = ({
)}
</div>
)}
{!hasPlots && (
<div>
<p>
{'Learn how to '}
<a href="https://dvc.org/doc/studio/user-guide/views/visualize-experiments">
visualize experiments
</a>
{' with DVC.'}
</p>
<p>
{'Learn about the '}
<a href="https://dvc.org/doc/command-reference/plots">
plots commands
</a>
.
</p>
</div>
)}
</div>
</EmptyState>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
opacity: 0.8;
letter-spacing: 0.04em;
color: $watermark-color;
font-family: sans-serif;
}
12 changes: 12 additions & 0 deletions webview/src/shared/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@ body {
button {
font-family: inherit;
}

a {
color: var(--vscode-textLink-foreground);

&:hover {
color: var(--vscode-textLink-activeForeground);
}

&:active {
color: var(--vscode-textLink-activeForeground);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Colors match these docs.

}