Fix UI auto-scroll, make namespace optional, alias filePath, and downgrade ws logs

This commit is contained in:
Riz Ashraf committed 2026-09-25 21:38:21 +01:00
1 parent 175882dd1b
commit 4ecda68c1e
4 files changed
+15 -5

No files matched your search

+1 -1
View File
@@ -119,7 +119,7 @@ pub async fn handle_socket(socket: WebSocket, state: Arc<AppState>, _client_type
tracing::info!("Received non-text message from websocket: {:?}", other);
}
Err(e) => {
tracing::error!("Websocket receive error: {}", e);
tracing::warn!("Websocket receive error: {}", e);
break;
}
}
+11 -1
View File
@@ -549,6 +549,9 @@
// Resize graph when becoming visible again
network.redraw();
network.fit();
} else if (tabId === 'activity-tab') {
const feed = document.getElementById('activity-feed');
feed.scrollTop = feed.scrollHeight;
}
}
@@ -929,14 +932,21 @@
try {
const data = JSON.parse(event.data);
if (data.type === 'activity') {
// Check scroll state before appending
const isScrolledToBottom = feed.scrollHeight - feed.clientHeight <= feed.scrollTop + 20;
const div = document.createElement('div');
div.className = 'feed-entry';
const timeStr = new Date(data.data.time).toLocaleTimeString([], {hour: '2-digit', minute:'2-digit', second:'2-digit'});
div.innerHTML = `<span class="time">[${timeStr}]</span> ${data.data.message || data.data.data || data.data}`;
feed.appendChild(div);
// Enforce max history
while (feed.children.length > MAX_ACTIVITY_HISTORY) {
feed.removeChild(feed.firstChild);
}
// Auto-scroll logic
const isScrolledToBottom = feed.scrollHeight - feed.clientHeight <= feed.scrollTop + 20;
if (isScrolledToBottom) {
feed.scrollTop = feed.scrollHeight;
}
+1 -1
View File
@@ -278,7 +278,7 @@ impl McpTool for ListContextWorkspacesHandler {
let req: ListContextWorkspacesTool =
serde_json::from_value(args).map_err(|e| e.to_string())?;
let data = state.context_workspaces.read_with(|ws| {
let filtered: Vec<_> = ws.iter().filter(|w| w.namespace == req.namespace).collect();
let filtered: Vec<_> = ws.iter().filter(|w| req.namespace.as_ref().map_or(true, |ns| &w.namespace == ns)).collect();
serde_json::to_string(&filtered).unwrap_or_default()
});
Ok(data.to_string())
+2 -2
View File
@@ -85,7 +85,7 @@ pub struct OpenNodesTool {
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct LogCodeChangeTool {
/// The path of the file that was changed.
#[serde(rename = "filePath")]
#[serde(alias = "filePath")]
pub file_path: String,
/// A description of the change.
pub description: String,
@@ -508,7 +508,7 @@ pub struct LoadContextWorkspaceTool {
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ListContextWorkspacesTool {
/// The namespace to list workspaces for.
pub namespace: String,
pub namespace: Option<String>,
}
/// Search across all memory stores (Graph, Tasks, Snippets, ADRs, etc.).