Skip to content

Commit 394e0df

Browse files
authored
SCM - fix timeline and graph hover when views are in the panel (microsoft#253605)
1 parent 2e9d6fe commit 394e0df

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,9 @@ class HistoryItemHoverDelegate extends WorkbenchHoverDelegate {
759759
@IHoverService hoverService: IHoverService,
760760

761761
) {
762-
super('element', { instantHover: true }, () => this.getHoverOptions(), configurationService, hoverService);
762+
super(_viewContainerLocation === ViewContainerLocation.Panel ? 'mouse' : 'element', {
763+
instantHover: _viewContainerLocation !== ViewContainerLocation.Panel
764+
}, () => this.getHoverOptions(), configurationService, hoverService);
763765
}
764766

765767
private getHoverOptions(): Partial<IHoverOptions> {

src/vs/workbench/contrib/timeline/browser/timelinePane.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { SideBySideEditor, EditorResourceAccessor } from '../../../common/editor
3535
import { ICommandService, CommandsRegistry } from '../../../../platform/commands/common/commands.js';
3636
import { IThemeService } from '../../../../platform/theme/common/themeService.js';
3737
import { ThemeIcon } from '../../../../base/common/themables.js';
38-
import { IViewDescriptorService } from '../../../common/views.js';
38+
import { IViewDescriptorService, ViewContainerLocation } from '../../../common/views.js';
3939
import { IProgressService } from '../../../../platform/progress/common/progress.js';
4040
import { IOpenerService } from '../../../../platform/opener/common/opener.js';
4141
import { ActionBar, IActionViewItemProvider } from '../../../../base/browser/ui/actionbar/actionbar.js';
@@ -926,7 +926,7 @@ export class TimelinePane extends ViewPane {
926926
// this.treeElement.classList.add('show-file-icons');
927927
container.appendChild(this.$tree);
928928

929-
this.treeRenderer = this.instantiationService.createInstance(TimelineTreeRenderer, this.commands);
929+
this.treeRenderer = this.instantiationService.createInstance(TimelineTreeRenderer, this.commands, this.viewDescriptorService.getViewLocationById(this.id));
930930
this._register(this.treeRenderer.onDidScrollToEnd(item => {
931931
if (this.pageOnScroll) {
932932
this.loadMore(item);
@@ -1165,11 +1165,18 @@ class TimelineTreeRenderer implements ITreeRenderer<TreeElement, FuzzyScore, Tim
11651165

11661166
constructor(
11671167
private readonly commands: TimelinePaneCommands,
1168+
private readonly viewContainerLocation: ViewContainerLocation | null,
11681169
@IInstantiationService protected readonly instantiationService: IInstantiationService,
1169-
@IThemeService private themeService: IThemeService,
1170+
@IThemeService private themeService: IThemeService
11701171
) {
11711172
this.actionViewItemProvider = createActionViewItem.bind(undefined, this.instantiationService);
1172-
this._hoverDelegate = this.instantiationService.createInstance(WorkbenchHoverDelegate, 'element', { instantHover: true }, {
1173+
1174+
this._hoverDelegate = this.instantiationService.createInstance(
1175+
WorkbenchHoverDelegate,
1176+
this.viewContainerLocation === ViewContainerLocation.Panel ? 'mouse' : 'element',
1177+
{
1178+
instantHover: this.viewContainerLocation !== ViewContainerLocation.Panel
1179+
}, {
11731180
position: {
11741181
hoverPosition: HoverPosition.RIGHT // Will flip when there's no space
11751182
}

0 commit comments

Comments
 (0)