Browse Source

Updates linked workspace terminology and messaging

main
Eric Amodio 1 year ago
parent
commit
34e4d5e147
2 changed files with 28 additions and 30 deletions
  1. +1
    -1
      package.json
  2. +27
    -29
      src/plus/workspaces/workspacesService.ts

+ 1
- 1
package.json View File

@ -6974,7 +6974,7 @@
}, },
{ {
"command": "gitlens.views.workspaces.changeAutoAddSetting", "command": "gitlens.views.workspaces.changeAutoAddSetting",
"title": "Change Workspace Auto-Add Setting...",
"title": "Change Linked Workspace Auto-Add Behavior...",
"category": "GitLens" "category": "GitLens"
}, },
{ {

+ 27
- 29
src/plus/workspaces/workspacesService.ts View File

@ -305,18 +305,18 @@ export class WorkspacesService implements Disposable {
} }
let chosenRepoPaths: string[] = []; let chosenRepoPaths: string[] = [];
if (!options?.force && this._currentWorkspaceAutoAddSetting === WorkspaceAutoAddSetting.Prompt) { if (!options?.force && this._currentWorkspaceAutoAddSetting === WorkspaceAutoAddSetting.Prompt) {
const add = { title: 'Add...' };
const change = { title: 'Change Auto-Add Behavior...' };
const cancel = { title: 'Cancel', isCloseAffordance: true };
const addChoice = await window.showInformationMessage( const addChoice = await window.showInformationMessage(
'New repositories found in the cloud workspace matching this workspace. Would you like to add them?',
{ title: 'Add' },
{ titleclass="o">: 'Change Auto-Add Setting' },
{ titleclass="o">: 'Cancel', isCloseAffordance: true },
'New repositories found in the linked GitKraken workspace. Would you like to add them to the current VS Code workspace?',
add,
change,
cancel,
); );
if (addChoice == null || addChoice.title === 'Cancel') {
return;
}
if (addChoice.title === 'Change Auto-Add Setting') {
if (addChoice == null || addChoice === cancel) return;
if (addChoice === change) {
void this.chooseCodeWorkspaceAutoAddSetting({ current: true }); void this.chooseCodeWorkspaceAutoAddSetting({ current: true });
return; return;
} }
@ -1169,35 +1169,33 @@ export class WorkspacesService implements Disposable {
? this._currentWorkspaceAutoAddSetting ? this._currentWorkspaceAutoAddSetting
: WorkspaceAutoAddSetting.Disabled; : WorkspaceAutoAddSetting.Disabled;
const autoAddOptions = [
type QuickPickItemWithOption = QuickPickItem & { option: WorkspaceAutoAddSetting };
const autoAddOptions: QuickPickItemWithOption[] = [
{ {
label: 'Enable',
label: 'Add on Workspace (Window) Open',
description:
this._currentWorkspaceAutoAddSetting === WorkspaceAutoAddSetting.Enabled ? 'current' : undefined,
option: WorkspaceAutoAddSetting.Enabled, option: WorkspaceAutoAddSetting.Enabled,
...(this._currentWorkspaceAutoAddSetting === WorkspaceAutoAddSetting.Enabled
? { description: '(current)' }
: {}),
}, },
{ {
label: 'Disable',
option: WorkspaceAutoAddSetting.Disabled,
...(this._currentWorkspaceAutoAddSetting === WorkspaceAutoAddSetting.Disabled
? { description: '(current)' }
: {}),
label: 'Prompt on Workspace (Window) Open',
description:
this._currentWorkspaceAutoAddSetting === WorkspaceAutoAddSetting.Prompt ? 'current' : undefined,
option: WorkspaceAutoAddSetting.Prompt,
}, },
{ {
label: 'Ask every time',
option: WorkspaceAutoAddSetting.Prompt,
...(this._currentWorkspaceAutoAddSetting === WorkspaceAutoAddSetting.Prompt
? { description: '(current)' }
: {}),
label: 'Never',
description:
this._currentWorkspaceAutoAddSetting === WorkspaceAutoAddSetting.Disabled ? 'current' : undefined,
option: WorkspaceAutoAddSetting.Disabled,
}, },
]; ];
const newWorkspaceAutoAddOption = await window.showQuickPick<
QuickPickItem & { option: WorkspaceAutoAddSetting }
>(autoAddOptions, {
placeHolder: 'Choose an option to automatically add missing repositories to this workspace',
title: 'Automatically add repositories',
const newWorkspaceAutoAddOption = await window.showQuickPick<QuickPickItemWithOption>(autoAddOptions, {
placeHolder:
'Choose the behavior of automatically adding missing repositories to the current VS Code workspace',
title: 'Linked Workspace: Automatically Add Repositories',
}); });
if (newWorkspaceAutoAddOption?.option == null) return defaultOption; if (newWorkspaceAutoAddOption?.option == null) return defaultOption;

Loading…
Cancel
Save