Skip to content

Allow canceling / reverting prompt enhancement #1267

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hassoncs
Copy link
Contributor

@hassoncs hassoncs commented Jul 11, 2025

Allow canceling / reverting prompt enhancement!

2025-07-21 11 03 35

  • Clicking the button again while it loads will cancel the enhancement
  • After enhancement, the button turns into a "revert" button
  • If the enhanced prompt is changed at all, the revert button becomes an 'enhance' button again

Copy link

changeset-bot bot commented Jul 11, 2025

🦋 Changeset detected

Latest commit: 81148d5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hassoncs hassoncs changed the title 'chore: WIP' WIP: Allow canceling / reverting prompt enhancement Jul 11, 2025
@hassoncs hassoncs requested a review from Copilot July 11, 2025 18:15
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for canceling and reverting prompt enhancements in the chat UI.

  • Introduces cancelEnhancement and revertEnhancement labels in all locales.
  • Updates ChatTextArea to store original/enhanced prompt state and handle cancel/revert flows.
  • Adds unit and E2E tests covering enhancement, cancellation, and revert behaviors.

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
webview-ui/src/i18n/locales/*/kilocode.json Added enhancePrompt translations for all locales
webview-ui/src/components/chat/ChatTextArea.tsx Implemented prompt cancellation and revert logic
webview-ui/src/components/chat/tests/ChatTextArea.spec.tsx Added tests for cancel/revert prompt enhancement
apps/playwright-e2e/tests/enhance-prompt.test.ts New E2E tests for prompt enhancement flows
apps/playwright-e2e/tests/chat-with-response-refactored.test.ts New refactored chat E2E test
apps/playwright-e2e/playwright.config.ts Adjusted retry settings
apps/playwright-e2e/helpers/test-setup-helpers.ts Extracted shared test setup helper
apps/playwright-e2e/helpers/enhance-prompt-helpers.ts Helper functions for E2E prompt enhancement tests
apps/playwright-e2e/helpers/chat-helpers.ts Helper functions for E2E chat interactions
Comments suppressed due to low confidence (1)

webview-ui/src/components/chat/ChatTextArea.tsx:1480

  • The translation key namespace appears incorrect; verify whether it should be t("chat:enhancePrompt.cancelEnhancement") instead of t("kilocode:chat.enhancePrompt.cancelEnhancement").
							title={

@hassoncs hassoncs force-pushed the cancel-revert-enhancement branch 2 times, most recently from 14246b7 to 354d9d2 Compare July 17, 2025 04:21
@chrarnoldus
Copy link
Contributor

related? RooCodeInc/Roo-Code#5742

@hassoncs hassoncs force-pushed the cancel-revert-enhancement branch from 3f8688a to d7a8933 Compare July 21, 2025 17:52
@hassoncs hassoncs changed the base branch from main to roo-v3.23.14 July 21, 2025 17:52
@hassoncs
Copy link
Contributor Author

@chrarnoldus, oh yeah! Looks like they built a rough version of this based on the native undo! I'll see what parts of this make sense to keep around

@hassoncs hassoncs force-pushed the cancel-revert-enhancement branch 2 times, most recently from 473383d to 0a08647 Compare July 21, 2025 22:34
Base automatically changed from roo-v3.23.14 to main July 22, 2025 12:26
@hassoncs hassoncs force-pushed the cancel-revert-enhancement branch from 0a08647 to 4d7d434 Compare July 22, 2025 17:18
Extract common setup logic into a dedicated helper function `setupTestEnvironment`.
Introduce new helper files for chat interactions and consolidate exports.
This improves test readability and reduces duplication in E2E tests.
@hassoncs hassoncs force-pushed the cancel-revert-enhancement branch from 4d7d434 to 91a0a89 Compare July 22, 2025 17:48
Adds the ability to revert an enhanced prompt back to its original state.
This includes:
- New state management in `ChatTextArea` to track original and enhanced prompts.
- Logic to switch the enhance button between "enhance", "cancel", and "revert" states.
- New Playwright E2E tests to cover the full enhancement workflow, including cancellation and reverting.
- Updates to i18n files for new button labels.
@hassoncs hassoncs force-pushed the cancel-revert-enhancement branch from 91a0a89 to 81148d5 Compare July 22, 2025 17:49
@hassoncs hassoncs changed the base branch from main to cleanup-playwright-helpers July 22, 2025 17:50
@hassoncs hassoncs changed the title WIP: Allow canceling / reverting prompt enhancement Allow canceling / reverting prompt enhancement Jul 22, 2025
@hassoncs hassoncs marked this pull request as ready for review July 22, 2025 17:51
Base automatically changed from cleanup-playwright-helpers to main July 22, 2025 18:50
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.

2 participants