Skip to content

Commit 711c488

Browse files
authored
fix(smus): Stop buttom not showing on newly created spaces (aws#2199)
## Problem Newly created running Spaces do not have any controls (Stop/Connect) BugBash: https://quip-amazon.com/c9u0AeXRbgx9/Local-IDE-Bug-Bash ## Solution show the stop button when the remote connect status is undefined ## Appearance note: test3 is a newly created space with remote connect status == undefined <img width="1085" height="418" alt="Screenshot 2025-08-14 at 11 23 19 AM" src="https://github.com/user-attachments/assets/9b0d150b-2475-4b0e-b214-a37373e0edad" /> --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent f455105 commit 711c488

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

packages/core/src/awsService/sagemaker/sagemakerSpace.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ export class SagemakerSpace {
151151
return 'awsSagemakerSpaceRunningRemoteEnabledNode'
152152
} else if (status === 'Running' && this.spaceApp.SpaceSettingsSummary?.RemoteAccess === 'DISABLED') {
153153
return 'awsSagemakerSpaceRunningRemoteDisabledNode'
154+
} else if (status === 'Running' && this.isSMUSSpace) {
155+
return 'awsSagemakerSpaceRunningNode'
154156
} else if (status === 'Stopped' && this.spaceApp.SpaceSettingsSummary?.RemoteAccess === 'ENABLED') {
155157
return 'awsSagemakerSpaceStoppedRemoteEnabledNode'
156158
} else if (

packages/core/src/test/sagemakerunifiedstudio/explorer/nodes/sageMakerUnifiedStudioSpaceNode.test.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,35 @@ describe('SagemakerUnifiedStudioSpaceNode', function () {
246246
assert.strictEqual(spaceNode.DomainSpaceKey, 'domain-123:test-space')
247247
})
248248
})
249+
250+
describe('SagemakerSpace getContext for SMUS', function () {
251+
it('returns awsSagemakerSpaceRunningNode for running SMUS space with undefined RemoteAccess', function () {
252+
// Create a space app without RemoteAccess setting (undefined)
253+
const smusSpaceApp = {
254+
SpaceName: 'test-space',
255+
DomainId: 'domain-123',
256+
Status: 'InService',
257+
DomainSpaceKey: 'domain-123:test-space',
258+
App: {
259+
AppName: 'test-app',
260+
Status: 'InService',
261+
},
262+
SpaceSettingsSummary: {
263+
// RemoteAccess is undefined
264+
},
265+
} as any
266+
267+
// Create a real SagemakerSpace instance for SMUS to test the actual getContext logic
268+
const realSagemakerSpace = new SagemakerSpace(
269+
mockSagemakerClient,
270+
'us-west-2',
271+
smusSpaceApp,
272+
true // isSMUSSpace = true
273+
)
274+
275+
const context = realSagemakerSpace.getContext()
276+
277+
assert.strictEqual(context, 'awsSagemakerSpaceRunningNode')
278+
})
279+
})
249280
})

packages/toolkit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@
15091509
{
15101510
"command": "aws.smus.stopSpace",
15111511
"group": "inline@0",
1512-
"when": "view == aws.smus.rootView && viewItem =~ /^(awsSagemakerSpaceRunningRemoteEnabledNode|awsSagemakerSpaceRunningRemoteDisabledNode)$/"
1512+
"when": "view == aws.smus.rootView && viewItem =~ /^(awsSagemakerSpaceRunningRemoteEnabledNode|awsSagemakerSpaceRunningRemoteDisabledNode|awsSagemakerSpaceRunningNode)$/"
15131513
},
15141514
{
15151515
"command": "aws.sagemaker.openRemoteConnection",

0 commit comments

Comments
 (0)