Description
Currently, <code-block> and <reasoning> components in the Genkit Developer UI are implemented using <mat-expansion-panel> with the shared rendered-block-expansion-panel mixin. This gives them:
- Collapsible body panels (collapsible on click/keyboard for long snippets)
- Standardized header typography and padding
- A copy-to-clipboard action button in the header
In contrast, <tool-request> and <tool-response> components are implemented using plain <div> containers (.toolrequest-container, .toolresponse-container) with bespoke header markup. As a result:
- They cannot be collapsed when tool request/response JSON payloads are large.
- They lack a copy button in the header to easily copy tool inputs/outputs.
- Their styling requires duplicated SCSS rather than inheriting the shared expansion panel mixin.
Proposed Changes
-
Refactor to <mat-expansion-panel>:
- Update
tool-request.component.html and tool-response.component.html to use <mat-expansion-panel [expanded]="true">.
- Use
<mat-expansion-panel-header> to house the tool name, reference ID chip (#ref), tooltip, and action buttons.
-
Add Header Actions:
- Add a Copy button (
<button mat-icon-button matTooltip="Copy">) to copy the highlighted/formatted JSON payload to clipboard.
-
Style Consolidation:
- Apply the
mixins.rendered-block-expansion-panel() mixin to tool-request.component.scss and tool-response.component.scss, removing redundant custom container styling and aligning all message blocks into 100% architectural and visual parity.
Description
Currently,
<code-block>and<reasoning>components in the Genkit Developer UI are implemented using<mat-expansion-panel>with the sharedrendered-block-expansion-panelmixin. This gives them:In contrast,
<tool-request>and<tool-response>components are implemented using plain<div>containers (.toolrequest-container,.toolresponse-container) with bespoke header markup. As a result:Proposed Changes
Refactor to
<mat-expansion-panel>:tool-request.component.htmlandtool-response.component.htmlto use<mat-expansion-panel [expanded]="true">.<mat-expansion-panel-header>to house the tool name, reference ID chip (#ref), tooltip, and action buttons.Add Header Actions:
<button mat-icon-button matTooltip="Copy">) to copy the highlighted/formatted JSON payload to clipboard.Style Consolidation:
mixins.rendered-block-expansion-panel()mixin totool-request.component.scssandtool-response.component.scss, removing redundant custom container styling and aligning all message blocks into 100% architectural and visual parity.