Skip to content

Commit 8aa9103

Browse files
authored
Adding history back to sessions view (microsoft#279412)
* Adding history back to sessions view * Deprecated * Review comment
1 parent cc49204 commit 8aa9103

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,14 @@ export class LocalAgentsSessionsProvider extends Disposable implements IChatSess
146146
private async getHistoryItems(): Promise<ChatSessionItemWithProvider[]> {
147147
try {
148148
const historyItems = await this.chatService.getHistorySessionItems();
149-
return coalesce(historyItems.map(history => this.toChatSessionItem(history)));
149+
return coalesce(historyItems.map(history => {
150+
const sessionItem = this.toChatSessionItem(history);
151+
return sessionItem ? {
152+
...sessionItem,
153+
//todo@bpasero comment
154+
history: true
155+
} : undefined;
156+
}));
150157
} catch (error) {
151158
return [];
152159
}

src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ export class SessionsDataSource implements IAsyncDataSource<IChatSessionItemProv
570570
this.archivedItems.clear();
571571
let ungroupedItems = items.map(item => {
572572
const itemWithProvider = { ...item, provider: this.provider, timing: { startTime: extractTimestamp(item) ?? 0 } };
573-
if (itemWithProvider.archived) {
573+
if (itemWithProvider.history) {
574574
this.archivedItems.pushItem(itemWithProvider);
575575
return;
576576
}

src/vs/workbench/contrib/chat/common/chatSessionsService.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ export interface IChatSessionItem {
7878
deletions: number;
7979
};
8080
archived?: boolean;
81+
// TODO:@osortega remove once the single-view is default
82+
/** @deprecated */
83+
history?: boolean;
8184
}
8285

8386
export type IChatSessionHistoryItem = {

0 commit comments

Comments
 (0)