Archived
refactor(plugin-api): clean up workspace panel context
This commit is contained in:
@@ -908,7 +908,9 @@ export class PiWebApp extends LitElement {
|
||||
open: (options) => { void this.openRuntimeTerminal(machineId, workspace, options); },
|
||||
runCommand: (input) => terminalCommandRuns.runCommand({ ...input, workspace }),
|
||||
},
|
||||
requestRender: () => { this.requestUpdate(); },
|
||||
host: {
|
||||
requestRender: () => { this.requestUpdate(); },
|
||||
},
|
||||
piWebUnstable: { terminalCommandRuns },
|
||||
fileTree: this.state.fileTree,
|
||||
expandedDirs: this.state.expandedDirs,
|
||||
@@ -923,7 +925,6 @@ export class PiWebApp extends LitElement {
|
||||
activeTerminalCount: this.state.activeTerminalCount,
|
||||
selectedTerminalId: this.state.selectedTerminalId,
|
||||
terminalAutoStart: this.terminalAutoStartWorkspaceId === workspace.id,
|
||||
openTerminal: (options) => { this.openTerminal(options); },
|
||||
onRefreshFiles: () => { void this.files.refreshFiles(); },
|
||||
onExpandDir: (path: string) => { void this.files.expandDir(path); },
|
||||
onSelectFile: (path: string) => { void this.files.selectFile(path); },
|
||||
|
||||
@@ -56,6 +56,10 @@ export interface WorkspacePanelTerminal {
|
||||
runCommand(input: WorkspaceTerminalCommandInput): Promise<TerminalCommandRunHandle>;
|
||||
}
|
||||
|
||||
export interface WorkspacePanelHost {
|
||||
requestRender(): void;
|
||||
}
|
||||
|
||||
export interface PiWebUnstableRuntimeContext {
|
||||
terminalCommandRuns: TerminalCommandRunsInternalRuntime;
|
||||
openSettings?: (section?: SettingsSection) => void;
|
||||
@@ -116,7 +120,7 @@ export interface WorkspacePanelContext {
|
||||
state: AppState;
|
||||
files: WorkspacePanelFiles;
|
||||
terminal: WorkspacePanelTerminal;
|
||||
requestRender: () => void;
|
||||
host: WorkspacePanelHost;
|
||||
piWebUnstable?: Pick<PiWebUnstableRuntimeContext, "terminalCommandRuns">;
|
||||
fileTree: FileTreeEntry[];
|
||||
expandedDirs: Record<string, FileTreeEntry[]>;
|
||||
@@ -131,7 +135,6 @@ export interface WorkspacePanelContext {
|
||||
activeTerminalCount: number;
|
||||
selectedTerminalId: string | undefined;
|
||||
terminalAutoStart: boolean;
|
||||
openTerminal: (options?: { terminalId?: string | undefined }) => void;
|
||||
onRefreshFiles: () => void;
|
||||
onExpandDir: (path: string) => void;
|
||||
onSelectFile: (path: string) => void;
|
||||
|
||||
Reference in New Issue
Block a user