Skip to content

Commit 5e98530

Browse files
authored
Remove Setup "Get Started" Section (#4148)
1 parent 906fed0 commit 5e98530

File tree

8 files changed

+23
-113
lines changed

8 files changed

+23
-113
lines changed

extension/src/setup/webview/contract.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ export type SetupData = {
2626
}
2727

2828
export enum SetupSection {
29-
GET_STARTED = 'get-started',
3029
DVC = 'dvc',
3130
EXPERIMENTS = 'experiments',
3231
REMOTES = 'remotes',
3332
STUDIO = 'studio'
3433
}
3534

3635
export const DEFAULT_SECTION_COLLAPSED = {
37-
[SetupSection.GET_STARTED]: false,
3836
[SetupSection.DVC]: false,
3937
[SetupSection.EXPERIMENTS]: false,
4038
[SetupSection.REMOTES]: false,

webview/src/setup/components/App.test.tsx

Lines changed: 15 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ describe('App', () => {
330330
projectInitialized: false,
331331
sectionCollapsed: {
332332
[SetupSection.DVC]: false,
333-
[SetupSection.GET_STARTED]: true,
334333
[SetupSection.EXPERIMENTS]: true,
335334
[SetupSection.REMOTES]: true,
336335
[SetupSection.STUDIO]: true
@@ -437,6 +436,21 @@ describe('App', () => {
437436
})
438437
})
439438

439+
it('should show a "Show Walkthrough" button if dvc is installed and a project is initalized', () => {
440+
renderApp()
441+
442+
const walkthroughButton = within(
443+
screen.getByTestId('dvc-section-details')
444+
).getByText('Show Walkthrough')
445+
446+
expect(walkthroughButton).toBeInTheDocument()
447+
448+
fireEvent.click(walkthroughButton)
449+
expect(mockPostMessage).toHaveBeenCalledWith({
450+
type: MessageFromWebviewType.SHOW_WALKTHROUGH
451+
})
452+
})
453+
440454
it('should show an error icon if DVC is not initialized', () => {
441455
renderApp({
442456
projectInitialized: false
@@ -487,57 +501,6 @@ describe('App', () => {
487501
})
488502
})
489503

490-
describe('Get Started', () => {
491-
it('should show a screen saying that dvc is not setup if DVC is not found or initialized', () => {
492-
renderApp({
493-
cliCompatible: undefined
494-
})
495-
496-
const details = screen.getByTestId('get-started-section-details')
497-
498-
expect(within(details).getByText('DVC is not setup')).toBeInTheDocument()
499-
500-
sendSetDataMessage({ ...DEFAULT_DATA, projectInitialized: false })
501-
502-
expect(within(details).getByText('DVC is not setup')).toBeInTheDocument()
503-
})
504-
505-
it('should open the dvc section when clicking the Setup DVC button on the dvc is not setup screen', () => {
506-
renderApp({
507-
projectInitialized: false,
508-
remoteList: { mockRoot: undefined }
509-
})
510-
511-
const details = screen.getByTestId('get-started-section-details')
512-
const getStartedText = within(details).getByText('DVC is not setup')
513-
expect(getStartedText).toBeInTheDocument()
514-
515-
mockPostMessage.mockClear()
516-
const button = within(details).getByText('Setup DVC')
517-
fireEvent.click(button)
518-
expect(screen.getByText('DVC is not initialized')).toBeVisible()
519-
expect(getStartedText).not.toBeVisible()
520-
})
521-
522-
it('should show a button that takes the user to the "Get Started" walkthrough', () => {
523-
renderApp()
524-
525-
expect(
526-
within(screen.getByTestId('get-started-section-details')).getAllByText(
527-
'Get Started'
528-
)
529-
).toHaveLength(2)
530-
const walkthroughButton = screen.getByText('Show Walkthrough')
531-
532-
expect(walkthroughButton).toBeInTheDocument()
533-
534-
fireEvent.click(walkthroughButton)
535-
expect(mockPostMessage).toHaveBeenCalledWith({
536-
type: MessageFromWebviewType.SHOW_WALKTHROUGH
537-
})
538-
})
539-
})
540-
541504
describe('Experiments', () => {
542505
it('should show a screen saying that dvc is not setup if the project is not initialized', () => {
543506
renderApp({
@@ -791,7 +754,6 @@ describe('App', () => {
791754
isStudioConnected: true,
792755
sectionCollapsed: {
793756
[SetupSection.DVC]: false,
794-
[SetupSection.GET_STARTED]: true,
795757
[SetupSection.EXPERIMENTS]: true,
796758
[SetupSection.REMOTES]: true,
797759
[SetupSection.STUDIO]: true
@@ -814,7 +776,6 @@ describe('App', () => {
814776
isStudioConnected: true,
815777
sectionCollapsed: {
816778
[SetupSection.DVC]: true,
817-
[SetupSection.GET_STARTED]: true,
818779
[SetupSection.EXPERIMENTS]: false,
819780
[SetupSection.REMOTES]: true,
820781
[SetupSection.STUDIO]: true
@@ -837,7 +798,6 @@ describe('App', () => {
837798
isStudioConnected: true,
838799
sectionCollapsed: {
839800
[SetupSection.DVC]: true,
840-
[SetupSection.GET_STARTED]: true,
841801
[SetupSection.EXPERIMENTS]: true,
842802
[SetupSection.REMOTES]: true,
843803
[SetupSection.STUDIO]: false
@@ -862,7 +822,6 @@ describe('App', () => {
862822
remoteList: undefined,
863823
sectionCollapsed: {
864824
[SetupSection.DVC]: true,
865-
[SetupSection.GET_STARTED]: true,
866825
[SetupSection.EXPERIMENTS]: true,
867826
[SetupSection.REMOTES]: false,
868827
[SetupSection.STUDIO]: true
@@ -880,7 +839,6 @@ describe('App', () => {
880839
remoteList: { demo: undefined, 'example-get-started': undefined },
881840
sectionCollapsed: {
882841
[SetupSection.DVC]: true,
883-
[SetupSection.GET_STARTED]: true,
884842
[SetupSection.EXPERIMENTS]: true,
885843
[SetupSection.REMOTES]: false,
886844
[SetupSection.STUDIO]: true
@@ -898,7 +856,6 @@ describe('App', () => {
898856
remoteList: { demo: undefined, 'example-get-started': undefined },
899857
sectionCollapsed: {
900858
[SetupSection.DVC]: true,
901-
[SetupSection.GET_STARTED]: true,
902859
[SetupSection.EXPERIMENTS]: true,
903860
[SetupSection.REMOTES]: false,
904861
[SetupSection.STUDIO]: true
@@ -923,7 +880,6 @@ describe('App', () => {
923880
},
924881
sectionCollapsed: {
925882
[SetupSection.DVC]: true,
926-
[SetupSection.GET_STARTED]: true,
927883
[SetupSection.EXPERIMENTS]: true,
928884
[SetupSection.REMOTES]: false,
929885
[SetupSection.STUDIO]: true
@@ -951,7 +907,6 @@ describe('App', () => {
951907
},
952908
sectionCollapsed: {
953909
[SetupSection.DVC]: true,
954-
[SetupSection.GET_STARTED]: true,
955910
[SetupSection.EXPERIMENTS]: true,
956911
[SetupSection.REMOTES]: false,
957912
[SetupSection.STUDIO]: true

webview/src/setup/components/App.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Dvc } from './dvc/Dvc'
66
import { Experiments } from './experiments/Experiments'
77
import { Studio } from './studio/Studio'
88
import { SetupContainer } from './SetupContainer'
9-
import { GetStarted } from './GetStarted'
109
import { Remotes } from './remotes/Remotes'
1110
import { useVsCodeMessaging } from '../../shared/hooks/useVsCodeMessaging'
1211
import { TooltipIconType } from '../../shared/components/sectionContainer/InfoTooltip'
@@ -58,9 +57,6 @@ const getStudioStatusIcon = (cliCompatible: boolean, isConnected: boolean) => {
5857
return isConnected ? TooltipIconType.PASSED : TooltipIconType.INFO
5958
}
6059

61-
const getGetStartedIcon = (isDvcSetup: boolean) =>
62-
isDvcSetup ? TooltipIconType.INFO : TooltipIconType.ERROR
63-
6460
export const feedStore = (
6561
data: MessageToWebview<SetupData>,
6662
dispatch: SetupDispatch
@@ -176,13 +172,6 @@ export const App: React.FC = () => {
176172
>
177173
<Dvc />
178174
</SetupContainer>
179-
<SetupContainer
180-
sectionKey={SetupSection.GET_STARTED}
181-
title="Get Started"
182-
icon={getGetStartedIcon(isDvcSetup)}
183-
>
184-
<GetStarted isDvcSetup={isDvcSetup} />
185-
</SetupContainer>
186175
<SetupContainer
187176
sectionKey={SetupSection.EXPERIMENTS}
188177
title="Experiments"

webview/src/setup/components/GetStarted.tsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

webview/src/setup/components/dvc/Dvc.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { EmptyState } from '../../../shared/components/emptyState/EmptyState'
99
import { usePrevious } from '../../hooks/usePrevious'
1010
import { SetupState } from '../../store'
1111
import { closeSection } from '../shared/util'
12+
import { showWalkthrough } from '../../util/messages'
13+
import { Button } from '../../../shared/components/button/Button'
1214

1315
export const Dvc: React.FC = () => {
1416
const dispatch = useDispatch()
@@ -57,10 +59,16 @@ export const Dvc: React.FC = () => {
5759
if (!projectInitialized) {
5860
return <ProjectUninitialized>{children}</ProjectUninitialized>
5961
}
62+
6063
return (
6164
<EmptyState isFullScreen={false}>
6265
<h1>Setup Complete</h1>
6366
{children}
67+
<p>
68+
New to the extension? Go through the walkthrough to familiarize yourself
69+
with the different features.
70+
</p>
71+
<Button onClick={showWalkthrough} text="Show Walkthrough" />
6472
</EmptyState>
6573
)
6674
}

webview/src/setup/components/shared/util.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { updateSectionCollapsed } from '../../state/webviewSlice'
33

44
const getAllSections = (collapsed: boolean) => ({
55
[SetupSection.DVC]: collapsed,
6-
[SetupSection.GET_STARTED]: collapsed,
76
[SetupSection.EXPERIMENTS]: collapsed,
87
[SetupSection.REMOTES]: collapsed,
98
[SetupSection.STUDIO]: collapsed

webview/src/shared/components/sectionContainer/SectionDescription.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const sectionDescriptionTestIds = {
1212
[PlotsSection.TEMPLATE_PLOTS]: 'tooltip-template-plots',
1313
// Setup DVC
1414
[SetupSection.DVC]: 'tooltip-setup-dvc',
15-
// Setup Get Started
16-
[SetupSection.GET_STARTED]: 'tooltip-setup-get-started',
1715
// Setup Experiments
1816
[SetupSection.EXPERIMENTS]: 'tooltip-setup-experiments',
1917
// Setup Remote
@@ -57,8 +55,6 @@ export const SectionDescriptionMainText = {
5755
.
5856
</>
5957
),
60-
// Setup Get Started
61-
[SetupSection.GET_STARTED]: <>Get started with the extension</>,
6258
// Setup DVC
6359
[SetupSection.DVC]: <>Configure the extension to start working with DVC.</>,
6460
// Setup Experiments

webview/src/stories/Setup.stories.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const DEFAULT_DATA: SetupData = {
2727
remoteList: undefined,
2828
sectionCollapsed: {
2929
[SetupSection.DVC]: false,
30-
[SetupSection.GET_STARTED]: false,
3130
[SetupSection.EXPERIMENTS]: false,
3231
[SetupSection.REMOTES]: false,
3332
[SetupSection.STUDIO]: true
@@ -163,7 +162,6 @@ NoRemoteSetup.args = getUpdatedArgs({
163162
},
164163
sectionCollapsed: {
165164
[SetupSection.DVC]: true,
166-
[SetupSection.GET_STARTED]: true,
167165
[SetupSection.EXPERIMENTS]: true,
168166
[SetupSection.REMOTES]: false,
169167
[SetupSection.STUDIO]: true
@@ -181,7 +179,6 @@ ProjectRemoteSetup.args = getUpdatedArgs({
181179
},
182180
sectionCollapsed: {
183181
[SetupSection.DVC]: true,
184-
[SetupSection.GET_STARTED]: true,
185182
[SetupSection.EXPERIMENTS]: true,
186183
[SetupSection.REMOTES]: false,
187184
[SetupSection.STUDIO]: true
@@ -202,7 +199,6 @@ MultiProjectRemoteSetup.args = getUpdatedArgs({
202199
},
203200
sectionCollapsed: {
204201
[SetupSection.DVC]: true,
205-
[SetupSection.GET_STARTED]: true,
206202
[SetupSection.EXPERIMENTS]: true,
207203
[SetupSection.REMOTES]: false,
208204
[SetupSection.STUDIO]: true

0 commit comments

Comments
 (0)