mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
feat: update sidebar toggle actions and badge behavior for session state changes
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -23,7 +23,6 @@ const sidebarToggleIcon = registerIcon('agent-sidebar-toggle', Codicon.tasklist,
|
||||
class ToggleSidebarVisibilityAction extends Action2 {
|
||||
|
||||
static readonly ID = 'workbench.action.agentToggleSidebarVisibility';
|
||||
static readonly LABEL = localize('compositePart.hideSideBarLabel', "Hide Primary Side Bar");
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
@@ -76,7 +75,6 @@ class ToggleSidebarVisibilityAction extends Action2 {
|
||||
class ToggleSecondarySidebarVisibilityAction extends Action2 {
|
||||
|
||||
static readonly ID = 'workbench.action.agentToggleSecondarySidebarVisibility';
|
||||
static readonly LABEL = localize('compositePart.hideSecondarySideBarLabel', "Hide Secondary Side Bar");
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
|
||||
@@ -87,11 +87,11 @@
|
||||
}
|
||||
|
||||
/* Sidebar toggle unread badge */
|
||||
.action-item.sidebar-toggle-action {
|
||||
.agent-sessions-workbench .action-item.sidebar-toggle-action {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.action-item.sidebar-toggle-action .sidebar-toggle-badge {
|
||||
.agent-sessions-workbench .action-item.sidebar-toggle-action .sidebar-toggle-badge {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -4px;
|
||||
|
||||
@@ -306,7 +306,18 @@ class SidebarToggleActionViewItem extends ActionViewItem {
|
||||
this._countBadge = append(container, $('span.sidebar-toggle-badge'));
|
||||
this._updateBadge();
|
||||
|
||||
// Update badge when sessions change
|
||||
// Subscribe to observable session state (status, isRead, isArchived)
|
||||
// so the badge updates when any session's state changes
|
||||
this._register(autorun(reader => {
|
||||
for (const session of this.sessionsManagementService.getSessions()) {
|
||||
session.isArchived.read(reader);
|
||||
session.status.read(reader);
|
||||
session.isRead.read(reader);
|
||||
}
|
||||
this._updateBadge();
|
||||
}));
|
||||
|
||||
// Also update when sessions are added/removed
|
||||
this._register(this.sessionsManagementService.onDidChangeSessions(() => this._updateBadge()));
|
||||
|
||||
// Update badge when sidebar visibility changes
|
||||
|
||||
Reference in New Issue
Block a user