Draft
Conversation
Contributor
Screenshot ChangesBase: Changed (6)Errored (18)Fixtures that failed to render — no screenshot was produced.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes the chat plan-review widget to edit plan files inline inside the chat response instead of opening the plan in a separate editor. It updates the widget implementation, adds styling for the embedded editor state, and documents the dismiss() behavior on the backing data object.
Changes:
- Replaces the plan-review markdown body with an embedded Monaco editor while feedback mode is active.
- Wires the inline editor to an in-memory model and writes its contents back to the backing plan file on submit/back.
- Adds CSS for the editor-hosting layout and expands comments around plan-review lifecycle behavior.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatPlanReviewData.ts |
Adds API documentation for dismissing a plan review. |
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css |
Styles the plan-review body when it hosts the embedded editor. |
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.ts |
Implements the inline plan editor, comment URI switching, write-back flow, and related widget behavior changes. |
Copilot's findings
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.ts:920
- This creates a second
PlanReviewFeedbackServiceregistration for the scratch URI, but that registration is simply disposed on unmount. Because disposing a registration also drops its stored feedback items, any comments the user adds while the inline editor is open are lost as soon as they click Back or leave/re-enter review mode.
const editingRegistration = this._planReviewFeedbackService.registerPlanReview(editingUri, () => {
// `submitAllFeedback` from the editor side: route through the
// widget's normal submit path so the textarea & comments are
// included.
void this.submitFeedback();
});
this._messageEditorDisposables.add(editingRegistration);
this._messageEditorDisposables.add(toDisposable(() => {
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.ts:993
- If writing the edited buffer back to
planUrifails, we still continue as though the save succeeded. On submit that means the agent will receive feedback against the old on-disk plan, and on Back the user loses their edits with no indication that persistence failed.
if (text !== undefined && planUri) {
try {
await this._textFileService.write(planUri, text);
} catch {
// Swallow: we never want feedback submission to fail
// because the disk write hiccupped.
}
- Files reviewed: 3/3 changed files
- Comments generated: 8
Comment on lines
+733
to
738
| // The plan file used to be opened in a side editor here. Now that | ||
| // the widget hosts an embedded editor, no external open is needed | ||
| // — `enterFeedbackMode` mounts the editor inline. | ||
| if (!this.review.canProvideFeedback || this._isSubmitted) { | ||
| return; | ||
| } |
Comment on lines
+449
to
+453
| private getCommentUri(): URI | undefined { | ||
| if (this._editingUri) { | ||
| return this._editingUri; | ||
| } | ||
| return this._planReviewFeedbackService.getFeedback(URI.revive(this.review.planUri)); | ||
| return this.review.planUri ? URI.revive(this.review.planUri) : undefined; |
Comment on lines
+929
to
+949
| const editorOptions: IEditorOptions = { | ||
| wordWrap: 'on', | ||
| lineNumbers: 'on', | ||
| lineNumbersMinChars: 2, | ||
| glyphMargin: true, | ||
| folding: false, | ||
| minimap: { enabled: false }, | ||
| scrollBeyondLastLine: false, | ||
| overviewRulerLanes: 0, | ||
| overviewRulerBorder: false, | ||
| hideCursorInOverviewRuler: true, | ||
| lineDecorationsWidth: 6, | ||
| renderLineHighlight: 'none', | ||
| lightbulb: { enabled: ShowLightbulbIconMode.Off }, | ||
| padding: { top: 0, bottom: 0 }, | ||
| scrollbar: { | ||
| vertical: 'auto', | ||
| horizontal: 'auto', | ||
| alwaysConsumeMouseWheel: false, | ||
| }, | ||
| }; |
Comment on lines
+811
to
+814
| // Restore the rendered markdown body — any pending edits are | ||
| // already saved to disk via the auto-save scheduler. | ||
| this.unmountInlineEditor(); | ||
| this.renderMarkdown(); |
|
|
||
| if (text !== undefined && planUri) { | ||
| try { | ||
| await this._textFileService.write(planUri, text); |
Comment on lines
+788
to
+791
| // Swap the markdown body for an editable editor so the user can | ||
| // modify the plan in place. Comments still attach via the editor | ||
| // contribution since it's keyed on the model URI. | ||
| void this.mountInlineEditor(); |
Comment on lines
+858
to
+861
| } catch { | ||
| // File may not exist or be readable; fall through with empty | ||
| // buffer rather than failing the whole feedback flow. | ||
| initialContent = ''; |
Comment on lines
+847
to
+849
| private async mountInlineEditor(): Promise<void> { | ||
| if (this._messageEditor || !this.review.planUri || this._isSubmitted) { | ||
| return; |
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.
No description provided.