From 28963285821ba1c050ff204e5010ba054b1ef76c Mon Sep 17 00:00:00 2001 From: Keegan Irby Date: Wed, 20 Nov 2024 16:33:32 -0800 Subject: [PATCH 1/3] Address UX FnF comments --- .../cloudWatchLogs/commands/tailLogGroup.ts | 5 +++- .../wizard/liveTailLogStreamSubmenu.ts | 23 ++++++++----------- .../wizard/tailLogGroupWizard.ts | 10 ++++---- .../wizard/liveTailLogStreamSubmenu.test.ts | 14 +++++++---- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts b/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts index 21b3b9ea8d7..1b0e914f762 100644 --- a/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts +++ b/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts @@ -43,7 +43,10 @@ export async function tailLogGroup( } const session = new LiveTailSession(liveTailSessionConfig) if (registry.has(uriToKey(session.uri))) { - await prepareDocument(session) + await vscode.window.showTextDocument(session.uri, { preview: false }) + void vscode.window.showInformationMessage( + `Opening already running session's document. Found running session that matches new request.` + ) span.record({ result: 'Succeeded', sessionAlreadyStarted: true, diff --git a/packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts b/packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts index a76ec8861e4..c94259684bb 100644 --- a/packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts +++ b/packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts @@ -41,7 +41,7 @@ export class LogStreamFilterSubmenu extends Prompter { public createMenuPrompter() { const helpUri = startLiveTailHelpUrl const prompter = createQuickPick(this.menuOptions, { - title: 'Select LogStream filter type', + title: 'Include log events from...', buttons: createCommonButtons(helpUri), }) return prompter @@ -50,18 +50,15 @@ export class LogStreamFilterSubmenu extends Prompter { private get menuOptions(): DataQuickPickItem[] { const options: DataQuickPickItem[] = [] options.push({ - label: 'All', - detail: 'Include log events from all LogStreams in the selected LogGroup', + label: 'All Log Streams', data: 'all', }) options.push({ - label: 'Specific', - detail: 'Include log events from only a specific LogStream', + label: 'Specific Log Stream', data: 'specific', }) options.push({ - label: 'Prefix', - detail: 'Include log events from LogStreams that begin with a provided prefix', + label: 'Log Streams matching prefix', data: 'prefix', }) return options @@ -70,9 +67,9 @@ export class LogStreamFilterSubmenu extends Prompter { public createLogStreamPrefixBox(): InputBoxPrompter { const helpUri = startLiveTailLogStreamPrefixHelpUrl return createInputBox({ - title: 'Enter LogStream prefix', - placeholder: 'logStream prefix (case sensitive; empty matches all)', - prompt: 'Only log events in the LogStreams that have names that start with the prefix that you specify here are included in the Live Tail session', + title: 'Enter Log Stream prefix', + placeholder: 'log stream prefix (case sensitive; empty matches all)', + prompt: 'Only log events in Log Streams whose name starts with the supplied prefix will be included.', validateInput: (input) => this.validateLogStreamPrefix(input), buttons: createCommonButtons(helpUri), }) @@ -80,11 +77,11 @@ export class LogStreamFilterSubmenu extends Prompter { public validateLogStreamPrefix(prefix: string) { if (prefix.length > 512) { - return 'LogStream prefix cannot be longer than 512 characters' + return 'Log Stream prefix cannot be longer than 512 characters' } if (!this.logStreamPrefixRegEx.test(prefix)) { - return 'LogStream prefix must match pattern: [^:*]*' + return 'Log Stream prefix must match pattern: [^:*]*' } } @@ -104,7 +101,7 @@ export class LogStreamFilterSubmenu extends Prompter { .map((streams) => streams!.map((stream) => ({ data: stream.logStreamName!, label: stream.logStreamName! }))) return createQuickPick(items, { - title: 'Select LogStream', + title: 'Select Log Stream', buttons: createCommonButtons(helpUri), }) } diff --git a/packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts b/packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts index cc07bc71961..025820df792 100644 --- a/packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts +++ b/packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts @@ -38,7 +38,7 @@ export class TailLogGroupWizard extends Wizard { this.form.regionLogGroupSubmenuResponse.bindPrompter(createRegionLogGroupSubmenu) this.form.logStreamFilter.bindPrompter((state) => { if (!state.regionLogGroupSubmenuResponse?.data) { - throw new ToolkitError('LogGroupName is null') + throw new ToolkitError('Log Group name is null') } return new LogStreamFilterSubmenu( state.regionLogGroupSubmenuResponse.data, @@ -57,7 +57,7 @@ export function createRegionLogGroupSubmenu(): RegionSubmenu { buttons: [createExitButton()], }, { title: localize('AWS.cwl.tailLogGroup.regionPromptTitle', 'Select Region for Log Group') }, - 'LogGroups' + 'Log Groups' ) } @@ -69,7 +69,7 @@ async function getLogGroupQuickPickOptions(regionCode: string): Promise { input.acceptValue(invalidInput) - assert.deepEqual(input.validationMessage, 'LogStream prefix must match pattern: [^:*]*') + assert.deepEqual(input.validationMessage, 'Log Stream prefix must match pattern: [^:*]*') input.hide() }) const inputBox = logStreamFilterSubmenu.createLogStreamPrefixBox() @@ -53,7 +57,7 @@ describe('liveTailLogStreamSubmenu', async function () { const invalidInput = 'my-log-stream*' getTestWindow().onDidShowInputBox((input) => { input.acceptValue(invalidInput) - assert.deepEqual(input.validationMessage, 'LogStream prefix must match pattern: [^:*]*') + assert.deepEqual(input.validationMessage, 'Log Stream prefix must match pattern: [^:*]*') input.hide() }) const inputBox = logStreamFilterSubmenu.createLogStreamPrefixBox() @@ -64,7 +68,7 @@ describe('liveTailLogStreamSubmenu', async function () { const invalidInput = 'a'.repeat(520) getTestWindow().onDidShowInputBox((input) => { input.acceptValue(invalidInput) - assert.deepEqual(input.validationMessage, 'LogStream prefix cannot be longer than 512 characters') + assert.deepEqual(input.validationMessage, 'Log Stream prefix cannot be longer than 512 characters') input.hide() }) const inputBox = logStreamFilterSubmenu.createLogStreamPrefixBox() From aa5dfc3992c1671cd1842891dfd23c1032eca8c0 Mon Sep 17 00:00:00 2001 From: Keegan Irby Date: Wed, 20 Nov 2024 19:52:09 -0800 Subject: [PATCH 2/3] Change info message text --- .../core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts b/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts index 1b0e914f762..64c68209859 100644 --- a/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts +++ b/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts @@ -45,7 +45,7 @@ export async function tailLogGroup( if (registry.has(uriToKey(session.uri))) { await vscode.window.showTextDocument(session.uri, { preview: false }) void vscode.window.showInformationMessage( - `Opening already running session's document. Found running session that matches new request.` + `Switching editor to an existing session. Found running session that matches request.` ) span.record({ result: 'Succeeded', From d8c81d428cc3f3f75ab3f60b1047a8d8e8c9cc26 Mon Sep 17 00:00:00 2001 From: Keegan Irby Date: Thu, 21 Nov 2024 13:25:50 -0800 Subject: [PATCH 3/3] Condense info message text --- .../src/awsService/cloudWatchLogs/commands/tailLogGroup.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts b/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts index 64c68209859..de235cabc23 100644 --- a/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts +++ b/packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts @@ -44,9 +44,7 @@ export async function tailLogGroup( const session = new LiveTailSession(liveTailSessionConfig) if (registry.has(uriToKey(session.uri))) { await vscode.window.showTextDocument(session.uri, { preview: false }) - void vscode.window.showInformationMessage( - `Switching editor to an existing session. Found running session that matches request.` - ) + void vscode.window.showInformationMessage(`Switching editor to an existing session that matches request.`) span.record({ result: 'Succeeded', sessionAlreadyStarted: true,