diff --git a/package.json b/package.json index 110d43a..7c4542b 100644 --- a/package.json +++ b/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" } } diff --git a/src/config.ts b/src/config.ts index 349d36a..53d24ba 100644 --- a/src/config.ts +++ b/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; diff --git a/src/plus/webviews/focus/registration.ts b/src/plus/webviews/focus/registration.ts index da51309..fd2e3a2 100644 --- a/src/plus/webviews/focus/registration.ts +++ b/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( - { 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'); diff --git a/src/plus/webviews/timeline/registration.ts b/src/plus/webviews/timeline/registration.ts index 8cbf01f..7267e5a 100644 --- a/src/plus/webviews/timeline/registration.ts +++ b/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( - { 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'); diff --git a/src/plus/webviews/timeline/timelineWebview.ts b/src/plus/webviews/timeline/timelineWebview.ts index 06b9644..669b856 100644 --- a/src/plus/webviews/timeline/timelineWebview.ts +++ b/src/plus/webviews/timeline/timelineWebview.ts @@ -138,7 +138,7 @@ export class TimelineWebviewProvider implements WebviewProvider { void executeCommand( Commands.ShowTimelinePage, - { _type: 'WebviewPanelShowOptions' }, + { _type: 'WebviewPanelShowOptions', preserveInstance: true }, this._context.uri, ); },