Skip to content

chat: open plan reviews in the editor#327416

Draft
justschen wants to merge 11 commits into
mainfrom
agents/edit-plan-mode-widget-functionality
Draft

chat: open plan reviews in the editor#327416
justschen wants to merge 11 commits into
mainfrom
agents/edit-plan-mode-widget-functionality

Conversation

@justschen

@justschen justschen commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator
  • Moves plan editing into the rendered Markdown editor in both VS Code and the Agents window.
  • Keeps inline comments and overall feedback synchronized with the chat plan widget, including while the Markdown editor is in Editing mode.
  • Adds a compact plan-review toolbar beside the Locked/Editing control with overall feedback, submit, reject, and implementation actions.
  • Uses a themed split button with a keyboard-accessible custom action menu matching the normal plan widget instead of a native picker.
  • Prevents duplicate concurrent submissions and preserves selected comment ranges across editor surfaces.
  • Adds focused regression coverage for editor opening, Markdown comments, feedback preservation, provider fallback, and submission races.

(Commit message generated by Copilot)

Screen.Recording.2026-07-24.at.6.57.18.PM.mov

- Moves plan editing into a full editor so plans can be reviewed as normal files in both VS Code and the Agents window.
- Keeps line comments and overall feedback synchronized with the chat plan widget, making review state visible from either surface.
- Adds editor actions for submitting feedback, approving plans, and rejecting plans while preventing duplicate concurrent submissions.
- Adds focused regression coverage for editor opening, feedback preservation, comment counts, and submission races.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 24, 2026 22:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Moves plan reviews into full editor tabs and synchronizes review actions with chat.

Changes:

  • Replaces the inline editor and removes its setting.
  • Adds editor-based feedback, approval, and rejection actions.
  • Adds styling, accessibility guidance, and regression tests.
Show a summary per file
File Description
chatPlanReviewPart.test.ts Tests editor opening, synchronization, and submission races.
planReviewFeedbackService.test.ts Tests delegated review actions.
constants.ts Removes the inline-editor setting key.
chatPlanReview.css Removes embedded-editor styles.
chatPlanReviewPart.ts Opens plans in editors and coordinates submissions.
planReviewFeedbackService.ts Exposes registered review actions and callbacks.
planReviewFeedbackEditorContribution.ts Adds editor review controls and announcements.
planReviewFeedback.css Styles the expanded editor toolbar.
chat.shared.contribution.ts Removes inline-editor configuration registration.
chatAccessibilityHelp.ts Documents editor-based plan review.

Review details

  • Files reviewed: 10/10 changed files
  • Comments generated: 3
  • Review effort level: Medium

return true;
}
const planUri = URI.revive(this.review.planUri);
return !this._textFileService.isDirty(planUri) || !!await this._textFileService.save(planUri);
Comment on lines +834 to +836
const textareaFeedback = this._feedbackTextarea?.value.trim();

this._messageEditorDisposables.clear();
this._messageContentDisposables.clear();
dom.clearNode(this._messageEl);
this._messageEl.classList.add('chat-plan-review-body-editor');

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 },
automaticLayout: true,
scrollbar: {
vertical: 'auto',
horizontal: 'auto',
alwaysConsumeMouseWheel: false,
},
};
const editorFeedbackItems = [...this.getInlineFeedbackItems()];
Comment on lines +667 to +668
const bearings = this._planReviewFeedbackService.getNavigationBearing(model.uri);
this._showOverlayToolbar(model.uri, bearings);
justschen and others added 2 commits July 24, 2026 16:27
- Connects active plan reviews to the shared custom-editor comment bridge so the rendered Markdown editor exposes its existing selection comment affordance.
- Preserves full selected ranges when comments move between the Markdown editor, plan widget, and source editor.
- Supports multiple comment providers so plan reviews can temporarily take precedence without breaking session feedback for other files.
- Adds focused coverage for Markdown range forwarding and provider fallback.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
justschen and others added 8 commits July 24, 2026 18:03
- Uses the rendered Markdown editor for plan review in both VS Code windows so the editing and commenting experience stays consistent.
- Keeps inline commenting available while the Markdown editor is editable instead of limiting comments to locked mode.
- Adds a compact plan review toolbar beside the lock control with overall feedback, submit, reject, and implementation actions.
- Uses a themed split button and keyboard-accessible custom action menu instead of duplicating the selected action in a native picker.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Keeps the plan toolbar on fixed layout tracks so typing overall feedback or adding inline comments does not shift the controls or document content.
- Preserves the split-button footprint while feedback is pending and truncates long action labels within the stable primary action width.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Returns the plan review toolbar to a stable bottom-left position so it does not compete with the document heading or lock control.
- Keeps the overall feedback field at a fixed width while allowing the primary action to grow to the right based on its label.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Removes the dropdown segment entirely while feedback is pending instead of reserving empty split-button space.
- Aligns toolbar padding, gaps, and control heights to a consistent compact rhythm.
- Opens implementation choices above the bottom toolbar so the menu remains visible near the viewport edge.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Lets the feedback field yield space before truncating the selected plan action.
- Uses container-width observations to switch between comfortable, compact, and narrow toolbar layouts.
- Stacks feedback above the actions in very narrow editors while preserving consistent viewport insets.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Removes the compact layout's forced full-width sizing so the toolbar hugs its controls without dead space.
- Keeps full-width behavior only for the narrow stacked layout where it is needed.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Treats the stacked narrow toolbar as an outer container instead of a pill.
- Uses control-tier radii for the feedback input, split action, and reject button so the compact state reads as one structured surface.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Gives overall feedback a wider default and compact layout track so longer comments remain visible while typing.
- Retains flex shrinking for constrained editors and the full-width field in the narrow stacked layout.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.ts:839

  • The inline comments are snapshotted before the awaited save, while the plan registration and comment UI remain active. A comment added during a slow save is omitted from the submitted payload and then lost when markUsed clears the registration; a deletion during the save is still submitted. Disable feedback mutations while submitting or take/revalidate the snapshot after the save completes.
		const editorFeedbackItems = [...this.getInlineFeedbackItems()];
  • Files reviewed: 17/18 changed files
  • Comments generated: 6
  • Review effort level: Medium

if (!review) {
return;
}
const hasFeedback = review.feedbackCount > 0 || this.#overallFeedback.value.trim().length > 0;
const line = selection.startLineNumber;
const column = selection.startColumn;
this._planReviewFeedbackService.addFeedback(model.uri, line, column, text);
status(localize('planReviewFeedback.commentAdded', 'Plan feedback comment added on line {0}.', line));
Comment on lines +167 to +171
this.#selectedActionId = actionId;
this.#setMenuOpen(false);
this.#renderActionMenu();
this.#updatePrimaryAction();
this.#primaryAction.focus();
Comment on lines +149 to +157
if (event.key === 'Escape') {
event.preventDefault();
this.#setMenuOpen(false);
this.#actionToggle.focus();
} else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
event.preventDefault();
const delta = event.key === 'ArrowDown' ? 1 : -1;
items[(currentIndex + delta + items.length) % items.length]?.focus();
}
Comment on lines +428 to +429
override: MARKDOWN_EDITOR_ID,
selection: { startLineNumber: line, startColumn: column },
Comment on lines +186 to +191
} else if (message.type === 'submitFeedback') {
await commentsProvider.submitFeedback(message.overallFeedback);
} else if (message.type === 'submitAction') {
await commentsProvider.submitAction(message.actionId);
} else if (message.type === 'rejectReview') {
await commentsProvider.reject();
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