mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
sessions - always prefer session label (#298926)
* sessions - always prefer session label * Update src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -233,20 +233,19 @@ export class SessionsTitleBarWidget extends BaseActionViewItem {
|
||||
|
||||
/**
|
||||
* Get the label of the active chat session.
|
||||
* Prefers the live model title over the snapshot label from the active session service.
|
||||
* Falls back to a generic label if no active session is found.
|
||||
*/
|
||||
private _getActiveSessionLabel(): string {
|
||||
const activeSession = this.activeSessionService.getActiveSession();
|
||||
if (activeSession?.resource) {
|
||||
const model = this.chatService.getSession(activeSession.resource);
|
||||
if (model?.title) {
|
||||
return model.title;
|
||||
}
|
||||
const label = activeSession?.label;
|
||||
if (label) {
|
||||
return label; // prefer session label to support renamed sessions
|
||||
}
|
||||
|
||||
if (activeSession?.label) {
|
||||
return activeSession.label;
|
||||
if (activeSession) {
|
||||
const activeModel = this.chatService.getSession(activeSession.resource);
|
||||
if (activeModel?.title) {
|
||||
return activeModel.title; // fall back to chat model title if available
|
||||
}
|
||||
}
|
||||
|
||||
return localize('agentSessions.newSession', "New Session");
|
||||
|
||||
Reference in New Issue
Block a user