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 - add twistie for empty resource group and incoming/outgoing node #198427

Merged
merged 1 commit into from
Nov 16, 2023
Merged
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: 4 additions & 3 deletions src/vs/workbench/contrib/scm/browser/scmViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2995,13 +2995,13 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
} else if (isSCMActionButton(inputOrElement)) {
return false;
} else if (isSCMResourceGroup(inputOrElement)) {
return inputOrElement.resources.length > 0;
return true;
} else if (isSCMResource(inputOrElement)) {
return false;
} else if (ResourceTree.isResourceNode(inputOrElement)) {
return inputOrElement.childrenCount > 0;
} else if (isSCMHistoryItemGroupTreeElement(inputOrElement)) {
return (inputOrElement.count ?? 0) > 0;
return true;
} else if (isSCMHistoryItemTreeElement(inputOrElement)) {
return true;
} else if (isSCMHistoryItemChangeTreeElement(inputOrElement)) {
Expand Down Expand Up @@ -3042,6 +3042,7 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
}

// ResourceGroups
const showWheEmpty = resourceGroups.some(group => !group.hideWhenEmpty);
const hasSomeChanges = resourceGroups.some(group => group.resources.length > 0);
if (hasSomeChanges || (repositoryCount === 1 && (!showActionButton || !actionButton))) {
children.push(...resourceGroups);
Expand All @@ -3051,7 +3052,7 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
const historyItemGroups = await this.getHistoryItemGroups(inputOrElement);

// Incoming/Outgoing Separator
if (hasSomeChanges && historyItemGroups.length > 0) {
if (historyItemGroups.length > 0 && (hasSomeChanges || showWheEmpty)) {
children.push({
label: localize('syncSeparatorHeader', "Incoming/Outgoing"),
repository: inputOrElement,
Expand Down