Skip to content

Conversation

@lszomoru
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings January 16, 2026 13:58
@lszomoru lszomoru enabled auto-merge (squash) January 16, 2026 13:58
@lszomoru lszomoru self-assigned this Jan 16, 2026
@lszomoru lszomoru added this to the January 2026 milestone Jan 16, 2026
@lszomoru lszomoru added the chat-background-agent Background Agent related features/bugs label Jan 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the chat working set rendering code to simplify parameter passing and improve code maintainability by consolidating data transformations upstream.

Changes:

  • Removed unused IChatSessionFileChange import
  • Simplified renderChatEditingSessionWithEntries method signature by removing intermediate observables and relying on pre-transformed IChatCollapsibleListItem observables
  • Refactored statistics calculation to use unified IChatCollapsibleListItem structure instead of raw data sources, improving consistency and reducing duplication

Comment on lines +2446 to +2458
if (entries.length > 0) {
for (const entry of entries) {
if (entry.kind === 'reference' && entry.options?.diffMeta) {
added += entry.options.diffMeta.added;
removed += entry.options.diffMeta.removed;
}
}
} else {
for (const entry of sessionEntries) {
if (entry.kind === 'reference' && entry.options?.diffMeta) {
added += entry.options.diffMeta.added;
removed += entry.options.diffMeta.removed;
}
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 diff stats calculation logic is duplicated between the two branches. The code should accumulate stats from both entries and sessionEntries arrays instead of using an if-else. Based on line 2588 where both arrays are combined, both arrays can contain relevant data simultaneously. Change the logic to iterate over both arrays unconditionally to avoid missing diff stats when both arrays have data.

Suggested change
if (entries.length > 0) {
for (const entry of entries) {
if (entry.kind === 'reference' && entry.options?.diffMeta) {
added += entry.options.diffMeta.added;
removed += entry.options.diffMeta.removed;
}
}
} else {
for (const entry of sessionEntries) {
if (entry.kind === 'reference' && entry.options?.diffMeta) {
added += entry.options.diffMeta.added;
removed += entry.options.diffMeta.removed;
}
for (const entry of entries) {
if (entry.kind === 'reference' && entry.options?.diffMeta) {
added += entry.options.diffMeta.added;
removed += entry.options.diffMeta.removed;
}
}
for (const entry of sessionEntries) {
if (entry.kind === 'reference' && entry.options?.diffMeta) {
added += entry.options.diffMeta.added;
removed += entry.options.diffMeta.removed;

Copilot uses AI. Check for mistakes.
@lszomoru lszomoru merged commit c1d712e into main Jan 16, 2026
27 of 28 checks passed
@lszomoru lszomoru deleted the lszomoru/constant-minnow branch January 16, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chat-background-agent Background Agent related features/bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants