Skip to content

Conversation

@hassoncs
Copy link
Contributor

@hassoncs hassoncs commented Jun 13, 2025

I found a bug on the Prompt page! Here's a quick fix

Normally when you edit things on the settings pages, the save button lights up, and clicking cancel will discard your changes. Currently the prompts page doesn't support this flow- the prompts are immediately saved when they change and the revert button doesn't seem to work.

With this change, we use the normal cachedState system in the SettingView, allowing users to discard changes to their prompts like any other setting. This removed the need for the resetSupportPrompt event since we send the entire state of the support prompts (same as before).

Related GitHub Issue

Closes: #

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Before, no save/discard and revert button doesn't work
2025-06-12 21 14 10

After, save discard work, revert button works
2025-06-12 21 19 08


Important

Adds save/discard functionality for support prompts in settings, updating state management and component behavior.

  • Behavior:
    • Implements save/discard flow for support prompts in webviewMessageHandler.ts, replacing immediate save behavior.
    • Removes resetSupportPrompt event handling in webviewMessageHandler.ts.
  • Components:
    • Updates PromptsSettings to manage prompt updates and resets locally.
    • Integrates prompt state management in SettingsView.tsx.
  • State Management:
    • Updates ExtensionStateContext.tsx to support new prompt state management.

This description was created by Ellipsis for f184953. You can customize this summary. It will automatically update as commits are pushed.

Normally when you edit things on the settings pages, the save button lights up,
allowing you to discard your changes. Currently the prompts page doesn't support this flow-
the prompts are immediately saved when they change.

With this change, we use the normal cachedState system in the SettingView, allowing users to dicard changes to their prompts like any other setting.
This removed the need for the resetSupportPrompt event since we send the entire state of the support prompts (same as before).

Test plan:
* Manually verified prompts can be saved/discarded for different types of support prompts.
@hassoncs hassoncs requested review from cte, jr and mrubens as code owners June 13, 2025 04:21
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 13, 2025
@hassoncs hassoncs changed the title Add support for the save/discard flow for support prompt setting page Fix the save/discard/revert flow for Prompt Settings Jun 13, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 13, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jun 13, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 13, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Thank you!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 14, 2025
@mrubens mrubens merged commit 54edab5 into RooCodeInc:main Jun 14, 2025
28 checks passed
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Jun 14, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 14, 2025
cte pushed a commit that referenced this pull request Jun 24, 2025
Add support for the save/discard flow for support prompt setting page

Normally when you edit things on the settings pages, the save button lights up,
allowing you to discard your changes. Currently the prompts page doesn't support this flow-
the prompts are immediately saved when they change.

With this change, we use the normal cachedState system in the SettingView, allowing users to dicard changes to their prompts like any other setting.
This removed the need for the resetSupportPrompt event since we send the entire state of the support prompts (same as before).

Test plan:
* Manually verified prompts can be saved/discarded for different types of support prompts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Preliminary Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

The save/discard flow does not work for updating Support Prompts

3 participants