Skip to content

Commit 66cc926

Browse files
authored
feat: upgrade mynah-ui to latest version #4440
Problem: To support future chat features, it is necessary to update the dependent library responsible for rendering the chat UI, `mynah-ui`. The only breaking change that affects this codebase from upgrading from `3.x` to `4.x` is that `ChatItemFollowUp` [is renamed to](aws/mynah-ui@631d87a) `ChatItemAction` Testing: Manually tested Q chat and `/dev` functionality, paying particular attention to behavior around the follow-up items `npm run testE2E` passed
1 parent 6f26948 commit 66cc926

File tree

11 files changed

+24
-24
lines changed

11 files changed

+24
-24
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/toolkit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4340,7 +4340,7 @@
43404340
"@aws-sdk/property-provider": "3.46.0",
43414341
"@aws-sdk/smithy-client": "^3.46.0",
43424342
"@aws-sdk/util-arn-parser": "^3.46.0",
4343-
"@aws/mynah-ui": "3.3.3",
4343+
"@aws/mynah-ui": "4.0.3",
43444344
"@gerhobbelt/gitignore-parser": "^0.2.0-9",
43454345
"@iarna/toml": "^2.2.5",
43464346
"@smithy/shared-ini-file-loader": "^2.2.8",

packages/toolkit/src/amazonq/webview/ui/apps/amazonqCommonsConnector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { ChatItemFollowUp } from '@aws/mynah-ui'
6+
import { ChatItemAction } from '@aws/mynah-ui'
77
import { ExtensionMessage } from '../commands'
88
import { AuthFollowUpType } from '../followUps/generator'
99

@@ -32,7 +32,7 @@ export class Connector {
3232
this.onWelcomeFollowUpClicked = props.onWelcomeFollowUpClicked
3333
}
3434

35-
followUpClicked = (tabID: string, followUp: ChatItemFollowUp): void => {
35+
followUpClicked = (tabID: string, followUp: ChatItemAction): void => {
3636
if (followUp.type !== undefined && followUp.type === 'continue-to-chat') {
3737
this.onWelcomeFollowUpClicked(tabID, followUp.type)
3838
}

packages/toolkit/src/amazonq/webview/ui/apps/cwChatConnector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { ChatItem, ChatItemFollowUp, ChatItemType, FeedbackPayload } from '@aws/mynah-ui'
6+
import { ChatItem, ChatItemAction, ChatItemType, FeedbackPayload } from '@aws/mynah-ui'
77
import { ExtensionMessage } from '../commands'
88
import { CodeReference } from './amazonqCommonsConnector'
99
import { TabOpenType, TabsStorage } from '../storages/tabsStorage'
@@ -68,7 +68,7 @@ export class Connector {
6868
})
6969
}
7070

71-
followUpClicked = (tabID: string, messageId: string, followUp: ChatItemFollowUp): void => {
71+
followUpClicked = (tabID: string, messageId: string, followUp: ChatItemAction): void => {
7272
this.sendMessageToExtension({
7373
command: 'follow-up-was-clicked',
7474
followUp,

packages/toolkit/src/amazonq/webview/ui/apps/featureDevChatConnector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { ChatItem, ChatItemFollowUp, ChatItemType, FeedbackPayload } from '@aws/mynah-ui'
6+
import { ChatItem, ChatItemAction, ChatItemType, FeedbackPayload } from '@aws/mynah-ui'
77
import { ExtensionMessage } from '../commands'
88
import { TabType, TabsStorage } from '../storages/tabsStorage'
99
import { CodeReference } from './amazonqCommonsConnector'
@@ -93,7 +93,7 @@ export class Connector {
9393
})
9494
}
9595

96-
followUpClicked = (tabID: string, followUp: ChatItemFollowUp): void => {
96+
followUpClicked = (tabID: string, followUp: ChatItemAction): void => {
9797
this.sendMessageToExtension({
9898
command: 'follow-up-was-clicked',
9999
followUp,

packages/toolkit/src/amazonq/webview/ui/connector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { ChatItem, ChatItemFollowUp, FeedbackPayload, Engagement } from '@aws/mynah-ui'
6+
import { ChatItem, FeedbackPayload, Engagement, ChatItemAction } from '@aws/mynah-ui'
77
import { Connector as CWChatConnector } from './apps/cwChatConnector'
88
import { Connector as FeatureDevChatConnector } from './apps/featureDevChatConnector'
99
import { Connector as AmazonQCommonsConnector } from './apps/amazonqCommonsConnector'
@@ -280,7 +280,7 @@ export class Connector {
280280
}
281281
}
282282

283-
onFollowUpClicked = (tabID: string, messageId: string, followUp: ChatItemFollowUp): void => {
283+
onFollowUpClicked = (tabID: string, messageId: string, followUp: ChatItemAction): void => {
284284
switch (this.tabsStorage.getTab(tabID)?.type) {
285285
// TODO: We cannot rely on the tabType here,
286286
// It can come up at a later point depending on the future UX designs,

packages/toolkit/src/amazonq/webview/ui/followUps/handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { ChatItemFollowUp, ChatItemType, MynahUI } from '@aws/mynah-ui'
6+
import { ChatItemAction, ChatItemType, MynahUI } from '@aws/mynah-ui'
77
import { Connector } from '../connector'
88
import { TabsStorage } from '../storages/tabsStorage'
99
import { WelcomeFollowupType } from '../apps/amazonqCommonsConnector'
@@ -26,7 +26,7 @@ export class FollowUpInteractionHandler {
2626
this.tabsStorage = props.tabsStorage
2727
}
2828

29-
public onFollowUpClicked(tabID: string, messageId: string, followUp: ChatItemFollowUp) {
29+
public onFollowUpClicked(tabID: string, messageId: string, followUp: ChatItemAction) {
3030
if (
3131
followUp.type !== undefined &&
3232
['full-auth', 're-auth', 'missing_scopes', 'use-supported-auth'].includes(followUp.type)

packages/toolkit/src/amazonq/webview/ui/followUps/model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { ChatItemFollowUp } from '@aws/mynah-ui'
6+
import { ChatItemAction } from '@aws/mynah-ui'
77

88
export interface FollowUpsBlock {
99
text?: string
10-
options?: ChatItemFollowUp[]
10+
options?: ChatItemAction[]
1111
}

packages/toolkit/src/amazonqFeatureDev/controllers/chat/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { ChatItemFollowUp } from '@aws/mynah-ui'
6+
import { ChatItemAction } from '@aws/mynah-ui'
77
import { existsSync } from 'fs'
88
import * as path from 'path'
99
import * as vscode from 'vscode'
@@ -266,7 +266,7 @@ export class FeatureDevController {
266266
}
267267
}
268268

269-
private getFollowUpOptions(phase: SessionStatePhase | undefined): ChatItemFollowUp[] {
269+
private getFollowUpOptions(phase: SessionStatePhase | undefined): ChatItemAction[] {
270270
switch (phase) {
271271
case 'Approach':
272272
return [

packages/toolkit/src/amazonqFeatureDev/controllers/chat/messenger/messenger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import {
1717
OpenNewTabMessage,
1818
} from '../../../views/connector/connector'
1919
import { AppToWebViewMessageDispatcher } from '../../../views/connector/connector'
20-
import { ChatItemFollowUp } from '@aws/mynah-ui'
20+
import { ChatItemAction } from '@aws/mynah-ui'
2121

2222
export class Messenger {
2323
public constructor(private readonly dispatcher: AppToWebViewMessageDispatcher) {}
2424

2525
public sendAnswer(params: {
2626
message?: string
2727
type: 'answer' | 'answer-part' | 'answer-stream' | 'system-prompt'
28-
followUps?: ChatItemFollowUp[]
28+
followUps?: ChatItemAction[]
2929
tabID: string
3030
canBeVoted?: boolean
3131
}) {

0 commit comments

Comments
 (0)