Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1087,11 +1087,6 @@
white-space: nowrap;
}

.session-section-count-badge {
flex-shrink: 0;
margin-left: var(--vscode-spacing-size40);
}

.session-section-migration-indicator {
display: none;
flex-shrink: 0;
Expand Down
37 changes: 9 additions & 28 deletions src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ import { IInstantiationService } from '../../../../../platform/instantiation/com
import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js';
import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js';
import { WorkbenchObjectTree } from '../../../../../platform/list/browser/listService.js';
import { IStyleOverride, defaultButtonStyles, defaultFindWidgetStyles, defaultInputBoxStyles, defaultKeybindingLabelStyles, defaultToggleStyles, getCountBadgeStyle } from '../../../../../platform/theme/browser/defaultStyles.js';
import { buttonSecondaryBorder, buttonSecondaryForeground, buttonSecondaryHoverBackground } from '../../../../../platform/theme/common/colorRegistry.js';
import { IStyleOverride, defaultButtonStyles, defaultFindWidgetStyles, defaultInputBoxStyles, defaultKeybindingLabelStyles, defaultToggleStyles } from '../../../../../platform/theme/browser/defaultStyles.js';
import { chartsOrange } from '../../../../../platform/theme/common/colors/chartsColors.js';
import { asCssVariable } from '../../../../../platform/theme/common/colorUtils.js';
import { IStorageService, StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js';
Expand All @@ -63,7 +62,6 @@ import { AgentSessionApprovalModel, agentSessionApprovalId, IAgentSessionApprova
import { IVoicePlaybackService } from '../../../../../workbench/contrib/chat/common/voicePlaybackService.js';
import { Button } from '../../../../../base/browser/ui/button/button.js';
import { status } from '../../../../../base/browser/ui/aria/aria.js';
import { CountBadge } from '../../../../../base/browser/ui/countBadge/countBadge.js';
import { IMarkdownRendererService } from '../../../../../platform/markdown/browser/markdownRenderer.js';
import { Action, ActionRunner, IAction, Separator, SubmenuAction, toAction } from '../../../../../base/common/actions.js';
import { IHoverService } from '../../../../../platform/hover/browser/hover.js';
Expand Down Expand Up @@ -2145,8 +2143,6 @@ interface ISessionSectionTemplate extends ISessionHeaderTemplate {
readonly migrationIndicator: HTMLElement;
readonly count: HTMLElement;
readonly countLabel: HTMLElement;
readonly countBadgeContainer: HTMLElement;
readonly countBadge: CountBadge;
readonly newBadge: HTMLElement;
readonly keybindingHint: HTMLElement;
readonly keybindingLabel: KeybindingLabel;
Expand Down Expand Up @@ -2211,7 +2207,6 @@ export class SessionSectionRenderer implements ITreeRenderer<SessionListItem, Fu
private readonly keybindingService: IKeybindingService,
private readonly newSessionActive: IObservable<boolean>,
private readonly customizationsActive: IObservable<boolean> = constObservable(false),
private readonly customizationsCount: IObservable<number> = constObservable(0),
private readonly customizationMigrationsAvailable: IObservable<boolean> = constObservable(false),
readonly templateId = SessionSectionRenderer.TEMPLATE_ID,
readonly rowClassName?: string,
Expand All @@ -2233,12 +2228,6 @@ export class SessionSectionRenderer implements ITreeRenderer<SessionListItem, Fu
icon.setAttribute('aria-hidden', 'true');
const labelContainer = DOM.append(container, $('span.session-section-label-container'));
const label = DOM.append(labelContainer, $('span.session-section-label'));
const countBadgeContainer = DOM.append(labelContainer, $('span.session-section-count-badge'));
const countBadge = disposables.add(new CountBadge(countBadgeContainer, {}, getCountBadgeStyle({
badgeBackground: buttonSecondaryHoverBackground,
badgeForeground: buttonSecondaryForeground,
badgeBorder: buttonSecondaryBorder,
})));
const migrationIndicator = DOM.append(labelContainer, $('span.session-section-migration-indicator'));
migrationIndicator.setAttribute('aria-hidden', 'true');
const count = DOM.append(container, $('span.session-section-count'));
Expand Down Expand Up @@ -2303,7 +2292,7 @@ export class SessionSectionRenderer implements ITreeRenderer<SessionListItem, Fu
},
}));

return { container, icon, collapsed: observableValue(this, false), label, migrationIndicator, count, countLabel, countBadgeContainer, countBadge, newBadge, keybindingHint, keybindingLabel, toolbarContainer, toolbar, chevron, contextKeyService, elementDisposables, disposables };
return { container, icon, collapsed: observableValue(this, false), label, migrationIndicator, count, countLabel, newBadge, keybindingHint, keybindingLabel, toolbarContainer, toolbar, chevron, contextKeyService, elementDisposables, disposables };
}

renderElement(node: ITreeNode<SessionListItem, FuzzyScore>, _index: number, template: ISessionSectionTemplate): void {
Expand Down Expand Up @@ -2367,10 +2356,6 @@ export class SessionSectionRenderer implements ITreeRenderer<SessionListItem, Fu
}
}));
template.elementDisposables.add(autorun(reader => {
template.countBadge.setCount(this.customizationsCount.read(reader));
template.countLabel.style.display = 'none';
template.countBadgeContainer.style.display = '';
template.count.style.display = 'none';
template.migrationIndicator.classList.toggle('visible', this.customizationMigrationsAvailable.read(reader));
}));
}
Expand Down Expand Up @@ -2415,16 +2400,13 @@ export class SessionSectionRenderer implements ITreeRenderer<SessionListItem, Fu
}

template.label.textContent = element.label;
if (element.id !== CUSTOMIZATIONS_SECTION_ID) {
template.countBadgeContainer.style.display = 'none';
template.countLabel.style.display = '';
if (this.hideSectionCount || shortcut) {
template.countLabel.textContent = '';
template.count.style.display = 'none';
} else {
template.countLabel.textContent = String(element.sessions.length);
template.count.style.display = '';
}
template.countLabel.style.display = '';
if (this.hideSectionCount || shortcut) {
template.countLabel.textContent = '';
template.count.style.display = 'none';
} else {
template.countLabel.textContent = String(element.sessions.length);
template.count.style.display = '';
}

// Set context key for section type so toolbar actions can use when clauses
Expand Down Expand Up @@ -3873,7 +3855,6 @@ export class SessionsList extends Disposable implements ISessionsList {
this.keybindingService,
newSessionActive,
customizationsActive,
customizationsCount,
customizationMigrationsAvailable,
templateId,
rowClassName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,14 +774,14 @@ export default defineThemedFixtureGroup({ path: 'sessions/' }, {
}, {
labels: { kind: 'screenshot' },
additionalThemes: ['darkHighContrast'],
expectedVisualDescriptions: ['New, Automations, and Customizations appear as three full-width navigation rows at the start of the scrollable Sessions tree. New is the leading row with a plus icon and the platform New Session keybinding aligned on the right. As content scrolls, New remains sticky at the top and the Sessions header joins it when the session list reaches the viewport, without a duplicate New button. Automations has a compact right-aligned NEW capsule, and Customizations shows its count of 8 beside the label in a compact badge with the visible neutral secondary-button fill.'],
expectedVisualDescriptions: ['New, Automations, and Customizations appear as three full-width navigation rows at the start of the scrollable Sessions tree. New is the leading row with a plus icon and the platform New Session keybinding aligned on the right. As content scrolls, New remains sticky at the top and the Sessions header joins it when the session list reaches the viewport, without a duplicate New button. Automations has a compact right-aligned NEW capsule, and Customizations has no total-count badge.'],
}),
SessionsList_CustomizationsMigrationsAvailable: defineSessionsListFixture({
sessions: [{ id: 'migrations', title: 'Move instructions into the new format', workspace: 'vscode', minutesAgo: 5 }],
header: { navigationShortcuts: true, customizationsCount: 8, customizationMigrationsAvailable: true },
}, {
labels: { kind: 'screenshot' },
expectedVisualDescriptions: ['The Customizations navigation row shows the count of 8 beside its label in a compact badge with the visible neutral secondary-button fill, followed by a small warning dot.'],
expectedVisualDescriptions: ['The Customizations navigation row has no total-count badge and shows a small warning dot beside its label.'],
}),
SessionsList_LightweightNewButton: defineSessionsListFixture({
sessions: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,8 @@ suite('Sessions - SessionsList', () => {
.find(element => element.querySelector('.session-section-label')?.textContent === 'Customizations');
const customizationsLabel = customizationsSection?.querySelector('.session-section-label');
const migrationIndicator = customizationsSection?.querySelector('.session-section-migration-indicator');
const countBadge = customizationsSection?.querySelector('.session-section-count-badge .monaco-count-badge');
const customizationsPresentation = {
countBadge: countBadge?.textContent,
countBadgeNextToLabel: countBadge?.parentElement?.previousElementSibling === customizationsLabel,
hasTotalCountBadge: customizationsSection?.querySelector('.monaco-count-badge') !== null,
migrationIndicatorVisible: migrationIndicator?.classList.contains('visible'),
migrationIndicatorOutsideLabel: !!migrationIndicator && !customizationsLabel?.contains(migrationIndicator),
hasExtensionsIcon: customizationsSection?.querySelector('.session-section-icon')?.classList.contains('codicon-extensions'),
Expand Down Expand Up @@ -581,8 +579,7 @@ suite('Sessions - SessionsList', () => {
],
headerInTreatment: true,
customizationsPresentation: {
countBadge: '7',
countBadgeNextToLabel: true,
hasTotalCountBadge: false,
migrationIndicatorVisible: true,
migrationIndicatorOutsideLabel: true,
hasExtensionsIcon: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export interface ISessionsListFixtureHeader {
readonly automationRunStatus?: IAutomationRun['status'];
/** Shows New, Automations, and Customizations as navigation rows above the Sessions header. */
readonly navigationShortcuts?: boolean;
/** Count shown on the Customizations navigation row. */
/** Customization count exposed in the navigation row's accessibility label. */
readonly customizationsCount?: number;
/** Shows the Customizations navigation row's migrations-available indicator. */
readonly customizationMigrationsAvailable?: boolean;
Expand Down
Loading