Skip to content

Commit 2ef2dbd

Browse files
SCM - Briefer titles on SCM views (microsoft#230693)
* Briefer titles on SCM views (fix microsoft#230687) * Add more containerTitles * Pull request feedback --------- Co-authored-by: Ladislau Szomoru <[email protected]>
1 parent 6a5991c commit 2ef2dbd

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

src/vs/workbench/contrib/scm/browser/scm.contribution.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const viewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensio
7272
}, ViewContainerLocation.Sidebar, { doNotRegisterOpenCommand: true });
7373

7474
const viewsRegistry = Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry);
75+
const containerTitle = localize('source control view', "Source Control");
7576

7677
viewsRegistry.registerViewWelcomeContent(VIEW_PANE_ID, {
7778
content: localize('no open repo', "No source control providers registered."),
@@ -95,7 +96,9 @@ viewsRegistry.registerViewWelcomeContent(HISTORY_VIEW_PANE_ID, {
9596

9697
viewsRegistry.registerViews([{
9798
id: REPOSITORIES_VIEW_PANE_ID,
98-
name: localize2('source control repositories', "Source Control Repositories"),
99+
containerTitle,
100+
name: localize2('scmRepositories', "Repositories"),
101+
singleViewPaneContainerTitle: localize('source control repositories', "Source Control Repositories"),
99102
ctorDescriptor: new SyncDescriptor(SCMRepositoriesViewPane),
100103
canToggleVisibility: true,
101104
hideByDefault: true,
@@ -109,7 +112,9 @@ viewsRegistry.registerViews([{
109112

110113
viewsRegistry.registerViews([{
111114
id: VIEW_PANE_ID,
112-
name: localize2('source control', 'Source Control'),
115+
containerTitle,
116+
name: localize2('scmChanges', 'Changes'),
117+
singleViewPaneContainerTitle: containerTitle,
113118
ctorDescriptor: new SyncDescriptor(SCMViewPane),
114119
canToggleVisibility: true,
115120
canMoveView: true,
@@ -131,7 +136,9 @@ viewsRegistry.registerViews([{
131136

132137
viewsRegistry.registerViews([{
133138
id: HISTORY_VIEW_PANE_ID,
134-
name: localize2('source control history', "Source Control Graph"),
139+
containerTitle,
140+
name: localize2('scmGraph', "Graph"),
141+
singleViewPaneContainerTitle: localize('source control graph', "Source Control Graph"),
135142
ctorDescriptor: new SyncDescriptor(SCMHistoryViewPane),
136143
canToggleVisibility: true,
137144
canMoveView: true,

src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import './media/scm.css';
7-
import { localize } from '../../../../nls.js';
87
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
9-
import { HISTORY_VIEW_PANE_ID, REPOSITORIES_VIEW_PANE_ID, VIEW_PANE_ID, VIEWLET_ID } from '../common/scm.js';
8+
import { VIEWLET_ID } from '../common/scm.js';
109
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
1110
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
1211
import { IThemeService } from '../../../../platform/theme/common/themeService.js';
@@ -45,19 +44,4 @@ export class SCMViewPaneContainer extends ViewPaneContainer {
4544
override getOptimalWidth(): number {
4645
return 400;
4746
}
48-
49-
override getTitle(): string {
50-
if (this.panes.length === 1) {
51-
if (this.panes[0].id === VIEW_PANE_ID ||
52-
this.panes[0].id === REPOSITORIES_VIEW_PANE_ID ||
53-
this.panes[0].id === HISTORY_VIEW_PANE_ID) {
54-
return this.panes[0].title;
55-
} else {
56-
return super.getTitle();
57-
}
58-
}
59-
60-
return localize('source control', "Source Control");
61-
}
62-
6347
}

0 commit comments

Comments
 (0)