Skip to content

Commit 410d38e

Browse files
Muzaffer AydinMuzaffer Aydin
authored andcommitted
Merge branch 'master' into muaydin/docdb-polling-bug-fix
2 parents 2dc2363 + 3ed322e commit 410d38e

File tree

21 files changed

+166
-142
lines changed

21 files changed

+166
-142
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "User-selected customizations are sometimes not being persisted."
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "feat(amazonq): Add error message for updated README too large"
4+
}

packages/amazonq/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,6 @@
218218
"id": "aws.AmazonQChatView",
219219
"name": "%AWS.amazonq.chat%",
220220
"when": "!aws.isWebExtHost && !aws.amazonq.showLoginView"
221-
},
222-
{
223-
"id": "aws.AmazonQNeverShowBadge",
224-
"name": "",
225-
"when": "false"
226221
}
227222
],
228223
"aws-codewhisperer-reference-log": [

packages/amazonq/src/app/chat/activation.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export async function activate(context: ExtensionContext) {
6161
void vscode.env.openExternal(vscode.Uri.parse(amazonq.amazonQHelpUrl))
6262
})
6363

64-
await amazonq.activateBadge()
6564
void setupLsp()
6665
void setupAuthNotification()
6766
}

packages/core/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@
391391
"AWS.amazonq.doc.error.noFolderSelected": "It looks like you didn't choose a folder. Choose a folder to continue.",
392392
"AWS.amazonq.doc.error.contentLengthError": "Your workspace is too large for me to review. Your workspace must be within the quota, even if you choose a smaller folder. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
393393
"AWS.amazonq.doc.error.readmeTooLarge": "The README in your folder is too large for me to review. Try reducing the size of your README, or choose a folder with a smaller README. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
394+
"AWS.amazonq.doc.error.readmeUpdateTooLarge": "The updated README is too large. Try reducing the size of your README, or asking for a smaller update. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
394395
"AWS.amazonq.doc.error.workspaceEmpty": "The folder you chose did not contain any source files in a supported language. Choose another folder and try again. For more information on supported languages, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html\" target=\"_blank\">Amazon Q Developer documentation.</a>",
395396
"AWS.amazonq.doc.error.promptTooVague": "I need more information to make changes to your README. Try providing some of the following details:\n- Which sections you want to modify\n- The content you want to add or remove\n- Specific issues that need correcting\n\nFor more information on prompt best practices, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html\" target=\"_blank\">Amazon Q Developer documentation.</a>",
396397
"AWS.amazonq.doc.error.promptUnrelated": "These changes don't seem related to documentation. Try describing your changes again, using the following best practices:\n- Changes should relate to how project functionality is reflected in the README\n- Content you refer to should be available in your codebase\n\n For more information on prompt best practices, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html\" target=\"_blank\">Amazon Q Developer documentation.</a>",

packages/core/src/amazonq/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export { init as featureDevChatAppInit } from '../amazonqFeatureDev/app'
2424
export { init as gumbyChatAppInit } from '../amazonqGumby/app'
2525
export { init as testChatAppInit } from '../amazonqTest/app'
2626
export { init as docChatAppInit } from '../amazonqDoc/app'
27-
export { activateBadge } from './util/viewBadgeHandler'
2827
export { amazonQHelpUrl } from '../shared/constants'
2928
export { listCodeWhispererCommandsWalkthrough } from '../codewhisperer/ui/statusBarMenu'
3029
export { focusAmazonQPanel, focusAmazonQPanelKeybinding } from '../codewhispererChat/commands/registerCommands'

packages/core/src/amazonq/util/viewBadgeHandler.ts

Lines changed: 0 additions & 83 deletions
This file was deleted.

packages/core/src/amazonq/webview/webView.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import { dispatchAppsMessagesToWebView, dispatchWebViewMessagesToApps } from './
1919
import { MessageListener } from '../messages/messageListener'
2020
import { MessagePublisher } from '../messages/messagePublisher'
2121
import { TabType } from './ui/storages/tabsStorage'
22-
import { deactivateInitialViewBadge, shouldShowBadge } from '../util/viewBadgeHandler'
23-
import { telemetry } from '../../shared/telemetry/telemetry'
2422
import { amazonqMark } from '../../shared/performance/marks'
2523

2624
export class AmazonQChatViewProvider implements WebviewViewProvider {
@@ -66,19 +64,5 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
6664
)
6765

6866
performance.mark(amazonqMark.open)
69-
70-
// badge is shown, emit telemetry for first time an existing, unscoped user tries Q
71-
// note: this will fire on any not-properly-scoped Q entry.
72-
// this means we can't tie it directly to the badge although it is hinted at
73-
if (await shouldShowBadge()) {
74-
telemetry.ui_click.emit({
75-
elementId: 'amazonq_tryAmazonQ',
76-
passive: false,
77-
})
78-
}
79-
// if a user EVER enters Q, we should never show the badge again.
80-
// the webview view only loads if the user clicks the view container,
81-
// so we can essentially use this as a guarantee that a user has entered Q.
82-
deactivateInitialViewBadge()
8367
}
8468
}

packages/core/src/amazonqDoc/errors.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ export class ReadmeTooLargeError extends ToolkitError {
2020
}
2121
}
2222

23+
export class ReadmeUpdateTooLargeError extends ToolkitError {
24+
constructor() {
25+
super(i18n('AWS.amazonq.doc.error.readmeUpdateTooLarge'), {
26+
code: ReadmeUpdateTooLargeError.name,
27+
})
28+
}
29+
}
30+
2331
export class WorkspaceEmptyError extends ToolkitError {
2432
constructor() {
2533
super(i18n('AWS.amazonq.doc.error.workspaceEmpty'), {

packages/core/src/amazonqDoc/session/sessionState.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {
4545
PromptTooVagueError,
4646
PromptUnrelatedError,
4747
ReadmeTooLargeError,
48+
ReadmeUpdateTooLargeError,
4849
WorkspaceEmptyError,
4950
} from '../errors'
5051
import { DocMessenger } from '../messenger'
@@ -149,6 +150,9 @@ abstract class CodeGenBase {
149150
case codegenResult.codeGenerationStatusDetail?.includes('README_TOO_LARGE'): {
150151
throw new ReadmeTooLargeError()
151152
}
153+
case codegenResult.codeGenerationStatusDetail?.includes('README_UPDATE_TOO_LARGE'): {
154+
throw new ReadmeUpdateTooLargeError()
155+
}
152156
case codegenResult.codeGenerationStatusDetail?.includes('WORKSPACE_TOO_LARGE'): {
153157
throw new ContentLengthError()
154158
}

0 commit comments

Comments
 (0)