Skip to content

Commit b15509f

Browse files
[UI] In the run details page, for the dev environment, expect latestSubmission?.job_runtime_data?.working_dir after run.status === 'running'; otherwise, fallback to /.
1 parent dc585db commit b15509f

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

  • frontend/src/pages/Runs/Details/RunDetails/ConnectToRunWithDevEnvConfiguration

frontend/src/pages/Runs/Details/RunDetails/ConnectToRunWithDevEnvConfiguration/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
5555

5656
const configuration = run.run_spec.configuration as TDevEnvironmentConfiguration;
5757
const latestSubmission = run.jobs[0]?.job_submissions?.slice(-1)[0];
58-
const workingDir = latestSubmission?.job_runtime_data?.working_dir;
59-
const openInIDEUrl = workingDir
60-
? `${configuration.ide}://vscode-remote/ssh-remote+${run.run_spec.run_name}${workingDir}`
61-
: null;
58+
const workingDir = latestSubmission?.job_runtime_data?.working_dir ?? '/';
59+
const openInIDEUrl = `${configuration.ide}://vscode-remote/ssh-remote+${run.run_spec.run_name}${workingDir}`;
6260
const ideDisplayName = getIDEDisplayName(configuration.ide);
6361

6462
const [configCliCommand, copyCliCommand] = useConfigProjectCliCommand({ projectName: run.project_name });
@@ -67,7 +65,7 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
6765
<Container>
6866
<Header variant="h2">Connect</Header>
6967

70-
{run.status === 'running' && openInIDEUrl && (
68+
{run.status === 'running' && (
7169
<Wizard
7270
i18nStrings={{
7371
stepNumberLabel: (stepNumber) => `Step ${stepNumber}`,
@@ -271,10 +269,10 @@ export const ConnectToRunWithDevEnvConfiguration: FC<{ run: IRun }> = ({ run })
271269
/>
272270
)}
273271

274-
{(run.status !== 'running' || !openInIDEUrl) && (
272+
{run.status !== 'running' && (
275273
<SpaceBetween size="s">
276274
<Box />
277-
<Alert type="info">Waiting for the dev environment to be ready.</Alert>
275+
<Alert type="info">Waiting for the run to start.</Alert>
278276
</SpaceBetween>
279277
)}
280278
</Container>

0 commit comments

Comments
 (0)