Ver a proveniência

Changes command category of timeline & worktrees

Aligns protocol naming
main
Eric Amodio há 2 anos
ascendente
cometimento
420b4a13b6
5 ficheiros alterados com 14 adições e 14 eliminações
  1. +4
    -4
      package.json
  2. +3
    -3
      src/plus/webviews/timeline/protocol.ts
  3. +2
    -2
      src/plus/webviews/timeline/timelineWebview.ts
  4. +2
    -2
      src/plus/webviews/timeline/timelineWebviewView.ts
  5. +3
    -3
      src/webviews/apps/plus/timeline/timeline.ts

+ 4
- 4
package.json Ver ficheiro

@ -3915,7 +3915,7 @@
{
"command": "gitlens.showTimelinePage",
"title": "Open Visual File History of Active File",
"category": "GitLens",
"category": "GitLens+",
"icon": {
"dark": "images/dark/icon-history.svg",
"light": "images/light/icon-history.svg"
@ -3995,12 +3995,12 @@
{
"command": "gitlens.showTimelineView",
"title": "Show Visual File History View",
"category": "GitLens"
"category": "GitLens+"
},
{
"command": "gitlens.showWorktreesView",
"title": "Show Worktrees View",
"category": "GitLens"
"category": "GitLens+"
},
{
"command": "gitlens.compareWith",
@ -4266,7 +4266,7 @@
{
"command": "gitlens.gitCommands.worktree",
"title": "Git Worktree...",
"category": "GitLens"
"category": "GitLens+"
},
{
"command": "gitlens.switchMode",

+ 3
- 3
src/plus/webviews/timeline/protocol.ts Ver ficheiro

@ -26,10 +26,10 @@ export interface Commit {
export type Period = `${number}|${'D' | 'M' | 'Y'}`;
export interface DidChangeStateParams {
export interface DidChangeParams {
state: State;
}
export const DidChangeStateNotificationType = new IpcNotificationType<DidChangeStateParams>('timeline/data/didChange');
export const DidChangeNotificationType = new IpcNotificationType<DidChangeParams>('timeline/didChange');
export interface OpenDataPointParams {
data?: {
@ -37,7 +37,7 @@ export interface OpenDataPointParams {
selected: boolean;
};
}
export const OpenDataPointCommandType = new IpcCommandType<OpenDataPointParams>('timeline/point/click');
export const OpenDataPointCommandType = new IpcCommandType<OpenDataPointParams>('timeline/point/open');
export interface UpdatePeriodParams {
period: Period;

+ 2
- 2
src/plus/webviews/timeline/timelineWebview.ts Ver ficheiro

@ -24,7 +24,7 @@ import { WebviewBase } from '../../../webviews/webviewBase';
import type { SubscriptionChangeEvent } from '../../subscription/subscriptionService';
import { ensurePlusFeaturesEnabled } from '../../subscription/utils';
import type { Commit, Period, State } from './protocol';
import { DidChangeStateNotificationType, OpenDataPointCommandType, UpdatePeriodCommandType } from './protocol';
import { DidChangeNotificationType, OpenDataPointCommandType, UpdatePeriodCommandType } from './protocol';
import { generateRandomTimelineDataset } from './timelineWebviewView';
interface Context {
@ -391,7 +391,7 @@ export class TimelineWebview extends WebviewBase {
const context = { ...this._context, ...this._pendingContext };
return window.withProgress({ location: { viewId: this.id } }, async () => {
const success = await this.notify(DidChangeStateNotificationType, {
const success = await this.notify(DidChangeNotificationType, {
state: await this.getState(context),
});
if (success) {

+ 2
- 2
src/plus/webviews/timeline/timelineWebviewView.ts Ver ficheiro

@ -24,7 +24,7 @@ import { WebviewViewBase } from '../../../webviews/webviewViewBase';
import type { SubscriptionChangeEvent } from '../../subscription/subscriptionService';
import { ensurePlusFeaturesEnabled } from '../../subscription/utils';
import type { Commit, Period, State } from './protocol';
import { DidChangeStateNotificationType, OpenDataPointCommandType, UpdatePeriodCommandType } from './protocol';
import { DidChangeNotificationType, OpenDataPointCommandType, UpdatePeriodCommandType } from './protocol';
interface Context {
uri: Uri | undefined;
@ -393,7 +393,7 @@ export class TimelineWebviewView extends WebviewViewBase {
const context = { ...this._context, ...this._pendingContext };
return window.withProgress({ location: { viewId: this.id } }, async () => {
const success = await this.notify(DidChangeStateNotificationType, {
const success = await this.notify(DidChangeNotificationType, {
state: await this.getState(context),
});
if (success) {

+ 3
- 3
src/webviews/apps/plus/timeline/timeline.ts Ver ficheiro

@ -4,7 +4,7 @@ import './timeline.scss';
import { provideVSCodeDesignSystem, vsCodeButton, vsCodeDropdown, vsCodeOption } from '@vscode/webview-ui-toolkit';
import type { State } from '../../../../plus/webviews/timeline/protocol';
import {
DidChangeStateNotificationType,
DidChangeNotificationType,
OpenDataPointCommandType,
UpdatePeriodCommandType,
} from '../../../../plus/webviews/timeline/protocol';
@ -47,10 +47,10 @@ export class TimelineApp extends App {
const msg = e.data as IpcMessage;
switch (msg.method) {
case DidChangeStateNotificationType.method:
case DidChangeNotificationType.method:
this.log(`${this.appName}.onMessageReceived(${msg.id}): name=${msg.method}`);
onIpc(DidChangeStateNotificationType, msg, params => {
onIpc(DidChangeNotificationType, msg, params => {
this.state = params.state;
this.updateState();
});

Carregando…
Cancelar
Guardar