diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevController.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevController.kt index 2afe8fbef40..9483b320bd2 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevController.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevController.kt @@ -313,7 +313,8 @@ class FeatureDevController( deletedFiles.find { it.zipFilePath == fileToUpdate }?.let { it.rejected = !it.rejected } } - // Update the state of the tree view: + // FIXME: This is a kludge that is hiding the fact that insertChanges is updating the file tree above this point to + // an incorrect state. Update the state of the tree view: messenger.updateFileComponent(message.tabId, filePaths, deletedFiles, messageId) // Then, if the accepted file is not a deletion, open a diff to show the changes are applied: @@ -420,9 +421,13 @@ class FeatureDevController( credentialStartUrl = getStartUrl(project = context.project) ) + // Caution: insertChanges has multiple responsibilities. + // The filter here results in rejected files being hidden from the tree after continuing, by design. + // However, it is critical that we don't hide already-accepted files. Inside insertChanges, it + // filters to only update the subset of passed files that aren't accepted or rejected already. session.insertChanges( - filePaths = filePaths.filterNot { it.rejected || it.changeApplied }, - deletedFiles = deletedFiles.filterNot { it.rejected || it.changeApplied }, + filePaths = filePaths.filter { !it.rejected }, + deletedFiles = deletedFiles.filter { !it.rejected }, references = references, messenger ) diff --git a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties index dda5f4355ea..595c6fe8381 100644 --- a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties +++ b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties @@ -82,8 +82,8 @@ amazonqFeatureDev.follow_instructions_for_authentication=Follow instructions to amazonqFeatureDev.follow_up.close_session=No, thanks amazonqFeatureDev.follow_up.continue=Continue amazonqFeatureDev.follow_up.incorrect_source_folder=The folder you chose isn't in your open workspace folder. You can add this folder to your workspace, or choose a folder in your open workspace. -amazonqFeatureDev.follow_up.insert_all_code=Accept all code -amazonqFeatureDev.follow_up.insert_remaining_code=Accept remaining code +amazonqFeatureDev.follow_up.insert_all_code=Accept all changes +amazonqFeatureDev.follow_up.insert_remaining_code=Accept remaining changes amazonqFeatureDev.follow_up.modified_source_folder=Changed source root to: {0} amazonqFeatureDev.follow_up.modify_source_folder=Select files for context amazonqFeatureDev.follow_up.new_task=Yes, I have another task