From 8678e3474dcdc5c8955104e9d4017ae5091bc8b8 Mon Sep 17 00:00:00 2001 From: Hibryda Date: Wed, 11 Mar 2026 21:54:19 +0100 Subject: [PATCH] fix(components): stopPropagation, PlantUML encoding, Tauri 2.x asset URL GroupAgentsPanel: added e.stopPropagation() on toggleAgent button. ArchitectureTab: collapsed rawDeflate no-op into single plantumlEncode(). TestingTab: replaced asset://localhost/ with convertFileSrc(). --- .../Workspace/ArchitectureTab.svelte | 24 ++++--------------- .../Workspace/GroupAgentsPanel.svelte | 2 +- .../components/Workspace/TestingTab.svelte | 3 ++- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/v2/src/lib/components/Workspace/ArchitectureTab.svelte b/v2/src/lib/components/Workspace/ArchitectureTab.svelte index 1e04907..ce2ef79 100644 --- a/v2/src/lib/components/Workspace/ArchitectureTab.svelte +++ b/v2/src/lib/components/Workspace/ArchitectureTab.svelte @@ -154,27 +154,13 @@ package "Backend" { } } - // PlantUML text encoder (deflate + base64 variant) - // Uses the PlantUML encoding scheme: https://plantuml.com/text-encoding + // PlantUML hex encoding — uses the ~h prefix supported by plantuml.com + // See: https://plantuml.com/text-encoding function plantumlEncode(text: string): string { - const data = unescape(encodeURIComponent(text)); - const compressed = rawDeflate(data); - return encode64(compressed); - } - - // Minimal raw deflate (store-only for simplicity — works with plantuml.com) - function rawDeflate(data: string): string { - // For PlantUML server compatibility, we use the ~h hex encoding as fallback - // which is simpler and doesn't require deflate - return data; - } - - // PlantUML base64 encoding (6-bit alphabet: 0-9A-Za-z-_) - function encode64(data: string): string { - // Use hex encoding prefix for simplicity (supported by PlantUML server) + const bytes = unescape(encodeURIComponent(text)); let hex = '~h'; - for (let i = 0; i < data.length; i++) { - hex += data.charCodeAt(i).toString(16).padStart(2, '0'); + for (let i = 0; i < bytes.length; i++) { + hex += bytes.charCodeAt(i).toString(16).padStart(2, '0'); } return hex; } diff --git a/v2/src/lib/components/Workspace/GroupAgentsPanel.svelte b/v2/src/lib/components/Workspace/GroupAgentsPanel.svelte index 67a2ffb..c1f2b84 100644 --- a/v2/src/lib/components/Workspace/GroupAgentsPanel.svelte +++ b/v2/src/lib/components/Workspace/GroupAgentsPanel.svelte @@ -146,7 +146,7 @@ class="action-btn" class:start={status === 'stopped'} class:stop={status !== 'stopped'} - onclick={() => toggleAgent(agent)} + onclick={(e: MouseEvent) => { e.stopPropagation(); toggleAgent(agent); }} title={status === 'stopped' ? 'Start agent' : 'Stop agent'} > {status === 'stopped' ? '▶' : '■'} diff --git a/v2/src/lib/components/Workspace/TestingTab.svelte b/v2/src/lib/components/Workspace/TestingTab.svelte index 52ea06b..7a258b6 100644 --- a/v2/src/lib/components/Workspace/TestingTab.svelte +++ b/v2/src/lib/components/Workspace/TestingTab.svelte @@ -1,5 +1,6 @@