Skip to content

Commit 780c427

Browse files
authored
feat(featureDev): generated plan being shown from top (aws#5098)
* feat: add snapToTop property for generated feature dev plans Problem: - We don't scroll when a feature dev plan is generated Solution: - use snapToTop to automatically scroll
1 parent 8badaae commit 780c427

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed
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(featureDev): generated plan being shown from top"
4+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export class Connector {
141141
messageId: messageData.messageID ?? messageData.triggerID ?? '',
142142
relatedContent: undefined,
143143
canBeVoted: messageData.canBeVoted,
144+
snapToTop: messageData.snapToTop,
144145
followUp:
145146
messageData.followUps !== undefined && messageData.followUps.length > 0
146147
? {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ export class FeatureDevController {
348348
type: 'answer',
349349
tabID: tabID,
350350
canBeVoted: true,
351+
snapToTop: true,
351352
})
352353

353354
if (interactions.responseType === 'VALID') {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class Messenger {
3232
followUps?: ChatItemAction[]
3333
tabID: string
3434
canBeVoted?: boolean
35+
snapToTop?: boolean
3536
}) {
3637
this.dispatcher.sendChatMessage(
3738
new ChatMessage(
@@ -41,6 +42,7 @@ export class Messenger {
4142
followUps: params.followUps,
4243
relatedSuggestions: undefined,
4344
canBeVoted: params.canBeVoted ?? false,
45+
snapToTop: params.snapToTop ?? false,
4446
},
4547
params.tabID
4648
)

packages/core/src/amazonqFeatureDev/views/connector/connector.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export interface ChatMessageProps {
150150
readonly followUps: ChatItemAction[] | undefined
151151
readonly relatedSuggestions: SourceLink[] | undefined
152152
readonly canBeVoted: boolean
153+
readonly snapToTop: boolean
153154
}
154155

155156
export class ChatMessage extends UiMessage {
@@ -159,6 +160,7 @@ export class ChatMessage extends UiMessage {
159160
readonly relatedSuggestions: SourceLink[] | undefined
160161
readonly canBeVoted: boolean
161162
readonly requestID!: string
163+
readonly snapToTop: boolean
162164
override type = 'chatMessage'
163165

164166
constructor(props: ChatMessageProps, tabID: string) {
@@ -168,6 +170,7 @@ export class ChatMessage extends UiMessage {
168170
this.followUps = props.followUps
169171
this.relatedSuggestions = props.relatedSuggestions
170172
this.canBeVoted = props.canBeVoted
173+
this.snapToTop = props.snapToTop
171174
}
172175
}
173176

0 commit comments

Comments
 (0)