Переглянути джерело

Adds multi-instance support to Focus & Timeline

main
Eric Amodio 1 рік тому
джерело
коміт
e75ffd7df1
5 змінених файлів з 37 додано та 4 видалено
  1. +22
    -1
      package.json
  2. +8
    -0
      src/config.ts
  3. +3
    -1
      src/plus/webviews/focus/registration.ts
  4. +3
    -1
      src/plus/webviews/timeline/registration.ts
  5. +1
    -1
      src/plus/webviews/timeline/timelineWebview.ts

+ 22
- 1
package.json Переглянути файл

@ -2476,14 +2476,35 @@
}
},
{
"id": "focus",
"title": "Focus View",
"order": 106,
"properties": {
"gitlens.focus.experimental.allowMultipleInstances": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to allow opening multiple instances of the _Focus View_",
"scope": "window",
"order": 10
}
}
},
{
"id": "visual-history",
"title": "Visual File History",
"order": 106,
"properties": {
"gitlens.visualHistory.experimental.allowMultipleInstances": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to allow opening multiple instances of the _Visual File History_ in the editor area",
"scope": "window",
"order": 10
},
"gitlens.visualHistory.queryLimit": {
"type": "number",
"default": 20,
"markdownDescription": "Specifies the limit on the how many commits can be queried for statistics in the Visual File History, because of rate limits. Only applies to virtual workspaces.",
"markdownDescription": "Specifies the limit on the how many commits can be queried for statistics in the _Visual File History_, because of rate limits. Only applies to virtual workspaces.",
"scope": "window"
}
}

+ 8
- 0
src/config.ts Переглянути файл

@ -68,6 +68,11 @@ export interface Config {
readonly fileAnnotations: {
readonly command: string | null;
};
readonly focus: {
readonly experimental: {
allowMultipleInstances: boolean;
};
};
readonly gitCommands: {
readonly closeOnFocusOut: boolean;
readonly search: {
@ -192,6 +197,9 @@ export interface Config {
};
readonly visualHistory: {
readonly queryLimit: number;
readonly experimental: {
allowMultipleInstances: boolean;
};
};
readonly worktrees: {
readonly defaultLocation: string | null;

+ 3
- 1
src/plus/webviews/focus/registration.ts Переглянути файл

@ -1,12 +1,13 @@
import { Disposable, ViewColumn } from 'vscode';
import { Commands } from '../../../constants';
import { registerCommand } from '../../../system/command';
import { configuration } from '../../../system/configuration';
import type { WebviewPanelsProxy, WebviewsController } from '../../../webviews/webviewsController';
import type { State } from './protocol';
export function registerFocusWebviewPanel(controller: WebviewsController) {
return controller.registerWebviewPanel<State>(
{ id: Commands.ShowFocusPage },
{ id: Commands.ShowFocusPage, options: { preserveInstance: false } },
{
id: 'gitlens.focus',
fileName: 'focus.html',
@ -20,6 +21,7 @@ export function registerFocusWebviewPanel(controller: WebviewsController) {
retainContextWhenHidden: true,
enableFindWidget: true,
},
allowMultipleInstances: configuration.get('focus.experimental.allowMultipleInstances'),
},
async (container, host) => {
const { FocusWebviewProvider } = await import(/* webpackChunkName: "focus" */ './focusWebview');

+ 3
- 1
src/plus/webviews/timeline/registration.ts Переглянути файл

@ -1,12 +1,13 @@
import { Disposable, ViewColumn } from 'vscode';
import { Commands } from '../../../constants';
import { registerCommand } from '../../../system/command';
import { configuration } from '../../../system/configuration';
import type { WebviewPanelsProxy, WebviewsController } from '../../../webviews/webviewsController';
import type { State } from './protocol';
export function registerTimelineWebviewPanel(controller: WebviewsController) {
return controller.registerWebviewPanel<State>(
{ id: Commands.ShowTimelinePage },
{ id: Commands.ShowTimelinePage, options: { preserveInstance: false } },
{
id: 'gitlens.timeline',
fileName: 'timeline.html',
@ -20,6 +21,7 @@ export function registerTimelineWebviewPanel(controller: WebviewsController) {
retainContextWhenHidden: false,
enableFindWidget: false,
},
allowMultipleInstances: configuration.get('visualHistory.experimental.allowMultipleInstances'),
},
async (container, host) => {
const { TimelineWebviewProvider } = await import(/* webpackChunkName: "timeline" */ './timelineWebview');

+ 1
- 1
src/plus/webviews/timeline/timelineWebview.ts Переглянути файл

@ -138,7 +138,7 @@ export class TimelineWebviewProvider implements WebviewProvider {
void executeCommand<WebviewPanelShowCommandArgs>(
Commands.ShowTimelinePage,
{ _type: 'WebviewPanelShowOptions' },
{ _type: 'WebviewPanelShowOptions', preserveInstance: true },
this._context.uri,
);
},

Завантаження…
Відмінити
Зберегти