aws / mynah-ui

The chat interface of Amazon Q Developer (for IDEs)
https://aws.github.io/mynah-ui/
Apache License 2.0
15 stars 14 forks source link

Extend FileTree component to support deleted files #26

Closed jsalles closed 11 months ago

jsalles commented 11 months ago

Issue #, if available: https://issues.amazon.com/issues/D103547746

Description of changes:

This CR introduces the deletedFiles property to the CODE_RESULT Chat Item.

Since we're now sending a more complex object from the toolkit to Mynah, the message is sent as a stringified JSON and parsed accordingly in Mynah, but only for that chat item type.

The deleted files are also displayed in the FileTree component, with their name crossed out.

Note: I see now that a lot of the differences in this PR are formatting changes, probably caused by prettier, and this make the PR harder to review. If there's a common formatter that I could use to minimize the changes, I'd be happy to reformat and update the PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

jpinkney-aws commented 11 months ago

Are you able to point out which specific changes to pay attention to? (that aren't the formatting ones)

Also there seems to be a prettier config in the package.json: https://github.com/aws/mynah-ui/blob/main/package.json#L52. I wonder why that's not being used 🤔

mk-fan commented 11 months ago

Similar to jpinkney-aws's comment above: are you using the prettier config in this repo or your IDE's default config? It will make review easier if we can remove the unnecessary formatting changes.

jsalles commented 11 months ago

Are you able to point out which specific changes to pay attention to? (that aren't the formatting ones)

Also there seems to be a prettier config in the package.json: https://github.com/aws/mynah-ui/blob/main/package.json#L52. I wonder why that's not being used 🤔

Similar to jpinkney-aws's comment above: are you using the prettier config in this repo or your IDE's default config? It will make review easier if we can remove the unnecessary formatting changes.

If you set the diff to ignore whitespaces, it becomes much more clearer what I've changed and doesn't show the huge blocks of deleted/added code.

I don't know why the prettier config was not being applied, but as I see it my IDE is the one actually using it correctly.

This line for example https://github.com/aws/mynah-ui/blob/0ec91300ff14fccf8b6de21cdd06d9eacc94bf0d/src/components/chat-item/chat-item-card.ts#L152 is well over 200 characters long, and should not be allowed by prettier.

Anyway, I'll try to comment on the lines that I've changed that are the most relevant.