mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 15:24:40 +01:00
sessions - fix layer breakers (#305693)
This commit is contained in:
@@ -2099,7 +2099,6 @@ export default tseslint.config(
|
||||
'vs/editor/contrib/*/~',
|
||||
'vs/workbench/~',
|
||||
'vs/workbench/browser/**',
|
||||
'vs/workbench/contrib/**',
|
||||
'vs/workbench/services/*/~',
|
||||
'vs/sessions/~',
|
||||
'vs/sessions/services/*/~'
|
||||
|
||||
@@ -42,8 +42,6 @@ import { hasNativeTitlebar, getTitleBarStyle } from '../../../platform/window/co
|
||||
import { ThemeIcon } from '../../../base/common/themables.js';
|
||||
import { Codicon } from '../../../base/common/codicons.js';
|
||||
import { DisposableStore } from '../../../base/common/lifecycle.js';
|
||||
import { IAgentSessionsService } from '../../../workbench/contrib/chat/browser/agentSessions/agentSessionsService.js';
|
||||
import { countUnreadSessions } from '../../../workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js';
|
||||
import { localize } from '../../../nls.js';
|
||||
|
||||
/**
|
||||
@@ -201,7 +199,6 @@ export class SidebarPart extends AbstractPaneCompositePart {
|
||||
widget.tabIndex = 0;
|
||||
widget.setAttribute('aria-label', localize('hideSidebar', "Hide Side Bar"));
|
||||
append(widget, $(ThemeIcon.asCSSSelector(Codicon.tasklist)));
|
||||
const badge = append(widget, $('span.session-status-toggle-badge'));
|
||||
|
||||
// Toggle sidebar on click
|
||||
widgetDisposables.add(addDisposableListener(widget, EventType.CLICK, (e) => {
|
||||
@@ -209,27 +206,6 @@ export class SidebarPart extends AbstractPaneCompositePart {
|
||||
e.stopPropagation();
|
||||
this.layoutService.setPartHidden(true, Parts.SIDEBAR_PART);
|
||||
}));
|
||||
|
||||
// Update badge on session changes (deferred to avoid service unavailability)
|
||||
const updateBadge = (svc: IAgentSessionsService) => {
|
||||
const unread = countUnreadSessions(svc.model.sessions);
|
||||
badge.textContent = unread > 0 ? `${unread}` : '';
|
||||
badge.style.display = unread > 0 ? '' : 'none';
|
||||
widget.setAttribute('aria-label', unread > 0
|
||||
? localize('hideSidebarUnread', "Hide Side Bar, {0} unread session(s)", unread)
|
||||
: localize('hideSidebar', "Hide Side Bar"));
|
||||
};
|
||||
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const svc = this.instantiationService.invokeFunction(accessor => accessor.get(IAgentSessionsService));
|
||||
updateBadge(svc);
|
||||
widgetDisposables.add(svc.model.onDidChangeSessions(() => updateBadge(svc)));
|
||||
} catch {
|
||||
// Service not yet available
|
||||
badge.style.display = 'none';
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
private createFooter(parent: HTMLElement): void {
|
||||
|
||||
Reference in New Issue
Block a user