From 82090658d4b9f3060cc1eff84ceba6dcc69adbc4 Mon Sep 17 00:00:00 2001 From: Radu Date: Tue, 10 Sep 2024 11:01:42 +0300 Subject: [PATCH] Improve UX/UI for creating project from examples (#1278) * First implementation - Change name of button - Make use of VS Code API to use window title and window button custom names * Update ui unit test --- src/examples/ExamplesPanel.ts | 6 +++++- src/ui-test/project-test.ts | 2 +- src/views/examples/Examples.vue | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/examples/ExamplesPanel.ts b/src/examples/ExamplesPanel.ts index c283b6ef9..79f4a430f 100644 --- a/src/examples/ExamplesPanel.ts +++ b/src/examples/ExamplesPanel.ts @@ -93,6 +93,8 @@ export class ExamplesPlanel { canSelectFolders: true, canSelectFiles: false, canSelectMany: false, + openLabel: "Select Folder for New Project", + title: `Choose Project Location for ${message.name} example`, }); } if (!selectedFolder) { @@ -144,7 +146,9 @@ export class ExamplesPlanel { example_detail: contentStr, }); } catch (err) { - const notAvailable = vscode.l10n.t("No README.md available for this project."); + const notAvailable = vscode.l10n.t( + "No README.md available for this project." + ); Logger.info(notAvailable); Logger.info(err); this.panel.webview.postMessage({ diff --git a/src/ui-test/project-test.ts b/src/ui-test/project-test.ts index fc566fc22..a1ffc057e 100644 --- a/src/ui-test/project-test.ts +++ b/src/ui-test/project-test.ts @@ -44,7 +44,7 @@ describe("Example Create testing", async () => { By.id("create-button") ); expect(await createProjectButton.getText()).has.string( - "Create project using example" + "Select location for creating" ); const containerPath = resolve(__dirname, "..", "..", "testFiles"); diff --git a/src/views/examples/Examples.vue b/src/views/examples/Examples.vue index c1839b46d..1fe9f5909 100644 --- a/src/views/examples/Examples.vue +++ b/src/views/examples/Examples.vue @@ -40,7 +40,7 @@ onMounted(() => { class="button" id="create-button" > - Create project using example {{ selectedExample.name }} + Select location for creating {{ selectedExample.name }} project