Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,12 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
}

const modifiedEntries = derivedOpts<IModifiedFileEntry[]>({ equalsFn: arraysEqual }, r => {
// Background chat sessions render the working set based on the session files, and not the editing session
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The comment could be more precise. It currently says "Background chat sessions render the working set based on the session files" but the code actually prevents background sessions from rendering editing session entries at all (by returning an empty array). Consider revising to: "Background chat sessions should not show editing session entries; they only show session files".

Suggested change
// Background chat sessions render the working set based on the session files, and not the editing session
// Background chat sessions should not show editing session entries; they only show session files

Copilot uses AI. Check for mistakes.
const sessionResource = chatEditingSession?.chatSessionResource ?? this._widget?.viewModel?.model.sessionResource;
Comment on lines 2304 to +2306
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The session resource determination is duplicated across multiple places in this function (lines 2306, 2355, 2381, 2434). Consider extracting this into a local variable at the beginning of the function to improve maintainability and reduce redundancy.

Suggested change
const modifiedEntries = derivedOpts<IModifiedFileEntry[]>({ equalsFn: arraysEqual }, r => {
// Background chat sessions render the working set based on the session files, and not the editing session
const sessionResource = chatEditingSession?.chatSessionResource ?? this._widget?.viewModel?.model.sessionResource;
const sessionResource = chatEditingSession?.chatSessionResource ?? this._widget?.viewModel?.model.sessionResource;
const modifiedEntries = derivedOpts<IModifiedFileEntry[]>({ equalsFn: arraysEqual }, r => {
// Background chat sessions render the working set based on the session files, and not the editing session

Copilot uses AI. Check for mistakes.
if (sessionResource && getChatSessionType(sessionResource) !== localChatSessionType) {
return [];
}

return chatEditingSession?.entries.read(r).filter(entry => entry.state.read(r) === ModifiedFileEntryState.Modified) || [];
});

Expand Down
Loading