@@ -20,7 +20,7 @@ import gitpodIcon from "./icons/gitpod.svg";
20
20
import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error" ;
21
21
import { useHistory } from "react-router-dom" ;
22
22
import { trackButtonOrAnchor , trackPathChange , trackLocation } from "./Analytics" ;
23
- import { LicenseInfo , User } from "@gitpod/gitpod-protocol" ;
23
+ import { ContextURL , LicenseInfo , User } from "@gitpod/gitpod-protocol" ;
24
24
import * as GitpodCookie from "@gitpod/gitpod-protocol/lib/util/gitpod-cookie" ;
25
25
import { Experiment } from "./experiments" ;
26
26
import { workspacesPathMain } from "./workspaces/workspaces.routes" ;
@@ -45,6 +45,8 @@ import {
45
45
import { refreshSearchData } from "./components/RepositoryFinder" ;
46
46
import { StartWorkspaceModal } from "./workspaces/StartWorkspaceModal" ;
47
47
import { parseProps } from "./start/StartWorkspace" ;
48
+ import SelectIDEModal from "./settings/SelectIDEModal" ;
49
+ import { StartPage , StartPhase } from "./start/StartPage" ;
48
50
49
51
const Setup = React . lazy ( ( ) => import ( /* webpackPrefetch: true */ "./Setup" ) ) ;
50
52
const Workspaces = React . lazy ( ( ) => import ( /* webpackPrefetch: true */ "./workspaces/Workspaces" ) ) ;
@@ -156,6 +158,7 @@ function App() {
156
158
157
159
const [ loading , setLoading ] = useState < boolean > ( true ) ;
158
160
const [ isWhatsNewShown , setWhatsNewShown ] = useState ( false ) ;
161
+ const [ showUserIdePreference , setShowUserIdePreference ] = useState ( false ) ;
159
162
const [ isSetupRequired , setSetupRequired ] = useState ( false ) ;
160
163
const history = useHistory ( ) ;
161
164
@@ -495,12 +498,24 @@ function App() {
495
498
) ;
496
499
return < div > </ div > ;
497
500
}
501
+ const shouldUserIdePreferenceShown = User . isOnboardingUser ( user ) && ! hash . startsWith ( ContextURL . REFERRER_PREFIX ) ;
502
+ if ( shouldUserIdePreferenceShown !== showUserIdePreference ) {
503
+ setShowUserIdePreference ( shouldUserIdePreferenceShown ) ;
504
+ }
498
505
const isCreation = window . location . pathname === "/" && hash !== "" ;
499
506
const isWsStart = / \/ s t a r t \/ ? / . test ( window . location . pathname ) && hash !== "" ;
500
507
if ( isWhatsNewShown ) {
501
508
toRender = < WhatsNew onClose = { ( ) => setWhatsNewShown ( false ) } /> ;
502
509
} else if ( isCreation ) {
503
- toRender = < CreateWorkspace contextUrl = { hash } /> ;
510
+ if ( showUserIdePreference ) {
511
+ toRender = (
512
+ < StartPage phase = { StartPhase . Checking } >
513
+ < SelectIDEModal onClose = { ( ) => setShowUserIdePreference ( false ) } />
514
+ </ StartPage >
515
+ ) ;
516
+ } else {
517
+ toRender = < CreateWorkspace contextUrl = { hash } /> ;
518
+ }
504
519
} else if ( isWsStart ) {
505
520
toRender = < StartWorkspace { ...parseProps ( hash , window . location . search ) } /> ;
506
521
} else if ( / ^ ( g i t h u b | g i t l a b ) \. c o m \/ .+ ?/ i. test ( window . location . pathname ) ) {
0 commit comments