pub enum Kind {
Show 17 variants
Column {
children: Vec<Node>,
},
Row {
children: Vec<Node>,
},
Card {
title: String,
children: Vec<Node>,
},
Text {
text: String,
style: TextStyle,
tone: Tone,
},
Markdown {
text: String,
},
Chip {
text: String,
tone: Tone,
},
Button {
label: String,
action: String,
primary: bool,
danger: bool,
},
Input {
name: String,
value: String,
placeholder: String,
submit: Option<String>,
},
Toggle {
name: String,
label: String,
value: bool,
action: Option<String>,
},
Select {
name: String,
options: Vec<String>,
value: String,
action: Option<String>,
},
Progress {
value: f32,
label: String,
},
Table {
name: String,
columns: Vec<TableColumn>,
rows: Vec<Vec<Value>>,
height: Option<f32>,
select: Option<String>,
},
Chart {
spec: ChartSpec,
},
Separator {},
Image {
media: Option<String>,
artifact: Option<String>,
alt: String,
width: Option<f32>,
height: Option<f32>,
},
Canvas {
width: f32,
height: f32,
shapes: Vec<Shape>,
action: Option<String>,
},
Grid {
name: String,
rows: u32,
cols: u32,
blocks: Vec<GridBlock>,
frozen_rows: u32,
frozen_cols: u32,
widths: BTreeMap<u32, f32>,
default_width: Option<f32>,
editable: bool,
headers: bool,
height: Option<f32>,
selection: Option<GridRange>,
},
}Expand description
What a node is ("type" in JSON).
Variants§
Column
Children stacked top to bottom.
Row
Children side by side (wrapping); a row holding cards or columns splits the width equally between them.
Card
A framed box with an optional title.
Text
Markdown
Chip
A small status pill.
Button
Input
A one-line text field; its text is values[name] in every event.
Fields
Toggle
A checkbox; values[name] is a bool.
Select
A drop-down; values[name] is the chosen option.
Fields
Progress
A bar, value from 0 to 1.
Table
Rows of cells, drawn virtualized (only what is on screen), with editable columns.
Fields
columns: Vec<TableColumn>Chart
A chart: the same spec as .chart.json artifacts.
Separator
Image
An image from the chat’s media (a workspace path) or an artifact.
Fields
Canvas
A display list: shapes in a width × height box (scaled down to fit).
Fields
Grid
A spreadsheet: a rows × cols sheet of which the client has the cells in blocks
and asks for others (a window event) as the user scrolls. Its events carry a
GridEvent; values[name] is the selection (a GridRange).
Fields
default_width: Option<f32>Width of the other columns (GRID_DEFAULT_WIDTH if not given).