Skip to content

Commit d16c463

Browse files
new python folder: update language (#8223)
<!-- Thank you for submitting a pull request. If this is your first pull request you can find information about contributing here: * https://github.com/posit-dev/positron/blob/main/CONTRIBUTING.md We recommend synchronizing your branch with the latest changes in the main branch by either pulling or rebasing. --> <!-- Describe briefly what problem this pull request resolves, or what new feature it introduces. Include screenshots of any new or altered UI. Link to any GitHub issues but avoid "magic" keywords that will automatically close the issue. If there are any details about your approach that are unintuitive or you want to draw attention to, please describe them here. --> Addresses part of #8040. Slight modifications of the language used in the Python step of the New Folder Flow for clarity. Defaults: <img width="696" alt="image" src="https://github.com/user-attachments/assets/f380ab2d-e561-40fc-8e1a-50a81c2c45b7" /> New dropdown: <img width="553" alt="image" src="https://github.com/user-attachments/assets/88c89aed-fe1f-40b7-b24b-81218f8b53bf" /> If you select venv: <img width="691" alt="image" src="https://github.com/user-attachments/assets/e60e3db6-338f-4e46-9396-c668bc9be7a1" /> If you select "use existing": <img width="692" alt="image" src="https://github.com/user-attachments/assets/32009545-72c2-49ba-9000-ca3299b2774c" /> ### Release Notes <!-- Optionally, replace `N/A` with text to be included in the next release notes. The `N/A` bullets are ignored. If you refer to one or more Positron issues, these issues are used to collect information about the feature or bugfix, such as the relevant language pack as determined by Github labels of type `lang: `. The note will automatically be tagged with the language. These notes are typically filled by the Positron team. If you are an external contributor, you may ignore this section. --> #### New Features - N/A #### Bug Fixes - N/A ### QA Notes <!-- Positron team members: please add relevant e2e test tags, so the tests can be run when you open this pull request. - Instructions: https://github.com/posit-dev/positron/blob/main/test/e2e/README.md#pull-requests-and-test-tags - Available tags: https://github.com/posit-dev/positron/blob/main/test/e2e/infra/test-runner/test-tags.ts --> @:new-folder-flow <!-- Add additional information for QA on how to validate the change, paying special attention to the level of risk, adjacent areas that could be affected by the change, and any important contextual information not present in the linked issues. --> Just click around these menus; behavior should not be changed
1 parent c68534e commit d16c463

File tree

3 files changed

+40
-20
lines changed

3 files changed

+40
-20
lines changed

extensions/positron-python/src/client/common/utils/localize.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,10 @@ export namespace CreateEnv {
480480
export const installingPackages = l10n.t('Installing packages...');
481481
export const errorCreatingEnvironment = l10n.t('Error while creating virtual environment.');
482482
export const selectPythonPlaceHolder = l10n.t('Select a Python installation to create the virtual environment');
483-
export const providerDescription = l10n.t('Creates a `.venv` virtual environment in the current workspace');
483+
// --- Start Positron ---
484+
// export const providerDescription = l10n.t('Creates a `.venv` virtual environment in the current workspace');
485+
export const providerDescription = l10n.t('Select an existing interpreter for the new environment');
486+
// --- End Positron ---
484487
export const error = l10n.t('Creating virtual environment failed with error.');
485488
export const tomlExtrasQuickPickTitle = l10n.t('Select optional dependencies to install from pyproject.toml');
486489
export const requirementsQuickPickTitle = l10n.t('Select dependencies to install');
@@ -507,7 +510,10 @@ export namespace CreateEnv {
507510
'Select the version of Python to install in the environment',
508511
);
509512
export const creating = l10n.t('Creating conda environment...');
510-
export const providerDescription = l10n.t('Creates a `.conda` Conda environment in the current workspace');
513+
// --- Start Positron ---
514+
// export const providerDescription = l10n.t('Creates a `.conda` Conda environment in the current workspace');
515+
export const providerDescription = l10n.t('Use conda to install a Python version for the new environment');
516+
// --- End Positron ---
511517

512518
export const recreate = l10n.t('Delete and Recreate');
513519
export const recreateDescription = l10n.t('Delete existing ".conda" environment and create a new one');
@@ -522,7 +528,9 @@ export namespace CreateEnv {
522528

523529
// --- Start Positron ---
524530
export namespace Uv {
525-
export const providerDescription = l10n.t('Creates a `uv` virtual environment in the current workspace');
531+
export const providerDescription = l10n.t(
532+
'Use uv to find a Python version locally (or install it if needed) for the new environment',
533+
);
526534
}
527535
// --- End Positron ---
528536

src/vs/workbench/browser/positronNewFolderFlow/components/steps/pythonEnvironmentStep.tsx

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ export const PythonEnvironmentStep = (props: PropsWithChildren<NewFolderFlowStep
120120
identifier: EnvironmentSetupType.NewEnvironment,
121121
title: localize(
122122
'pythonEnvironmentStep.newEnvironment.radioLabel',
123-
"Create a new Python environment (Recommended)"
123+
"Create a new virtual environment (Recommended)"
124124
)
125125
}),
126126
new RadioButtonItem({
127127
identifier: EnvironmentSetupType.ExistingEnvironment,
128128
title: localize(
129129
'pythonEnvironmentStep.existingEnvironment.radioLabel',
130-
"Use an existing Python installation"
130+
"Use an existing environment"
131131
)
132132
})
133133
];
@@ -335,26 +335,31 @@ export const PythonEnvironmentStep = (props: PropsWithChildren<NewFolderFlowStep
335335

336336
// Construct the interpreter dropdown title.
337337
const interpreterDropdownTitle = () => {
338+
const interpreterOrVersion = (context.usesCondaEnv || context.usesUvEnv) ? 'version' : 'interpreter';
339+
338340
// If interpreters is undefined, show a loading message.
339341
if (interpretersLoading()) {
340342
return localize(
341343
'pythonInterpreterSubStep.dropDown.title.loading',
342-
"Loading interpreters..."
344+
"Loading {0}s...",
345+
interpreterOrVersion
343346
);
344347
}
345348

346349
// If interpreters is empty, show a message that no interpreters were found.
347350
if (!interpretersAvailable()) {
348351
return localize(
349352
'pythonInterpreterSubStep.dropDown.title.noInterpreters',
350-
"No interpreters found."
353+
"No {0}s found.",
354+
interpreterOrVersion
351355
);
352356
}
353357

354358
// Otherwise, show the default title.
355359
return localize(
356360
'pythonInterpreterSubStep.dropDown.title',
357-
"Select a Python interpreter"
361+
"Select a Python {0}",
362+
interpreterOrVersion
358363
);
359364
};
360365

@@ -447,14 +452,14 @@ export const PythonEnvironmentStep = (props: PropsWithChildren<NewFolderFlowStep
447452
<FlowFormattedText type={FlowFormattedTextType.Info}>
448453
{(() => localize(
449454
'pythonEnvironmentSubStep.description',
450-
"Select a Python environment"
455+
"Select a way to create a new virtual environment"
451456
))()}
452457
</FlowFormattedText>
453458
}
454459
feedback={envProviderStepFeedback()}
455460
title={(() => localize(
456461
'pythonEnvironmentSubStep.label',
457-
"Python Environment"
462+
"Environment Creation"
458463
))()}
459464
>
460465
<DropDownListBox
@@ -478,17 +483,24 @@ export const PythonEnvironmentStep = (props: PropsWithChildren<NewFolderFlowStep
478483
}
479484
{/* Show the Python interpreter dropdown */}
480485
<PositronFlowSubStep
481-
description={(() =>
482-
localize(
486+
description={(() => {
487+
const whatToSelect = (context.usesCondaEnv || context.usesUvEnv) ? 'a Python version' : 'an existing interpreter';
488+
return localize(
483489
'pythonInterpreterSubStep.description',
484-
"Select a Python interpreter"
485-
))()}
490+
"Select {0}",
491+
whatToSelect
492+
)
493+
})()}
486494
feedback={interpreterStepFeedback()}
487-
title={(() =>
488-
localize(
495+
title={(() => {
496+
const interpreterOrVersion = (context.usesCondaEnv || context.usesUvEnv) ? 'Version' : 'Interpreter';
497+
return localize(
489498
'pythonInterpreterSubStep.title',
490-
"Python Interpreter"
491-
))()}
499+
"Python {0}",
500+
interpreterOrVersion
501+
)
502+
})()}
503+
titleId='pythonEnvironment-interpreterOrVersion'
492504
>
493505
<DropDownListBox
494506
createItem={(item) => (

test/e2e/pages/newFolderFlow.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export class NewFolderFlow {
1515
private folderTemplateButton = (label: string) => this.code.driver.page.locator('label').filter({ hasText: label });
1616
private folderNameInput = this.code.driver.page.getByLabel(/Enter the name of your new/);
1717
private existingEnvRadioButton = this.code.driver.page.getByText(/Use an existing/);
18-
private envProviderDropdown = this.code.driver.page.locator('#flow-sub-step-python-environment').locator('button');
18+
private envProviderDropdown = this.code.driver.page.locator('#flow-sub-step-environment-creation').locator('button');
1919
private envProviderDropdownTitle = this.envProviderDropdown.locator('.dropdown-entry-title');
2020
private dropDropdownOptions = this.code.driver.page.locator('.positron-modal-popup-children').getByRole('button');
21-
private interpreterDropdown = this.code.driver.page.locator('#flow-sub-step-python-interpreter').locator('button');
21+
private interpreterDropdown = this.code.driver.page.locator('#flow-sub-step-pythonenvironment-interpreterorversion').locator('button');
2222
private interpreterDropdownSubtitle = this.interpreterDropdown.locator('.dropdown-entry-subtitle');
2323

2424
constructor(private code: Code, private quickaccess: QuickAccess) { }

0 commit comments

Comments
 (0)