@@ -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" ) ) ;
@@ -495,12 +497,24 @@ function App() {
495
497
) ;
496
498
return < div > </ div > ;
497
499
}
500
+ // Prefix with `/#referrer` will specify an IDE for workspace
501
+ // We don't need to show IDE preference in this case
502
+ const shouldUserIdePreferenceShown = User . isOnboardingUser ( user ) && ! hash . startsWith ( ContextURL . REFERRER_PREFIX ) ;
503
+
498
504
const isCreation = window . location . pathname === "/" && hash !== "" ;
499
505
const isWsStart = / \/ s t a r t \/ ? / . test ( window . location . pathname ) && hash !== "" ;
500
506
if ( isWhatsNewShown ) {
501
507
toRender = < WhatsNew onClose = { ( ) => setWhatsNewShown ( false ) } /> ;
502
508
} else if ( isCreation ) {
503
- toRender = < CreateWorkspace contextUrl = { hash } /> ;
509
+ if ( shouldUserIdePreferenceShown ) {
510
+ toRender = (
511
+ < StartPage phase = { StartPhase . Checking } >
512
+ < SelectIDEModal />
513
+ </ StartPage >
514
+ ) ;
515
+ } else {
516
+ toRender = < CreateWorkspace contextUrl = { hash } /> ;
517
+ }
504
518
} else if ( isWsStart ) {
505
519
toRender = < StartWorkspace { ...parseProps ( hash , window . location . search ) } /> ;
506
520
} 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