Skip to content

Commit 2e4e489

Browse files
authored
Merge branch 'main' into hediet/b/binding-sailfish
2 parents 1d60725 + 1532010 commit 2e4e489

File tree

6 files changed

+69
-62
lines changed

6 files changed

+69
-62
lines changed

.github/workflows/deep-classifier-runner.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
with:
4848
configPath: classifier
4949
allowLabels: "info-needed|new release|error-telemetry|*english-please|translation-required"
50-
appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}}
51-
manifestDbConnectionString: ${{secrets.MANIFEST_DB_CONNECTION_STRING}}
50+
tenantId: ${{secrets.TOOLS_TENANT_ID}}
51+
clientId: ${{secrets.TOOLS_CLIENT_ID}}
52+
clientSecret: ${{secrets.TOOLS_CLIENT_SECRET}}
53+
clientScope: ${{secrets.TOOLS_CLIENT_SCOPE}}
5254
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}

src/vs/base/browser/ui/grid/gridview.ts

Lines changed: 26 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,13 @@ class BranchNode implements ISplitView<ILayoutContext>, IDisposable {
356356
private _boundarySashes: IRelativeBoundarySashes = {};
357357
get boundarySashes(): IRelativeBoundarySashes { return this._boundarySashes; }
358358
set boundarySashes(boundarySashes: IRelativeBoundarySashes) {
359+
if (this._boundarySashes.start === boundarySashes.start
360+
&& this._boundarySashes.end === boundarySashes.end
361+
&& this._boundarySashes.orthogonalStart === boundarySashes.orthogonalStart
362+
&& this._boundarySashes.orthogonalEnd === boundarySashes.orthogonalEnd) {
363+
return;
364+
}
365+
359366
this._boundarySashes = boundarySashes;
360367

361368
this.splitview.orthogonalStartSash = boundarySashes.orthogonalStart;
@@ -498,65 +505,20 @@ class BranchNode implements ISplitView<ILayoutContext>, IDisposable {
498505
index = validateIndex(index, this.children.length);
499506

500507
this.splitview.addView(node, size, index, skipLayout);
501-
this._addChild(node, index);
502-
this.onDidChildrenChange();
503-
}
504-
505-
private _addChild(node: Node, index: number): void {
506-
const first = index === 0;
507-
const last = index === this.children.length;
508508
this.children.splice(index, 0, node);
509509

510-
node.boundarySashes = {
511-
start: this.boundarySashes.orthogonalStart,
512-
end: this.boundarySashes.orthogonalEnd,
513-
orthogonalStart: first ? this.boundarySashes.start : this.splitview.sashes[index - 1],
514-
orthogonalEnd: last ? this.boundarySashes.end : this.splitview.sashes[index],
515-
};
516-
517-
if (!first) {
518-
this.children[index - 1].boundarySashes = {
519-
...this.children[index - 1].boundarySashes,
520-
orthogonalEnd: this.splitview.sashes[index - 1]
521-
};
522-
}
523-
524-
if (!last) {
525-
this.children[index + 1].boundarySashes = {
526-
...this.children[index + 1].boundarySashes,
527-
orthogonalStart: this.splitview.sashes[index]
528-
};
529-
}
510+
this.updateBoundarySashes();
511+
this.onDidChildrenChange();
530512
}
531513

532514
removeChild(index: number, sizing?: Sizing): void {
533515
index = validateIndex(index, this.children.length);
534516

535517
this.splitview.removeView(index, sizing);
536-
this._removeChild(index);
537-
this.onDidChildrenChange();
538-
}
518+
this.children.splice(index, 1);
539519

540-
private _removeChild(index: number): Node {
541-
const first = index === 0;
542-
const last = index === this.children.length - 1;
543-
const [child] = this.children.splice(index, 1);
544-
545-
if (!first) {
546-
this.children[index - 1].boundarySashes = {
547-
...this.children[index - 1].boundarySashes,
548-
orthogonalEnd: this.splitview.sashes[index - 1]
549-
};
550-
}
551-
552-
if (!last) { // [0,1,2,3] (2) => [0,1,3]
553-
this.children[index].boundarySashes = {
554-
...this.children[index].boundarySashes,
555-
orthogonalStart: this.splitview.sashes[Math.max(index - 1, 0)]
556-
};
557-
}
558-
559-
return child;
520+
this.updateBoundarySashes();
521+
this.onDidChildrenChange();
560522
}
561523

562524
moveChild(from: number, to: number): void {
@@ -568,14 +530,13 @@ class BranchNode implements ISplitView<ILayoutContext>, IDisposable {
568530
}
569531

570532
if (from < to) {
571-
to--;
533+
to -= 1;
572534
}
573535

574536
this.splitview.moveView(from, to);
537+
this.children.splice(to, 0, this.children.splice(from, 1)[0]);
575538

576-
const child = this._removeChild(from);
577-
this._addChild(child, to);
578-
539+
this.updateBoundarySashes();
579540
this.onDidChildrenChange();
580541
}
581542

@@ -649,6 +610,17 @@ class BranchNode implements ISplitView<ILayoutContext>, IDisposable {
649610
return this.splitview.getViewCachedVisibleSize(index);
650611
}
651612

613+
private updateBoundarySashes(): void {
614+
for (let i = 0; i < this.children.length; i++) {
615+
this.children[i].boundarySashes = {
616+
start: this.boundarySashes.orthogonalStart,
617+
end: this.boundarySashes.orthogonalEnd,
618+
orthogonalStart: i === 0 ? this.boundarySashes.start : this.splitview.sashes[i - 1],
619+
orthogonalEnd: i === this.children.length - 1 ? this.boundarySashes.end : this.splitview.sashes[i],
620+
};
621+
}
622+
}
623+
652624
private onDidChildrenChange(): void {
653625
this.updateChildrenEvents();
654626
this._onDidChange.fire(undefined);

src/vs/base/browser/ui/sash/sash.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ export class Sash extends Disposable {
328328
* The start of a vertical sash is its top-most position.
329329
*/
330330
set orthogonalStartSash(sash: Sash | undefined) {
331+
if (this._orthogonalStartSash === sash) {
332+
return;
333+
}
334+
331335
this.orthogonalStartDragHandleDisposables.clear();
332336
this.orthogonalStartSashDisposables.clear();
333337

@@ -362,6 +366,10 @@ export class Sash extends Disposable {
362366
*/
363367

364368
set orthogonalEndSash(sash: Sash | undefined) {
369+
if (this._orthogonalEndSash === sash) {
370+
return;
371+
}
372+
365373
this.orthogonalEndDragHandleDisposables.clear();
366374
this.orthogonalEndSashDisposables.clear();
367375

src/vs/workbench/contrib/accessibility/browser/accessibleView.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { AccessibilityHelpNLS } from 'vs/editor/common/standaloneStrings';
1616
import { LinkDetector } from 'vs/editor/contrib/links/browser/links';
1717
import { localize } from 'vs/nls';
1818
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
19+
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
1920
import { IContextViewDelegate, IContextViewService } from 'vs/platform/contextview/browser/contextView';
2021
import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation';
2122
import { IOpenerService } from 'vs/platform/opener/common/opener';
@@ -56,20 +57,23 @@ export interface IAccessibleViewOptions {
5657
type: AccessibleViewType;
5758
}
5859

60+
export const accessibilityHelpIsShown = new RawContextKey<boolean>('accessibilityHelpIsShown', false, true);
5961
class AccessibleView extends Disposable {
6062
private _editorWidget: CodeEditorWidget;
63+
private _accessiblityHelpIsShown: IContextKey<boolean>;
6164
get editorWidget() { return this._editorWidget; }
6265
private _editorContainer: HTMLElement;
6366
private _keyListener: IDisposable | undefined;
64-
6567
constructor(
6668
@IOpenerService private readonly _openerService: IOpenerService,
6769
@IInstantiationService private readonly _instantiationService: IInstantiationService,
6870
@IConfigurationService private readonly _configurationService: IConfigurationService,
6971
@IModelService private readonly _modelService: IModelService,
70-
@IContextViewService private readonly _contextViewService: IContextViewService
72+
@IContextViewService private readonly _contextViewService: IContextViewService,
73+
@IContextKeyService private readonly _contextKeyService: IContextKeyService
7174
) {
7275
super();
76+
this._accessiblityHelpIsShown = accessibilityHelpIsShown.bindTo(this._contextKeyService);
7377
this._editorContainer = document.createElement('div');
7478
this._editorContainer.classList.add('accessible-view');
7579
const codeEditorWidgetOptions: ICodeEditorWidgetOptions = {
@@ -96,9 +100,17 @@ class AccessibleView extends Disposable {
96100
getAnchor: () => this._editorContainer,
97101
render: (container) => {
98102
return this._render(provider, container);
103+
},
104+
onHide: () => {
105+
if (provider.options.type === AccessibleViewType.HelpMenu) {
106+
this._accessiblityHelpIsShown.reset();
107+
}
99108
}
100109
};
101110
this._contextViewService.showContextView(delegate);
111+
if (provider.options.type === AccessibleViewType.HelpMenu) {
112+
this._accessiblityHelpIsShown.set(true);
113+
}
102114
}
103115

104116
private _render(provider: IAccessibleContentProvider, container: HTMLElement): IDisposable {

src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
2626
import { AccessibilitySupport, IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
2727
import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
2828
import { TabFocus, TabFocusContext } from 'vs/editor/browser/config/tabFocus';
29+
import { accessibilityHelpIsShown } from 'vs/workbench/contrib/accessibility/browser/accessibleView';
30+
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
2931

3032
const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey<boolean>('accessibilityHelpWidgetVisible', false);
3133

@@ -279,6 +281,11 @@ class ToggleScreenReaderMode extends Action2 {
279281
id: 'editor.action.toggleScreenReaderAccessibilityMode',
280282
title: { value: nls.localize('toggleScreenReaderMode', "Toggle Screen Reader Accessibility Mode"), original: 'Toggle Screen Reader Accessibility Mode' },
281283
f1: true,
284+
keybinding: {
285+
primary: KeyMod.CtrlCmd | KeyCode.KeyE,
286+
weight: KeybindingWeight.WorkbenchContrib + 10,
287+
when: accessibilityHelpIsShown
288+
}
282289
});
283290
}
284291

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const targetMenus = [
4747
class ShareWorkbenchContribution {
4848
private static SHARE_ENABLED_SETTING = 'workbench.experimental.share.enabled';
4949

50-
private _disposables = new DisposableStore();
50+
private _disposables: DisposableStore | undefined;
5151

5252
constructor(
5353
@IShareService private readonly shareService: IShareService,
@@ -58,16 +58,22 @@ class ShareWorkbenchContribution {
5858
}
5959
this.configurationService.onDidChangeConfiguration(e => {
6060
if (e.affectsConfiguration(ShareWorkbenchContribution.SHARE_ENABLED_SETTING)) {
61-
if (this.configurationService.getValue<boolean>(ShareWorkbenchContribution.SHARE_ENABLED_SETTING)) {
61+
const settingValue = this.configurationService.getValue<boolean>(ShareWorkbenchContribution.SHARE_ENABLED_SETTING);
62+
if (settingValue === true && this._disposables === undefined) {
6263
this.registerActions();
63-
} else {
64-
this._disposables.clear();
64+
} else if (settingValue === false && this._disposables !== undefined) {
65+
this._disposables?.clear();
66+
this._disposables = undefined;
6567
}
6668
}
6769
});
6870
}
6971

7072
private registerActions() {
73+
if (!this._disposables) {
74+
this._disposables = new DisposableStore();
75+
}
76+
7177
this._disposables.add(
7278
registerAction2(class ShareAction extends Action2 {
7379
static readonly ID = 'workbench.action.share';

0 commit comments

Comments
 (0)