diff --git a/network-poc/frontend/src/components/AgentBar.astro b/network-poc/frontend/src/components/AgentBar.astro index f6a1f3a..400429d 100644 --- a/network-poc/frontend/src/components/AgentBar.astro +++ b/network-poc/frontend/src/components/AgentBar.astro @@ -1,13 +1,16 @@ -
+
- -
-
+
- Lisää + +
+
+
+
+ Lisää +
+
diff --git a/network-poc/frontend/src/pages/index.astro b/network-poc/frontend/src/pages/index.astro index 4751da0..2f5dfe9 100644 --- a/network-poc/frontend/src/pages/index.astro +++ b/network-poc/frontend/src/pages/index.astro @@ -15,6 +15,11 @@ import Settings from "../components/Settings.astro"; Kipinä Agentic Playground + @@ -211,6 +216,16 @@ OUTPUT FORMAT: // === Agent selection & config === let selectedAgent = null; + // Layout: vaaka/pysty toggle + let agentLayout = localStorage.getItem('kpn-agent-layout') || 'row'; + window.toggleAgentLayout = function() { + agentLayout = agentLayout === 'row' ? 'column' : 'row'; + localStorage.setItem('kpn-agent-layout', agentLayout); + const bar = document.getElementById('agent-bar'); + bar.style.flexDirection = agentLayout; + bar.style.alignItems = agentLayout === 'column' ? 'flex-start' : 'flex-end'; + }; + function renderAgentBar() { const bar = document.getElementById('agent-bar'); const sorted = Object.entries(agents).sort((a,b) => (a[1].order||0) - (b[1].order||0)); @@ -902,6 +917,15 @@ OUTPUT FORMAT: const r = await fetch('/GUIDE.md'); if (r.ok) el.innerHTML = renderMd(await r.text()); el.querySelectorAll('pre code').forEach(b => { if (typeof hljs !== 'undefined') hljs.highlightElement(b); }); + // Mermaid-kaaviot + if (window.mermaid) { + el.querySelectorAll('.mermaid-block').forEach(async block => { + try { + const { svg } = await window.mermaid.render('r-' + block.id, block.textContent.trim()); + block.innerHTML = svg; + } catch(e) { /* fallback: näytetään koodi */ } + }); + } } catch(e) { el.textContent = 'Virhe: ' + e.message; } })(); @@ -932,10 +956,15 @@ OUTPUT FORMAT: } for (const line of lines) { - // Koodiblokit + // Koodiblokit + Mermaid if (line.startsWith('```')) { if (inCode) { - html += `
${buf.replace(/
`; + if (lang === 'mermaid') { + const mid = 'mmd-' + Math.random().toString(36).slice(2,8); + html += `
${buf.replace(/`; + } else { + html += `
${buf.replace(/
`; + } inCode = false; buf = ''; } else { flushTable();