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 Incoming/Outgoing information into the Source Control view #197771

Merged
merged 32 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ba91a6a
Basic functionality is working. More work to do.
lszomoru Oct 18, 2023
adc1781
Saving my work. More cleanup to do.
lszomoru Oct 19, 2023
fd9d097
Saving my changes
lszomoru Oct 20, 2023
56b4d0a
Adopt the Sequencer
lszomoru Oct 20, 2023
7d5a69a
Merge branch 'main' into lszomoru/scm-view-async-data-tree
lszomoru Oct 20, 2023
046d44e
Honour always show repositories setting
lszomoru Oct 21, 2023
c1bed04
Revert changes related to alwaysShowRepositories
lszomoru Oct 24, 2023
3815c82
Ad a tactical check for the viewModel existence
lszomoru Oct 25, 2023
40083f4
Honour the scm.alwaysShowRepositories setting
lszomoru Nov 1, 2023
07e3752
Fix issues related to autoReveal
lszomoru Nov 1, 2023
03164cd
Refactor resource rendering and tree data source
lszomoru Nov 1, 2023
f3fdc85
Temporary fix for timing issues
lszomoru Nov 1, 2023
c1ced52
Merge branch 'main' into lszomoru/scm-view-async-data-tree
lszomoru Nov 2, 2023
8bd2a87
More refactoring
lszomoru Nov 2, 2023
b747b13
Move some of the context keys into RepositoryVisibilityActionController
lszomoru Nov 2, 2023
459d844
Remove the this._register calls
lszomoru Nov 2, 2023
f95ff13
AsyncDataTree.expandTo
joaomoreno Nov 3, 2023
8a99437
Fix expand all/collapse all buttons
lszomoru Nov 3, 2023
74e8a1a
Initial implementation of incoming/outgoing changes
lszomoru Nov 3, 2023
c621455
Merge branch 'lszomoru/scm-view-async-data-tree-2' into lszomoru/scm-…
lszomoru Nov 6, 2023
12f730e
Added separator
lszomoru Nov 6, 2023
608b38b
Fix some issues in sorting tree nodes
lszomoru Nov 7, 2023
4aa1dd1
Only show separator if there are incoming/outgoing history item groups
lszomoru Nov 7, 2023
63694cc
Remove sync view registration, add setting
lszomoru Nov 7, 2023
e52634a
Some more polish based on feedback
lszomoru Nov 8, 2023
fdd77eb
Add back view registration, setting, and localization
lszomoru Nov 8, 2023
46ba89e
Merge branch 'main' into lszomoru/scm-incoming-outgoing
lszomoru Nov 8, 2023
19e99fe
Merge branch 'main' into lszomoru/scm-incoming-outgoing
lszomoru Nov 8, 2023
1d22b2c
Code cleanup
lszomoru Nov 8, 2023
3eef0e2
Delete code that was commented out
lszomoru Nov 8, 2023
6351fc7
Move type definitions
lszomoru Nov 8, 2023
2583b16
Merge branch 'main' into lszomoru/scm-incoming-outgoing
lszomoru Nov 9, 2023
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
7 changes: 5 additions & 2 deletions extensions/git/src/historyProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { IDisposable } from './util';
import { toGitUri } from './uri';
import { SyncActionButton } from './actionButton';
import { RefType, Status } from './api/git';
import { emojify, ensureEmojis } from './emoji';

export class GitHistoryProvider implements SourceControlHistoryProvider, FileDecorationProvider, IDisposable {

Expand Down Expand Up @@ -83,6 +84,8 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
this.getSummaryHistoryItem(optionsRef, historyItemGroupIdRef)
]);

await ensureEmojis();

const historyItems = commits.length === 0 ? [] : [summary];
historyItems.push(...commits.map(commit => {
const newLineIndex = commit.message.indexOf('\n');
Expand All @@ -91,9 +94,9 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
return {
id: commit.hash,
parentIds: commit.parents,
label: subject,
label: emojify(subject),
description: commit.authorName,
icon: new ThemeIcon('account'),
icon: new ThemeIcon('git-commit'),
timestamp: commit.authorDate?.getTime()
};
}));
Expand Down
22 changes: 20 additions & 2 deletions src/vs/workbench/contrib/scm/browser/media/scm.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,36 @@
padding-right: 4px;
}

.scm-sync-view .monaco-list-row .history-item .monaco-icon-label .icon-container {
.scm-view .monaco-list-row .history-item .monaco-icon-label .icon-container {
display: flex;
font-size: 14px;
padding-right: 4px;
}

.scm-sync-view .monaco-list-row .history-item .monaco-icon-label .avatar {
.scm-view .monaco-list-row .history-item .monaco-icon-label .avatar {
width: 14px;
height: 14px;
border-radius: 14px;
}

.scm-view .monaco-list-row .separator-container {
display: flex;
align-items: center;
padding-left: 11px;
}

.scm-view .monaco-list-row .separator-container .label-name {
font-size: 10px;
}

.scm-view .monaco-list-row .separator-container .separator {
display: flex;
flex-grow: 1;
height: 0;
margin-left: 6px;
border-top: 1px solid var(--vscode-sideBar-border);
}

.scm-view .monaco-list-row .history > .name,
.scm-view .monaco-list-row .history-item-group > .name,
.scm-view .monaco-list-row .resource-group > .name {
Expand Down
23 changes: 21 additions & 2 deletions src/vs/workbench/contrib/scm/browser/scm.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import { Context as SuggestContext } from 'vs/editor/contrib/suggest/browser/sug
import { MANAGE_TRUST_COMMAND_ID, WorkspaceTrustContext } from 'vs/workbench/contrib/workspace/common/workspace';
import { IQuickDiffService } from 'vs/workbench/contrib/scm/common/quickDiff';
import { QuickDiffService } from 'vs/workbench/contrib/scm/common/quickDiffService';
import { SCMSyncViewPane } from 'vs/workbench/contrib/scm/browser/scmSyncViewPane';
import { getActiveElement } from 'vs/base/browser/dom';
import { SCMSyncViewPane } from 'vs/workbench/contrib/scm/browser/scmSyncViewPane';

ModesRegistry.registerLanguage({
id: 'scminput',
Expand Down Expand Up @@ -81,7 +81,7 @@ viewsRegistry.registerViews([{
ctorDescriptor: new SyncDescriptor(SCMViewPane),
canToggleVisibility: true,
canMoveView: true,
weight: 60,
weight: 80,
order: -999,
containerIcon: sourceControlViewIcon,
openCommandActionDescriptor: {
Expand Down Expand Up @@ -302,6 +302,25 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).regis
type: 'boolean',
description: localize('showSyncView', "Controls whether the Source Control Sync view is shown."),
default: false
},
'scm.experimental.showSyncInformation': {
type: 'object',
description: localize('showSyncInformation', "Controls whether incoming/outgoing changes are shown in the Source Control view."),
additionalProperties: false,
properties: {
'incoming': {
type: 'boolean',
description: localize('showSyncInformationIncoming', "Show incoming changes in the Source Control view."),
},
'outgoing': {
type: 'boolean',
description: localize('showSyncInformationOutgoing', "Show outgoing changes in the Source Control view."),
},
},
default: {
'incoming': false,
'outgoing': false
}
}
}
});
Expand Down
20 changes: 1 addition & 19 deletions src/vs/workbench/contrib/scm/browser/scmSyncViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { ActionButtonRenderer } from 'vs/workbench/contrib/scm/browser/scmViewPa
import { getActionViewItemProvider, isSCMActionButton, isSCMRepository, isSCMRepositoryArray } from 'vs/workbench/contrib/scm/browser/util';
import { ISCMActionButton, ISCMRepository, ISCMViewService, ISCMViewVisibleRepositoryChangeEvent, SYNC_VIEW_PANE_ID } from 'vs/workbench/contrib/scm/common/scm';
import { comparePaths } from 'vs/base/common/comparers';
import { ISCMHistoryItem, ISCMHistoryItemChange, ISCMHistoryItemGroup } from 'vs/workbench/contrib/scm/common/history';
import { localize } from 'vs/nls';
import { Iterable } from 'vs/base/common/iterator';
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
Expand All @@ -50,6 +49,7 @@ import { ICompressibleTreeRenderer } from 'vs/base/browser/ui/tree/objectTree';
import { ICompressedTreeNode } from 'vs/base/browser/ui/tree/compressedObjectTreeModel';
import { IResourceNode, ResourceTree } from 'vs/base/common/resourceTree';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
import { SCMHistoryItemChangeTreeElement, SCMHistoryItemGroupTreeElement, SCMHistoryItemTreeElement } from 'vs/workbench/contrib/scm/common/history';

type SCMHistoryItemChangeResourceTreeNode = IResourceNode<SCMHistoryItemChangeTreeElement, SCMHistoryItemTreeElement>;
type TreeElement = ISCMRepository[] | ISCMRepository | ISCMActionButton | SCMHistoryItemGroupTreeElement | SCMHistoryItemTreeElement | SCMHistoryItemChangeTreeElement | SCMHistoryItemChangeResourceTreeNode;
Expand Down Expand Up @@ -117,24 +117,6 @@ const ContextKeys = {
ViewMode: new RawContextKey<ViewMode>('scmSyncViewMode', ViewMode.List),
};

interface SCMHistoryItemGroupTreeElement extends ISCMHistoryItemGroup {
readonly description?: string;
readonly ancestor?: string;
readonly count?: number;
readonly repository: ISCMRepository;
readonly type: 'historyItemGroup';
}

interface SCMHistoryItemTreeElement extends ISCMHistoryItem {
readonly historyItemGroup: SCMHistoryItemGroupTreeElement;
readonly type: 'historyItem';
}

interface SCMHistoryItemChangeTreeElement extends ISCMHistoryItemChange {
readonly historyItem: SCMHistoryItemTreeElement;
readonly type: 'historyItemChange';
}

class ListDelegate implements IListVirtualDelegate<any> {

getHeight(element: any): number {
Expand Down
Loading
Loading