Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Make Assistant tool details row-expandable
rcourtman2660518572fa
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex f44585fdfc..806fc911e4 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -372,6 +372,13 @@ runtime cost control, and shared AI transport surfaces.JSON, unavailable output, successful command output, and the full raw payloadstay behind Details. This preserves evidence for inspection without lettingcommand output compete with the Assistant answer flow.+ The row itself owns the details trigger, not a tiny adjacent text action:+ completed tool rows with inspectable input or output must expose+ `aria-expanded`, keyboard activation, and a chevron affordance on the row+ header so opening evidence feels like expanding the tool part. That adapts+ OpenCode's `BasicTool` collapsible trigger in+ `packages/ui/src/components/basic-tool.tsx`, where the trigger row and+ arrow own expansion while pending/running tools remain locked.Tool-row summaries are part of that same source-anchored contract, notassistant prose cleanup: when provider or backend transport supplies afunction-style call such as `pulse_read(...)` or a friendly string backed bydiff --git a/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx b/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsxindex ac973eec11..75866ea30a 100644--- a/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx+++ b/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx@@ -1,5 +1,15 @@-import { Component, Show, createSignal, createMemo, createEffect, onCleanup, For } from 'solid-js';+import {+ Component,+ Show,+ createSignal,+ createMemo,+ createEffect,+ onCleanup,+ For,+ createUniqueId,+} from 'solid-js';import CheckCircleIcon from 'lucide-solid/icons/check-circle';+import ChevronRightIcon from 'lucide-solid/icons/chevron-right';import ClockIcon from 'lucide-solid/icons/clock';import LoaderCircleIcon from 'lucide-solid/icons/loader-circle';import XCircleIcon from 'lucide-solid/icons/x-circle';@@ -110,6 +120,7 @@ const ToolInputSummary: Component<ToolInputSummaryProps> = (props) => {*/export const ToolExecutionBlock: Component<ToolExecutionBlockProps> = (props) => {const [showDetails, setShowDetails] = createSignal(false);+ const detailsId = createUniqueId();const toolLabel = createMemo(() => getToolLabel(props.tool.name));const inputText = createMemo(() => toolValueText(props.tool.input));@@ -127,10 +138,34 @@ export const ToolExecutionBlock: Component<ToolExecutionBlockProps> = (props) =>props.tool.success? 'border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-300': 'border-red-200 bg-red-50 text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300';+ const summaryControlTitle = () => (showDetails() ? 'Hide tool details' : 'Show tool details');+ const toggleDetails = () => {+ if (!hasDetails()) return;+ setShowDetails(!showDetails());+ };+ const handleSummaryKeyDown = (event: KeyboardEvent) => {+ if (!hasDetails()) return;+ if (event.key !== 'Enter' && event.key !== ' ') return;+ event.preventDefault();+ toggleDetails();+ };return (<div class="my-2 overflow-hidden rounded-md border border-border-subtle bg-surface text-[11px] shadow-sm">- <div class="flex min-w-0 items-start gap-2 px-2.5 py-2">+ <div+ class={`flex min-w-0 items-start gap-2 px-2.5 py-2 ${+ hasDetails()+ ? 'cursor-pointer transition-colors hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:ring-inset'+ : ''+ }`}+ role={hasDetails() ? 'button' : undefined}+ tabIndex={hasDetails() ? 0 : undefined}+ aria-expanded={hasDetails() ? showDetails() : undefined}+ aria-controls={hasDetails() ? detailsId : undefined}+ title={hasDetails() ? summaryControlTitle() : undefined}+ onClick={toggleDetails}+ onKeyDown={handleSummaryKeyDown}+ ><div class="pt-0.5"><Showwhen={props.tool.success}@@ -159,16 +194,12 @@ export const ToolExecutionBlock: Component<ToolExecutionBlockProps> = (props) =>{statusLabel()}</span><Show when={hasDetails()}>- <button- type="button"- onClick={(event) => {- event.stopPropagation();- setShowDetails(!showDetails());- }}- class="shrink-0 rounded px-1.5 py-0.5 text-[9px] font-medium text-muted hover:bg-surface-hover hover:text-base-content"- >- {showDetails() ? 'Hide details' : 'Details'}- </button>+ <ChevronRightIcon+ class={`h-3.5 w-3.5 shrink-0 text-muted transition-transform ${+ showDetails() ? 'rotate-90' : ''+ }`}+ aria-hidden="true"+ /></Show></div><ToolInputSummary summary={inputSummary()} />@@ -185,7 +216,7 @@ export const ToolExecutionBlock: Component<ToolExecutionBlockProps> = (props) =></Show><Show when={showDetails() && hasDetails()}>- <div class="border-t border-border-subtle px-3 py-2">+ <div id={detailsId} class="border-t border-border-subtle px-3 py-2"><Show when={hasInput()}><div class="mb-1 text-[9px] font-semibold uppercase tracking-wide text-muted">Inputdiff --git a/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsxindex f98542fedf..5be5eba66c 100644--- a/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx+++ b/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx@@ -32,6 +32,8 @@ function makePending(overrides?: Partial<PendingTool>): PendingTool {};}+const getToolDetailsTrigger = () => screen.getByTitle('Show tool details');+// ============================================================// ToolExecutionBlock// ============================================================@@ -162,7 +164,7 @@ describe('ToolExecutionBlock', () => {));expect(screen.getByText('search "prowlarr"')).toBeInTheDocument();- fireEvent.click(screen.getByText('Details'));+ fireEvent.click(getToolDetailsTrigger());expect(screen.getByText(/"action":"search"/)).toBeInTheDocument();});@@ -279,8 +281,7 @@ describe('ToolExecutionBlock', () => {it('keeps successful plain-text output in details instead of previewing it', () => {render(() => <ToolExecutionBlock tool={makeTool({ output: 'hello world' })} />);expect(screen.queryByLabelText('Tool output preview')).not.toBeInTheDocument();- expect(screen.getByText('Details')).toBeInTheDocument();- fireEvent.click(screen.getByText('Details'));+ fireEvent.click(getToolDetailsTrigger());expect(screen.getByText('hello world')).toBeInTheDocument();});@@ -296,7 +297,7 @@ describe('ToolExecutionBlock', () => {));expect(screen.queryByText(/total_nodes/)).not.toBeInTheDocument();- expect(screen.getByText('Details')).toBeInTheDocument();+ expect(getToolDetailsTrigger()).toBeInTheDocument();});it('keeps successful long plain-text output behind details', () => {@@ -312,7 +313,7 @@ describe('ToolExecutionBlock', () => {expect(screen.queryByLabelText('Tool output preview')).not.toBeInTheDocument();expect(text).not.toContain('line 1');expect(text).not.toContain('line 5');- expect(screen.getByText('Details')).toBeInTheDocument();+ expect(getToolDetailsTrigger()).toBeInTheDocument();});it('previews failed plain-text output while keeping full details available', () => {@@ -321,7 +322,7 @@ describe('ToolExecutionBlock', () => {));expect(screen.getByLabelText('Tool output preview')).toHaveTextContent('permission denied');- expect(screen.getByText('Details')).toBeInTheDocument();+ expect(getToolDetailsTrigger()).toBeInTheDocument();});it('uses raw streamed input to summarize sparse completed Pulse read tools', () => {@@ -358,15 +359,18 @@ describe('ToolExecutionBlock', () => {// --- Expand/collapse behavior ---- it('shows a details button when raw input or output is available', () => {+ it('makes the completed tool row the details trigger when raw input or output is available', () => {const output = 'l1\nl2\nl3\nl4\nl5';render(() => <ToolExecutionBlock tool={makeTool({ output })} />);- expect(screen.getByText('Details')).toBeInTheDocument();+ const trigger = getToolDetailsTrigger();+ expect(trigger).toBeInTheDocument();+ expect(trigger).toHaveAttribute('role', 'button');+ expect(trigger).toHaveAttribute('aria-expanded', 'false');});- it('does not show a details button when there are no details', () => {+ it('does not make the row expandable when there are no details', () => {render(() => <ToolExecutionBlock tool={makeTool({ input: '', output: '' })} />);- expect(screen.queryByText('Details')).toBeNull();+ expect(screen.queryByTitle('Show tool details')).toBeNull();});it('shows raw input and output when details are opened', async () => {@@ -374,10 +378,11 @@ describe('ToolExecutionBlock', () => {const { container } = render(() => (<ToolExecutionBlock tool={makeTool({ input: '{"action":"list"}', output })} />));- const btn = screen.getByText('Details');- fireEvent.click(btn);+ const trigger = getToolDetailsTrigger();+ fireEvent.click(trigger);- expect(screen.getByText('Hide details')).toBeInTheDocument();+ expect(trigger).toHaveAttribute('aria-expanded', 'true');+ expect(trigger).toHaveAttribute('title', 'Hide tool details');expect(screen.getByText('Input')).toBeInTheDocument();expect(screen.getByText('Output')).toBeInTheDocument();expect(screen.getByText('{"action":"list"}')).toBeInTheDocument();@@ -398,7 +403,7 @@ describe('ToolExecutionBlock', () => {/>));- fireEvent.click(screen.getByText('Details'));+ fireEvent.click(getToolDetailsTrigger());const detailBlocks = Array.from(container.querySelectorAll('pre'));expect(detailBlocks.length).toBeGreaterThanOrEqual(2);for (const block of detailBlocks) {@@ -411,13 +416,26 @@ describe('ToolExecutionBlock', () => {it('hides raw details when toggled closed', async () => {const output = '{"value":"line1"}';render(() => <ToolExecutionBlock tool={makeTool({ output })} />);- fireEvent.click(screen.getByText('Details'));- expect(screen.getByText('Hide details')).toBeInTheDocument();- fireEvent.click(screen.getByText('Hide details'));- expect(screen.getByText('Details')).toBeInTheDocument();+ const trigger = getToolDetailsTrigger();+ fireEvent.click(trigger);+ expect(trigger).toHaveAttribute('aria-expanded', 'true');+ fireEvent.click(trigger);+ expect(trigger).toHaveAttribute('aria-expanded', 'false');expect(screen.queryByText(/line1/)).not.toBeInTheDocument();});+ it('toggles raw details from the keyboard on the completed tool row', async () => {+ render(() => <ToolExecutionBlock tool={makeTool({ output: 'keyboard output' })} />);+ const trigger = getToolDetailsTrigger();+ fireEvent.keyDown(trigger, { key: 'Enter' });+ expect(trigger).toHaveAttribute('aria-expanded', 'true');+ expect(screen.getByText('keyboard output')).toBeInTheDocument();++ fireEvent.keyDown(trigger, { key: ' ' });+ expect(trigger).toHaveAttribute('aria-expanded', 'false');+ expect(screen.queryByText('keyboard output')).not.toBeInTheDocument();+ });+// --- Edge cases ---it('handles empty output string', () => {@@ -437,8 +455,7 @@ describe('ToolExecutionBlock', () => {const { container } = render(() => <ToolExecutionBlock tool={makeTool({ output })} />);// hasOutput returns false when output contains "not available"expect(container.querySelector('pre')).toBeNull();- // The expand button should also not appear since output section is hidden- expect(screen.getByText('Details')).toBeInTheDocument();+ expect(getToolDetailsTrigger()).toBeInTheDocument();});it('does not truncate input summaries at exactly 28 chars', () => {diff --git a/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.test.tsindex 5ea594bfd1..35ede34f55 100644--- a/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.test.ts+++ b/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.test.ts@@ -62,7 +62,7 @@ describe('getAssistantActiveTurnStatus', () => {),).toEqual({type: 'tool',- text: 'Running $ ls /dev | wc -l on current resource',+ text: 'Running Inspect devices on current resource',startedAt,});});@@ -90,7 +90,7 @@ describe('getAssistantActiveTurnStatus', () => {),).toEqual({type: 'tool',- text: 'Running $ ls /dev | wc -l on current resource',+ text: 'Running Inspect devices on current resource',});});