Skip to content

Commit 0ce34fd

Browse files
committed
fix: Fix possible crash in messages view, Update MCP declaration example in config, adjust theme colors
1 parent 937b8ef commit 0ce34fd

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

huly-coder.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,23 @@ web_search:
6565
#---------------------------------------
6666
# MCP (Model Context Protocol) Configuration
6767
#---------------------------------------
68-
#mcp:
69-
# servers:
68+
# mcp:
69+
# servers:
7070
# # Fetch server configuration
7171
# fetch:
72-
# type: stdio
73-
# command: docker
74-
# args: [ "run", "-i", "--rm", "mcp/fetch", "--ignore-robots-txt" ]
75-
# protocol_version: 2024-11-05
72+
# transport:
73+
# type: stdio
74+
# command: docker
75+
# args: [ "run", "-i", "--rm", "mcp/fetch", "--ignore-robots-txt" ]
76+
# protocol_version: 2024-11-05
77+
# system_prompt: Custom system prompt addon for MCP server
7678
#
7779
# # Weather server configuration
7880
# weather:
79-
# type: sse
80-
# url: http://127.0.0.1:8080/sse
81-
# protocol_version: 2024-11-05
81+
# transport:
82+
# type: sse
83+
# url: http://127.0.0.1:8080/sse
84+
# protocol_version: 2024-11-05
8285

8386
#---------------------------------------
8487
# AI Assistant Personality Configuration

src/tui/theme.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@ impl Theme {
9595
panel_shadow: Color::Indexed(237),
9696
text: Color::White,
9797
inactive_text: Color::Gray,
98-
tool_call: Color::from_u32(0x6EB4BF),
98+
tool_call: Color::Indexed(153),
9999
focus: Color::Blue,
100-
primary: Color::from_u32(0xC1C9D5),
100+
primary: Color::Indexed(188),
101101
secondary: Color::Blue,
102102
highlight: Color::Yellow,
103103
success: Color::Green,
104104
warning: Color::Yellow,
105105
error: Color::Red,
106106
inactive: Color::DarkGray,
107107
status: Color::DarkGray,
108-
border: Color::Indexed(236),
108+
border: Color::Indexed(241),
109109
assistant: Color::Indexed(75),
110110
user: Color::Indexed(113),
111111
}

src/tui/widgets.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,13 @@ impl Widget for &mut App<'_> {
185185
let chat_len = messages.len();
186186

187187
let builder = ListBuilder::new(|context| {
188-
let mut item = messages[context.index].clone();
189-
item.is_selected = context.is_selected;
190-
let main_axis_size = item.main_axis_size();
191-
(item, main_axis_size)
188+
if let Some(mut item) = messages.get(context.index).cloned() {
189+
item.is_selected = context.is_selected;
190+
let main_axis_size = item.main_axis_size();
191+
(item, main_axis_size)
192+
} else {
193+
(MessageWidget::new(&theme, vec![], false), 0)
194+
}
192195
});
193196
let list = ListView::new(builder, chat_len)
194197
.block(chat_block)

0 commit comments

Comments
 (0)