873 update system prompt when source or target language is changed#1017
Open
Luke-Bilhorn wants to merge 10 commits into
Open
873 update system prompt when source or target language is changed#1017Luke-Bilhorn wants to merge 10 commits into
Luke-Bilhorn wants to merge 10 commits into
Conversation
The component is consumed outside StartupFlow already (NewSourceUploader), and an upcoming SystemMessageReview webview will reuse it too. Move it to the shared components directory so its location reflects its scope. No behavior change.
…mMessageStep These let consumers reuse the component in non-walkthrough contexts (e.g. the upcoming system-message review prompt after a language change), where a contextual banner and an explicit "I don't need to change this" dismiss button are needed. Defaults preserve current behavior in NewSourceUploader.
A standalone React app that hosts the shared SystemMessageStep with a language-change warning banner and an "I don't need to change this" dismiss button. Will be opened after a project source/target language change to prompt the user to review their AI translation instructions. Wired into the build pipeline alongside the other webview apps. Not yet opened from anywhere; provider wiring follows in subsequent commits.
Adds openSystemMessageReview(reason) and registers codex-editor-extension.promptSystemMessageReview as a thin wrapper. The panel hosts the SystemMessageReview webview and handles the generate / save / dismiss flow against MetadataManager. If the panel is closed without the user addressing the prompt (save, regenerate, or "I don't need to change this"), the AI translation instructions are regenerated automatically so they don't stay stale relative to the new language. Concurrent triggers reuse a single panel so back-to-back source+target changes don't spawn duplicate windows. Not yet triggered from anywhere; wiring follows in the next commit.
Wires the codex-editor-extension.promptSystemMessageReview command into both paths that can change a project's source or target language after initial setup: - codex-project-manager.changeSourceLanguage / changeTargetLanguage (MainMenu and project settings entry points) - StartupFlowProvider.handleProjectChange (pre-open project edit screen) The prompt is only shown when the selected language tag differs from the existing one, so re-confirming the same language is a no-op. The initial project-creation flow remains untouched. Closes #873.
…ning per context - Simplify the Generate/Save button internals: drop the hand-rolled margin/padding offsets that produced uneven icon spacing in favor of a single inline-flex wrapper with a uniform gap. Fixes the wonky- looking sparkle icon on the Generate button. - Add generateLabel + skipOverwriteWarning props to SystemMessageStep. - The new SystemMessageReview panel now shows "Regenerate" and skips the overwrite-confirmation dialog (regenerating is the expected next step of that flow). - Trim the overwrite warning copy to "Generating a new message will overwrite your current text." since the Cancel / Overwrite and Generate buttons make the rest self-explanatory.
The review panel's "Save Translation Instructions" label was long enough to wrap inside the fixed-min-width button, producing a visually broken multi-line label. Shorten the review label to "Save" and add white-space: nowrap to the button content wrappers so future labels can't wrap either.
In the language-change review flow the expectation is that the user *changes* their translation instructions, so Regenerate should be the primary call-to-action and Save should be demoted. Once the user has either regenerated or edited the text manually, swap them so Save is the highlighted next step. Behavior is gated behind a new emphasizeGenerateUntilEdited prop so the existing project-creation flow (where Save is always primary) is unaffected.
In the Copilot Settings system-message editor: - The Regenerate button keeps its layout but swaps the sparkle icon for a spinning loader while a generation is in flight, and disables itself to prevent re-entry. - The textarea, the empty-state Generate button, and the "Save All Settings" button are also disabled during generation so the user can't edit or save half-state. Cancel stays available as an escape. - The provider now posts generateError when generation throws, so the webview can recover its UI state instead of staying stuck on the spinner.
Contributor
Author
|
We still could go back and make sure all the "Regenerate" buttons have the same rounding. |
…et-language-is-changed
LeviXIII
reviewed
Jun 24, 2026
Contributor
There was a problem hiding this comment.
- Pressing Enter in the language selection field when the full word isn't typed out will cause the warning message to display [your source language] instead of the selected language.
- "I don't need to change this" -> "Cancel". Also change toast to modal directing user to Co-pilot settings to change system message if they still need to
- "Target" language doesn't change when selecting a new language
- Clicking "x" in the change system message webview automatically changes the system message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I made this so that the user is asked to regenerate (or edit) their system prompt if they change the source or target language (see issue). Made it so that it does not give a warning against changing it, since in this case the user almost certainly does need to change this. Also made sure that the other use cases of system prompt editing have not broken, and changed the button colors to match throughout.
Test Checklist
Changing the TARGET language (from Project Manager)
Changing the SOURCE language (from Project Manager)
Picking the SAME language again (no change)
The buttons inside the review window
The "I don't need to change this" button
Closing the window with the X (without using any button)
Changing both languages back-to-back (no duplicate windows)
Changing language from the Startup / New Project flow
Copilot Settings — Generate button polish
Edge cases / safety checks