refactor(plugin-api): clean up workspace panel context

This commit is contained in:
Federico Jaramillo Martinez
2026-06-04 15:38:18 +02:00
parent bd8d1f1f08
commit f1c8f1f014
6 changed files with 26 additions and 13 deletions
+3 -2
View File
@@ -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); },
+5 -2
View File
@@ -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;