Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCM - Incoming/Outgoing accessibility improvements #199443

Merged
merged 1 commit into from
Nov 28, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/vs/workbench/contrib/scm/browser/scmViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ class HistoryItemGroupRenderer implements ICompressibleTreeRenderer<SCMHistoryIt
templateData.iconContainer.classList.add(...ThemeIcon.asClassNameArray(historyItemGroup.icon));
}

templateData.label.setLabel(historyItemGroup.label, historyItemGroup.description);
templateData.label.setLabel(historyItemGroup.label, historyItemGroup.description, { title: historyItemGroup.ariaLabel });
templateData.count.setCount(historyItemGroup.count ?? 0);
}

Expand Down Expand Up @@ -1001,7 +1001,7 @@ class SeparatorRenderer implements ICompressibleTreeRenderer<SCMViewSeparatorEle
return { label, disposables: new DisposableStore() };
}
renderElement(element: ITreeNode<SCMViewSeparatorElement, void>, index: number, templateData: SeparatorTemplate, height: number | undefined): void {
templateData.label.setLabel(element.element.label);
templateData.label.setLabel(element.element.label, undefined, { title: element.element.ariaLabel });
}

renderCompressedElements(node: ITreeNode<ICompressedTreeNode<SCMViewSeparatorElement>, void>, index: number, templateData: SeparatorTemplate, height: number | undefined): void {
Expand Down Expand Up @@ -3274,6 +3274,7 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
if (historyItemGroups.length > 0) {
children.push({
label: localize('syncSeparatorHeader', "Incoming/Outgoing"),
ariaLabel: localize('syncSeparatorHeaderAriaLabel', "Incoming and outgoing changes"),
repository: inputOrElement,
type: 'separator'
} as SCMViewSeparatorElement);
Expand Down Expand Up @@ -3341,6 +3342,7 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
(this.showIncomingChanges() === 'auto' && (historyItemGroupDetails.incoming.count ?? 0) > 0))) {
children.push({
...historyItemGroupDetails.incoming,
ariaLabel: localize('incomingChangesAriaLabel', "Incoming changes from {0}", historyItemGroupDetails.incoming.label),
repository: element,
type: 'historyItemGroup'
});
Expand All @@ -3352,6 +3354,7 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
(this.showOutgoingChanges() === 'auto' && (historyItemGroupDetails.outgoing.count ?? 0) > 0))) {
children.push({
...historyItemGroupDetails.outgoing,
ariaLabel: localize('outgoingChangesAriaLabel', "Outgoing changes from {0}", historyItemGroupDetails.outgoing.label),
repository: element,
type: 'historyItemGroup'
});
Expand Down
2 changes: 2 additions & 0 deletions src/vs/workbench/contrib/scm/common/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export interface ISCMHistoryItemGroupEntry {
}

export interface SCMHistoryItemGroupTreeElement extends ISCMHistoryItemGroupEntry {
readonly ariaLabel?: string;
readonly repository: ISCMRepository;
readonly type: 'historyItemGroup';
}
Expand Down Expand Up @@ -107,6 +108,7 @@ export interface SCMHistoryItemChangeTreeElement extends ISCMHistoryItemChange {

export interface SCMViewSeparatorElement {
readonly label: string;
readonly ariaLabel?: string;
readonly repository: ISCMRepository;
readonly type: 'separator';
}