Parcourir la source

Adds multi-instance support to Focus & Timeline

main
Eric Amodio il y a 1 an
Parent
révision
e75ffd7df1
5 fichiers modifiés avec 37 ajouts et 4 suppressions
  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 Voir le fichier

@ -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 Voir le fichier

@ -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 Voir le fichier

@ -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 Voir le fichier

@ -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 Voir le fichier

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

Chargement…
Annuler
Enregistrer