Skip to content
Merged
2 changes: 2 additions & 0 deletions src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -3337,6 +3337,8 @@
"nameValidationError": "Name must be 1–50 characters using letters, numbers, spaces, or common punctuation."
},
"workspaceSwitcher": {
"scopeCaption": "Workspaces only affect which credits you use.",
"scopeTooltip": "Runs that use partner nodes spend credits from this workspace. Unlike on Cloud, every workspace saves to your usual output folder.",
"switchWorkspace": "Switch workspace",
"subscribe": "Subscribe",
"personal": "Personal",
Expand Down
13 changes: 13 additions & 0 deletions src/platform/workspace/components/WorkspaceSwitcherPopover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const i18n = createI18n({
personal: 'Personal',
roleOwner: 'Owner',
roleMember: 'Member',
scopeCaption: 'Workspaces only affect which credits you use.',
scopeTooltip:
'Runs that use partner nodes spend credits from this workspace. Unlike on Cloud, every workspace saves to your usual output folder.',
createWorkspace: 'Create a team workspace',
maxWorkspacesReached:
'You can only own 10 workspaces. Delete one to create a new one.'
Expand Down Expand Up @@ -103,6 +106,16 @@ function renderComponent(
}

describe('WorkspaceSwitcherPopover', () => {
it('shows the credits-scope caption off cloud', () => {
distributionMocks.isCloud = false
renderComponent()
expect(
screen.getByText('Workspaces only affect which credits you use.')
).toBeInTheDocument()

distributionMocks.isCloud = true
})

beforeEach(() => {
billingMocks.subscription.value = null
distributionMocks.isCloud = true
Expand Down
14 changes: 14 additions & 0 deletions src/platform/workspace/components/WorkspaceSwitcherPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@
</template>
</div>

<div
v-if="!isCloud"
class="flex shrink-0 items-center gap-2 px-4 py-2 text-xs text-muted-foreground"
>
<i
v-tooltip.left="{
value: $t('workspaceSwitcher.scopeTooltip'),
showDelay: 300
}"
class="pi pi-info-circle text-xs"
/>
<span>{{ $t('workspaceSwitcher.scopeCaption') }}</span>
</div>

<!-- Create workspace button -->
<div v-if="isCloud" class="shrink-0 border-t border-border-default p-2">
<div
Expand Down
Loading