Fix UI auto-scroll, make namespace optional, alias filePath, and downgrade ws logs
This commit is contained in:
1 parent
175882dd1b
commit
4ecda68c1e
4 files changed
+15
-5
No files matched your search
@@ -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);
|
tracing::info!("Received non-text message from websocket: {:?}", other);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
tracing::error!("Websocket receive error: {}", e);
|
tracing::warn!("Websocket receive error: {}", e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -549,6 +549,9 @@
|
|||||||
// Resize graph when becoming visible again
|
// Resize graph when becoming visible again
|
||||||
network.redraw();
|
network.redraw();
|
||||||
network.fit();
|
network.fit();
|
||||||
|
} else if (tabId === 'activity-tab') {
|
||||||
|
const feed = document.getElementById('activity-feed');
|
||||||
|
feed.scrollTop = feed.scrollHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -929,14 +932,21 @@
|
|||||||
try {
|
try {
|
||||||
const data = JSON.parse(event.data);
|
const data = JSON.parse(event.data);
|
||||||
if (data.type === 'activity') {
|
if (data.type === 'activity') {
|
||||||
|
// Check scroll state before appending
|
||||||
|
const isScrolledToBottom = feed.scrollHeight - feed.clientHeight <= feed.scrollTop + 20;
|
||||||
|
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.className = 'feed-entry';
|
div.className = 'feed-entry';
|
||||||
const timeStr = new Date(data.data.time).toLocaleTimeString([], {hour: '2-digit', minute:'2-digit', second:'2-digit'});
|
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}`;
|
div.innerHTML = `<span class="time">[${timeStr}]</span> ${data.data.message || data.data.data || data.data}`;
|
||||||
feed.appendChild(div);
|
feed.appendChild(div);
|
||||||
|
|
||||||
|
// Enforce max history
|
||||||
|
while (feed.children.length > MAX_ACTIVITY_HISTORY) {
|
||||||
|
feed.removeChild(feed.firstChild);
|
||||||
|
}
|
||||||
|
|
||||||
// Auto-scroll logic
|
// Auto-scroll logic
|
||||||
const isScrolledToBottom = feed.scrollHeight - feed.clientHeight <= feed.scrollTop + 20;
|
|
||||||
if (isScrolledToBottom) {
|
if (isScrolledToBottom) {
|
||||||
feed.scrollTop = feed.scrollHeight;
|
feed.scrollTop = feed.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ impl McpTool for ListContextWorkspacesHandler {
|
|||||||
let req: ListContextWorkspacesTool =
|
let req: ListContextWorkspacesTool =
|
||||||
serde_json::from_value(args).map_err(|e| e.to_string())?;
|
serde_json::from_value(args).map_err(|e| e.to_string())?;
|
||||||
let data = state.context_workspaces.read_with(|ws| {
|
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()
|
serde_json::to_string(&filtered).unwrap_or_default()
|
||||||
});
|
});
|
||||||
Ok(data.to_string())
|
Ok(data.to_string())
|
||||||
|
|||||||
+2
-2
@@ -85,7 +85,7 @@ pub struct OpenNodesTool {
|
|||||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||||
pub struct LogCodeChangeTool {
|
pub struct LogCodeChangeTool {
|
||||||
/// The path of the file that was changed.
|
/// The path of the file that was changed.
|
||||||
#[serde(rename = "filePath")]
|
#[serde(alias = "filePath")]
|
||||||
pub file_path: String,
|
pub file_path: String,
|
||||||
/// A description of the change.
|
/// A description of the change.
|
||||||
pub description: String,
|
pub description: String,
|
||||||
@@ -508,7 +508,7 @@ pub struct LoadContextWorkspaceTool {
|
|||||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||||
pub struct ListContextWorkspacesTool {
|
pub struct ListContextWorkspacesTool {
|
||||||
/// The namespace to list workspaces for.
|
/// The namespace to list workspaces for.
|
||||||
pub namespace: String,
|
pub namespace: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Search across all memory stores (Graph, Tasks, Snippets, ADRs, etc.).
|
/// Search across all memory stores (Graph, Tasks, Snippets, ADRs, etc.).
|
||||||
|
|||||||
Reference in new issue
Block a user