From 6abc41b4dce3780855d1f50482771a480a0d2e92 Mon Sep 17 00:00:00 2001 From: spellitwithaph Date: Wed, 27 May 2026 10:41:46 -0400 Subject: [PATCH] refactor: extract render methods for workspace panel templates Break the dense one-liner workspace-panel and expand-button templates into multi-line formatted render methods for readability and safer future edits. --- src/client/src/components/PiWebApp.ts | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/client/src/components/PiWebApp.ts b/src/client/src/components/PiWebApp.ts index 45980af..7db89b6 100644 --- a/src/client/src/components/PiWebApp.ts +++ b/src/client/src/components/PiWebApp.ts @@ -511,13 +511,37 @@ export class PiWebApp extends LitElement { const panelContext = workspace === undefined ? undefined : this.createWorkspacePanelContext(workspace); const workspaceLabelItems = workspace === undefined ? [] : this.plugins.getWorkspaceLabelItems(this.state, workspace); const emptyState = workspace === undefined ? this.workspacePanelEmptyState() : undefined; - return html` { this.openWorkspaceTool(tool); }} .onToggleCollapse=${() => { this.toggleWorkspacePanelCollapse(); }}>`; + return html` + { this.openWorkspaceTool(tool); }} + .onToggleCollapse=${() => { this.toggleWorkspacePanelCollapse(); }} + > + `; } private toggleWorkspacePanelCollapse(): void { this.setState({ workspacePanelCollapsed: !this.state.workspacePanelCollapsed }); } + private renderExpandWorkspacePanelButton() { + return html` +
+ +
+ `; + } + private renderNavigationPanel(autoSwitchToChat: boolean) { const openChatAfter = (action: () => Promise) => this.withChatScrollTransition(async () => { await action(); @@ -1200,7 +1224,7 @@ export class PiWebApp extends LitElement {
${this.renderContextBar()} - ${state.workspacePanelCollapsed ? html`
` : null} + ${state.workspacePanelCollapsed ? this.renderExpandWorkspacePanelButton() : null}