feat: add separator lines between meta plugins in status table
Co-authored-by: aider (openai/andrew/openrouter/mistralai/mistral-medium-3.1) <aider@aider.chat>
This commit is contained in:
@@ -280,24 +280,24 @@ fn build_meta_plugin_table(meta_plugin_info: &Vec<MetaPluginInfo>) -> Table {
|
|||||||
b->"Options",
|
b->"Options",
|
||||||
b->"Outputs"));
|
b->"Outputs"));
|
||||||
|
|
||||||
for info in meta_plugin_info {
|
for (i, info) in meta_plugin_info.iter().enumerate() {
|
||||||
// Get default options for the meta plugin
|
// Get default options for the meta plugin
|
||||||
let meta_plugin_type = match MetaPluginType::from_str(&info.meta_name) {
|
let meta_plugin_type = match MetaPluginType::from_str(&info.meta_name) {
|
||||||
Ok(plugin_type) => plugin_type,
|
Ok(plugin_type) => plugin_type,
|
||||||
Err(_) => continue,
|
Err(_) => continue,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a default plugin to get its default options
|
// Create a default plugin to get its default options
|
||||||
let default_plugin = get_meta_plugin(
|
let default_plugin = get_meta_plugin(
|
||||||
meta_plugin_type.clone(),
|
meta_plugin_type.clone(),
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get and sort options
|
// Get and sort options
|
||||||
let mut options: Vec<_> = default_plugin.options().iter().collect();
|
let mut options: Vec<_> = default_plugin.options().iter().collect();
|
||||||
options.sort_by(|a, b| a.0.cmp(b.0));
|
options.sort_by(|a, b| a.0.cmp(b.0));
|
||||||
|
|
||||||
// Format options as YAML string, each on a new line
|
// Format options as YAML string, each on a new line
|
||||||
let options_str = if options.is_empty() {
|
let options_str = if options.is_empty() {
|
||||||
"{}".to_string()
|
"{}".to_string()
|
||||||
@@ -308,7 +308,7 @@ fn build_meta_plugin_table(meta_plugin_info: &Vec<MetaPluginInfo>) -> Table {
|
|||||||
.trim()
|
.trim()
|
||||||
.to_string()
|
.to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get and sort output keys
|
// Get and sort output keys
|
||||||
let mut output_keys: Vec<String> = info.outputs.keys().map(|k| k.to_string()).collect();
|
let mut output_keys: Vec<String> = info.outputs.keys().map(|k| k.to_string()).collect();
|
||||||
output_keys.sort();
|
output_keys.sort();
|
||||||
@@ -317,12 +317,21 @@ fn build_meta_plugin_table(meta_plugin_info: &Vec<MetaPluginInfo>) -> Table {
|
|||||||
} else {
|
} else {
|
||||||
output_keys.join("\n")
|
output_keys.join("\n")
|
||||||
};
|
};
|
||||||
|
|
||||||
meta_plugin_table.add_row(Row::new(vec![
|
meta_plugin_table.add_row(Row::new(vec![
|
||||||
Cell::new(&info.meta_name),
|
Cell::new(&info.meta_name),
|
||||||
Cell::new(&options_str),
|
Cell::new(&options_str),
|
||||||
Cell::new(&outputs_display),
|
Cell::new(&outputs_display),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
// Add a separator line after each row except the last one
|
||||||
|
if i < meta_plugin_info.len() - 1 {
|
||||||
|
meta_plugin_table.add_row(Row::new(vec![
|
||||||
|
Cell::new("").with_style(Attr::ForegroundColor(color::BRIGHT_BLACK)),
|
||||||
|
Cell::new("").with_style(Attr::ForegroundColor(color::BRIGHT_BLACK)),
|
||||||
|
Cell::new("").with_style(Attr::ForegroundColor(color::BRIGHT_BLACK)),
|
||||||
|
]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_plugin_table
|
meta_plugin_table
|
||||||
|
|||||||
Reference in New Issue
Block a user