fix: layout fixes

This commit is contained in:
2026-02-26 12:09:27 +01:00
parent 121aa6a9f7
commit a3c571f7cd
8 changed files with 481 additions and 46 deletions

View File

@@ -56,9 +56,9 @@ function createSurfaceMessages(
// ---- Tool argument interfaces ----
export interface RenderChartArgs {
chartType: 'bar' | 'line' | 'pie';
chartType: 'bar' | 'stacked-bar' | 'line' | 'pie';
title?: string;
series: Array<{ label: string; value: number }>;
series: Array<{ label: string; value: number; segments?: Array<{ label: string; value: number }> }>;
}
export interface RenderTableArgs {

View File

@@ -323,7 +323,7 @@ Available Data Tools:
- get_media_posts: Get posts that use a specific media file.
Available UI Render Tools (use these to show rich interactive elements):
- render_chart: Show data as a bar, line, or pie chart. Use when presenting statistics or comparisons.
- render_chart: Show data as a bar, stacked-bar, line, or pie chart. Use when presenting statistics or comparisons. Use stacked-bar when each bar has multiple segments (e.g., published vs draft posts per year).
- render_table: Show data in a structured table. Use for tabular comparisons and listings.
- render_form: Show an interactive form to collect user input (e.g., metadata edits, settings).
- render_card: Show an information card with title, body, and action buttons.

View File

@@ -924,7 +924,7 @@ export class OpenCodeManager {
input_schema: {
type: 'object',
properties: {
chartType: { type: 'string', enum: ['bar', 'line', 'pie'], description: 'The type of chart to render' },
chartType: { type: 'string', enum: ['bar', 'stacked-bar', 'line', 'pie'], description: 'The type of chart to render. Use stacked-bar when each bar has multiple segments (categories).' },
title: { type: 'string', description: 'Optional chart title' },
series: {
type: 'array',
@@ -932,11 +932,23 @@ export class OpenCodeManager {
type: 'object',
properties: {
label: { type: 'string', description: 'Data point label' },
value: { type: 'number', description: 'Data point value' },
value: { type: 'number', description: 'Data point value (total for stacked bars)' },
segments: {
type: 'array',
items: {
type: 'object',
properties: {
label: { type: 'string', description: 'Segment category label' },
value: { type: 'number', description: 'Segment value' },
},
required: ['label', 'value'],
},
description: 'Segments for stacked-bar charts. Each segment is a category within the bar.',
},
},
required: ['label', 'value'],
},
description: 'Array of data points with label and value',
description: 'Array of data points with label and value. For stacked-bar charts, include segments.',
},
},
required: ['chartType', 'series'],