mirror of
https://github.com/wassname/HumanAgent-MCP.git
synced 2026-09-09 11:14:27 +08:00
Fix dynamic cog menu updates and improve override file UI
- Changed 'Override Prompt' to contextual text: - '📁 Create Override File' when file doesn't exist - '📁 Recreate Override File' when file exists - Added dynamic webview updating after override file creation - Fixed cog menu not showing reload option when override created during session - Added updateOverrideFileExists message handler to refresh menu state - Fixed character encoding issues in webview menu options
This commit is contained in:
Vendored
+2
@@ -1444,3 +1444,5 @@ Hey Ben! Your MCP server is running and I'm here to chat. What's on your mind to
|
||||
[2025-10-23T03:36:07.981Z] Independent server started successfully and is responding
|
||||
[2025-10-23T03:36:17.577Z] ServerManager disposed
|
||||
[2025-10-23T03:43:20.831Z] ServerManager disposed
|
||||
[2025-10-23T03:49:26.833Z] ServerManager disposed
|
||||
[2025-10-23T04:35:00.860Z] ServerManager disposed
|
||||
|
||||
@@ -395,6 +395,14 @@ export class ChatWebviewProvider implements vscode.WebviewViewProvider {
|
||||
// Write the file
|
||||
fs.writeFileSync(overrideFilePath, JSON.stringify(overrideConfig, null, 2));
|
||||
|
||||
// Update webview to reflect that override file now exists
|
||||
if (this._view) {
|
||||
this._view.webview.postMessage({
|
||||
command: 'updateOverrideFileExists',
|
||||
exists: true
|
||||
});
|
||||
}
|
||||
|
||||
vscode.window.showInformationMessage(
|
||||
`Override file created at ${overrideFilePath}. Modify the tool configuration as needed.`,
|
||||
'Open File'
|
||||
@@ -908,7 +916,7 @@ export class ChatWebviewProvider implements vscode.WebviewViewProvider {
|
||||
{ text: '📦 Install Globally', action: 'register' },
|
||||
{ text: '📁 Install in Workspace', action: 'register' },
|
||||
{ text: '📊 Show Status', action: 'requestServerStatus' },
|
||||
{ text: '🛠️ Override Prompt', action: 'overridePrompt' }
|
||||
{ text: window.overrideFileExists ? '📁 Recreate Override File' : '📁 Create Override File', action: 'overridePrompt' }
|
||||
];
|
||||
|
||||
// Check for override file existence even when status unknown
|
||||
@@ -934,7 +942,7 @@ export class ChatWebviewProvider implements vscode.WebviewViewProvider {
|
||||
}
|
||||
|
||||
options.push({ text: '📊 Show Status', action: 'requestServerStatus' });
|
||||
options.push({ text: '🛠️ Override Prompt', action: 'overridePrompt' });
|
||||
options.push({ text: window.overrideFileExists ? '📁 Recreate Override File' : '📁 Create Override File', action: 'overridePrompt' });
|
||||
|
||||
// Check for HumanAgentOverride.json file existence (passed from extension)
|
||||
if (window.overrideFileExists) {
|
||||
@@ -992,6 +1000,10 @@ export class ChatWebviewProvider implements vscode.WebviewViewProvider {
|
||||
// Play notification sound
|
||||
console.log('Playing notification sound...');
|
||||
playNotificationBeep();
|
||||
} else if (message.command === 'updateOverrideFileExists') {
|
||||
// Update override file existence and refresh cog menu
|
||||
window.overrideFileExists = message.exists;
|
||||
console.log('Updated overrideFileExists to:', message.exists);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user