mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
Sessions: Add session count display to agent session sections (#303514)
Add session count display to agent session sections Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
This commit is contained in:
@@ -573,6 +573,7 @@ export function toStatusLabel(status: AgentSessionStatus): string {
|
||||
interface IAgentSessionSectionTemplate {
|
||||
readonly container: HTMLElement;
|
||||
readonly label: HTMLSpanElement;
|
||||
readonly count: HTMLSpanElement;
|
||||
readonly toolbar: MenuWorkbenchToolBar;
|
||||
readonly contextKeyService: IContextKeyService;
|
||||
readonly disposables: IDisposable;
|
||||
@@ -596,6 +597,7 @@ export class AgentSessionSectionRenderer implements ICompressibleTreeRenderer<IA
|
||||
'div.agent-session-section@container',
|
||||
[
|
||||
h('span.agent-session-section-label@label'),
|
||||
h('span.agent-session-section-count@count'),
|
||||
h('div.agent-session-section-toolbar@toolbar')
|
||||
]
|
||||
);
|
||||
@@ -611,6 +613,7 @@ export class AgentSessionSectionRenderer implements ICompressibleTreeRenderer<IA
|
||||
return {
|
||||
container: elements.container,
|
||||
label: elements.label,
|
||||
count: elements.count,
|
||||
toolbar,
|
||||
contextKeyService,
|
||||
disposables
|
||||
@@ -622,6 +625,9 @@ export class AgentSessionSectionRenderer implements ICompressibleTreeRenderer<IA
|
||||
// Label
|
||||
template.label.textContent = element.element.label;
|
||||
|
||||
// Count
|
||||
template.count.textContent = String(element.element.sessions.length);
|
||||
|
||||
// Toolbar
|
||||
ChatContextKeys.agentSessionSection.bindTo(template.contextKeyService).set(element.element.section);
|
||||
template.toolbar.context = element.element;
|
||||
@@ -691,7 +697,7 @@ export class AgentSessionsAccessibilityProvider implements IListAccessibilityPro
|
||||
|
||||
getAriaLabel(element: AgentSessionListItem): string | null {
|
||||
if (isAgentSessionSection(element)) {
|
||||
return localize('agentSessionSectionAriaLabel', "{0} sessions section", element.label);
|
||||
return localize('agentSessionSectionAriaLabel', "{0} sessions section, {1} sessions", element.label, element.sessions.length);
|
||||
}
|
||||
|
||||
return localize('agentSessionItemAriaLabel', "{0} session {1} ({2}), created {3}", element.providerLabel, element.label, toStatusLabel(element.status), new Date(element.timing.created).toLocaleString());
|
||||
|
||||
@@ -318,6 +318,11 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.agent-session-section-count {
|
||||
opacity: 0.7;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.agent-session-section-toolbar {
|
||||
/* for the absolute positioning of the toolbar below */
|
||||
position: relative;
|
||||
@@ -332,6 +337,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.monaco-list-row:hover .agent-session-section .agent-session-section-count,
|
||||
.monaco-list-row.focused:not(.selected) .agent-session-section .agent-session-section-count {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.monaco-list-row:hover .agent-session-section .agent-session-section-toolbar,
|
||||
.monaco-list-row.focused:not(.selected) .agent-session-section .agent-session-section-toolbar {
|
||||
width: 22px;
|
||||
|
||||
Reference in New Issue
Block a user