agent: Improve the UX around interacting with MCP servers (#32622)
Still a work in progress! Todos before merging: - [x] Allow to delete (not just turn off) an MCP server from the panel's settings view - [x] Also uninstall the extension upon deleting the server (check if the extension just provides MCPs) - [x] Resolve repository URL again - [x] Add a button to open the configuration modal from the panel's settings view - [x] Improve modal UX to install and configure a non-extension MCP Release Notes: - N/A --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de> Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
parent
526faf287d
commit
804b91aa8c
16 changed files with 926 additions and 728 deletions
|
@ -1496,25 +1496,24 @@ fn replace_value_in_json_text(
|
|||
if between_comma_and_key.trim().is_empty() {
|
||||
removal_start = comma_pos;
|
||||
}
|
||||
} else {
|
||||
// No preceding comma, check for trailing comma
|
||||
if let Some(remaining_text) = text.get(existing_value_range.end..) {
|
||||
let mut chars = remaining_text.char_indices();
|
||||
while let Some((offset, ch)) = chars.next() {
|
||||
if ch == ',' {
|
||||
removal_end = existing_value_range.end + offset + 1;
|
||||
// Also consume whitespace after the comma
|
||||
while let Some((_, next_ch)) = chars.next() {
|
||||
if next_ch.is_whitespace() {
|
||||
removal_end += next_ch.len_utf8();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(remaining_text) = text.get(existing_value_range.end..) {
|
||||
let mut chars = remaining_text.char_indices();
|
||||
while let Some((offset, ch)) = chars.next() {
|
||||
if ch == ',' {
|
||||
removal_end = existing_value_range.end + offset + 1;
|
||||
// Also consume whitespace after the comma
|
||||
while let Some((_, next_ch)) = chars.next() {
|
||||
if next_ch.is_whitespace() {
|
||||
removal_end += next_ch.len_utf8();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} else if !ch.is_whitespace() {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} else if !ch.is_whitespace() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue