mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 01:07:46 +00:00
refactor(vscode): 重构消息排序和展示逻辑
- 移除旧的消息排序改进总结文档 - 重新组织消息渲染逻辑,合并所有类型的消息按时间戳排序 - 优化工具调用处理流程,添加时间戳支持 - 改进会话保存机制,直接使用SessionManager保存检查点 - 重构部分组件以提高可维护性
This commit is contained in:
@@ -25,6 +25,8 @@ export class SessionMessageHandler extends BaseMessageHandler {
|
||||
'getQwenSessions',
|
||||
'saveSession',
|
||||
'resumeSession',
|
||||
// UI action: open a new chat tab (new WebviewPanel)
|
||||
'openNewChatTab',
|
||||
].includes(messageType);
|
||||
}
|
||||
|
||||
@@ -82,6 +84,24 @@ export class SessionMessageHandler extends BaseMessageHandler {
|
||||
await this.handleResumeSession((data?.sessionId as string) || '');
|
||||
break;
|
||||
|
||||
case 'openNewChatTab':
|
||||
// Open a brand new chat tab (WebviewPanel) via the extension command
|
||||
// This does not alter the current conversation in this tab; the new tab
|
||||
// will initialize its own state and (optionally) create a new session.
|
||||
try {
|
||||
await vscode.commands.executeCommand('qwenCode.openNewChatTab');
|
||||
} catch (error) {
|
||||
console.error(
|
||||
'[SessionMessageHandler] Failed to open new chat tab:',
|
||||
error,
|
||||
);
|
||||
this.sendToWebView({
|
||||
type: 'error',
|
||||
data: { message: `Failed to open new chat tab: ${error}` },
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
console.warn(
|
||||
'[SessionMessageHandler] Unknown message type:',
|
||||
|
||||
Reference in New Issue
Block a user