Skip to content

fix: ux polish for list directory tool messages. #1075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2025

Conversation

laileni-aws
Copy link
Contributor

Problem

  • Existing UX shows multiple context list chatItem cards for list directory tool messages.

Solution

  • Use a messageIdToUpdateListDir state to store the messageId and update this for next list directory tool messages.
    image

TODO:

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@laileni-aws laileni-aws marked this pull request as ready for review April 22, 2025 23:54
@laileni-aws laileni-aws requested a review from a team as a code owner April 22, 2025 23:54
@laileni-aws laileni-aws requested a review from zixlin7 April 23, 2025 00:07
@laileni-aws laileni-aws force-pushed the flare branch 2 times, most recently from c124de2 to 78c275a Compare April 23, 2025 01:49
messageId = chatResultStream.getMessageIdToUpdate()!
} else if (messageId) {
chatResultStream.setMessageIdToUpdate(messageId)
let messageIdToUpdate = toolUse.toolUseId!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this always going to be defined? what happens if toolUseId isn't?

Copy link
Contributor Author

@laileni-aws laileni-aws Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We come to this part of code processReadOrList once toolName and toolId is available!
We has existing check here So don't want to duplicate by adding one more check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so really the ToolUse type should really be something like Required<ToolUse> as an input to this function since the optional fields are actually defined? Not a blocker, but worth a consideration

} else if (messageId) {
chatResultStream.setMessageIdToUpdate(messageId)
let messageIdToUpdate = toolUse.toolUseId!
const currentId = chatResultStream.getMessageIdToUpdateForTool(toolUse.name!)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will toolUse name always be defined? what happens if name isn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replied here

* @param filePaths Array of FileDetailsWithPath involved in the operation
*/
addMessageOperation(messageId: string, type: OperationType, filePaths: FileDetailsWithPath[]) {
this.#state.messageOperations.set(messageId, { type, filePaths })
addMessageOperation(messageId: string, type: string, filePaths: FileDetailsWithPath[]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make a type here instead of converting to string? then you wouldn't need to cast to an operation type on the next line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this approach,
OperationType can not be imported to agenticChatController.ts so explicitly mentioning here!

messageId = chatResultStream.getMessageIdToUpdate()!
} else if (messageId) {
chatResultStream.setMessageIdToUpdate(messageId)
let messageIdToUpdate = toolUse.toolUseId!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so really the ToolUse type should really be something like Required<ToolUse> as an input to this function since the optional fields are actually defined? Not a blocker, but worth a consideration

@jpinkney-aws jpinkney-aws merged commit 7cefc1f into aws:main Apr 23, 2025
6 checks passed
opieter-aws pushed a commit to opieter-aws/language-servers that referenced this pull request Apr 23, 2025
## Problem
- Existing UX shows multiple context list chatItem cards for list directory tool messages.
## Solution
- Use a `messageIdToUpdateListDir` state to store the messageId and update this for next list directory tool messages.
![image](https://github.com/user-attachments/assets/08fff204-0bbc-4467-b05b-7f90be062fc1)

## TODO:
- Need to combine both read and list directory tool messages into one context list.
- This code change is equivalent to this PR: aws/aws-toolkit-vscode#7006 in `feature/agentic-chat` branch.
opieter-aws added a commit that referenced this pull request Apr 23, 2025
* fix: add result attribute when emitting telemetry event

* fix: remove comment

* fix: unit test

* fix: fix unit test

* fix: fix unit test

* feat(chat-client): open use input prompt for agentic chat and new prompt should st… (#1081)

feat: open use input prompt for agentic chat and new prompt should stop current response

* fix: ux polish for list directory tool messages. (#1075)

## Problem
- Existing UX shows multiple context list chatItem cards for list directory tool messages.
## Solution
- Use a `messageIdToUpdateListDir` state to store the messageId and update this for next list directory tool messages.
![image](https://github.com/user-attachments/assets/08fff204-0bbc-4467-b05b-7f90be062fc1)

## TODO:
- Need to combine both read and list directory tool messages into one context list.
- This code change is equivalent to this PR: aws/aws-toolkit-vscode#7006 in `feature/agentic-chat` branch.

* fix: execute command should show when no approval required & add more loading (#1091)

* fix: fix unit test

---------

Co-authored-by: invictus <[email protected]>
Co-authored-by: Laxman Reddy <[email protected]>
Co-authored-by: Zoe Lin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants