Remove conversation grouping feature

This commit is contained in:
temp
2026-08-26 15:00:09 +08:00
parent fbbe984005
commit c70da22de7
26 changed files with 467 additions and 5276 deletions
+279 -2286
View File
File diff suppressed because it is too large Load Diff
@@ -8,18 +8,20 @@ const template = fs.readFileSync('web/templates/index.html', 'utf8');
function functionSource(source, name, nextName) {
const start = source.indexOf(`function ${name}(`);
const end = source.indexOf(`function ${nextName}(`, start);
const end = nextName ? source.indexOf(`function ${nextName}(`, start) : source.length;
assert.notEqual(start, -1, `${name} should exist`);
assert.notEqual(end, -1, `${nextName} should follow ${name}`);
if (nextName) {
assert.notEqual(end, -1, `${nextName} should follow ${name}`);
}
return source.slice(start, end);
}
test('全局置顶检查接口结果并即时通知项目文件夹', () => {
const source = functionSource(chat, 'pinConversation', 'showMoveToGroupSubmenu');
const source = functionSource(chat, 'pinConversation');
assert.match(source, /assertConversationActionResponse\(updateResponse, '更新置顶状态失败'\)/);
assert.match(source, /notifyConversationPinnedChanged\(convId, newPinned\)/);
assert.match(source, /loadConversationsWithGroups\(\)/);
assert.match(source, /loadConversations\(\)/);
});
test('项目文件夹内置顶对话优先排序并显示图钉', () => {
@@ -58,17 +60,20 @@ test('项目文件夹菜单可以置顶并立即更新排序', () => {
assert.match(projects, /\[\.\.\.pinnedProjects, unassignedProject, \.\.\.regularProjects\]/);
});
test('对话侧栏不再显示对话分组区域', () => {
test('对话侧栏只保留最近对话区域', () => {
assert.doesNotMatch(template, /class="conversation-groups-section"/);
assert.doesNotMatch(template, /id="conversation-groups-list"/);
});
test('删除对话分组检查接口结果并先清理本地状态', () => {
const deleteSource = functionSource(chat, 'deleteConversationGroupById', 'deleteGroup');
const contextSource = functionSource(chat, 'deleteGroupFromContext', 'closeGroupContextMenu');
test('对话三点菜单仍绑定打开上下文菜单', () => {
const itemSource = functionSource(chat, 'createConversationListItemWithMenu', 'openConversationContextMenuForId');
const menuSource = functionSource(chat, 'showConversationContextMenu', 'ensureConversationRenameModal');
assert.match(deleteSource, /assertConversationActionResponse\(deleteResponse, '删除分组失败'\)/);
assert.match(deleteSource, /removeConversationGroupFromLocalState\(groupId\)/);
assert.match(deleteSource, /if \(currentGroupId === groupId\) exitGroupDetail\(\)/);
assert.match(contextSource, /deleteConversationGroupById\(groupId, \{ closeContextMenu: true \}\)/);
assert.match(itemSource, /menuBtn\.onclick = \(e\) => openConversationContextMenuForId\(e, conversation\.id, conversation\.title \|\| ''\)/);
assert.match(menuSource, /const menu = document\.getElementById\('conversation-context-menu'\)/);
assert.match(menuSource, /menu\.style\.display = 'block'/);
assert.match(chat, /function clearDownloadMarkdownSubmenuHideTimeout\(/);
assert.match(chat, /function handleDownloadMarkdownSubmenuEnter\(/);
assert.match(chat, /function handleDownloadMarkdownSubmenuLeave\(/);
assert.match(chat, /function hideDownloadMarkdownSubmenu\(/);
});
-1
View File
@@ -12,7 +12,6 @@
'skill-modal',
'agent-md-modal',
'batch-manage-modal',
'create-group-modal',
'workflow-meta-modal',
'workflow-dry-run-modal',
'login-overlay',
+2 -4
View File
@@ -2999,11 +2999,9 @@ function handleStreamEvent(event, progressElement, progressId,
loadActiveTasks();
// 延迟刷新对话列表,确保用户消息已保存,updated_at已更新
// 这样新对话才能正确显示在最近对话列表的顶部
// 使用loadConversationsWithGroups确保分组映射缓存正确加载,无论是否有分组都能立即显示
// 刷新最近对话列表
setTimeout(() => {
if (typeof loadConversationsWithGroups === 'function') {
loadConversationsWithGroups();
} else if (typeof loadConversations === 'function') {
if (typeof loadConversations === 'function') {
loadConversations();
}
if (typeof window.refreshChatProjectFolders === 'function') {
+1 -10
View File
@@ -6,7 +6,7 @@
'use strict';
const GLOBAL_WRITE_HANDLER_PERMISSIONS = {
// 对话 / 分组
// 对话
sendMessage: 'chat:write',
startNewConversation: 'chat:write',
deleteConversation: 'chat:delete',
@@ -16,15 +16,6 @@
deleteSelectedConversations: 'chat:delete',
renameConversation: 'chat:write',
pinConversation: 'chat:write',
showCreateGroupModal: 'group:write',
createGroup: 'group:write',
editGroup: 'group:write',
deleteGroup: 'group:delete',
deleteGroupFromContext: 'group:delete',
pinGroupFromContext: 'group:write',
renameGroupFromContext: 'group:write',
applyBatchGroupChange: 'group:write',
applyCustomIcon: 'group:write',
// 人机协同
applyHitlSidebarConfig: 'hitl:write',
+1 -1
View File
@@ -2557,7 +2557,7 @@ function selectWebshell(id, stateReady) {
'<svg class="role-selector-arrow" width="10" height="10" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>' +
'</button>' +
'<div id="ws-role-selection-panel" class="role-selection-panel" style="display:none;">' +
'<div class="role-selection-panel-header"><h3 class="role-selection-panel-title">' + (wsT('chatGroup.rolePanelTitle') || '选择角色') + '</h3>' +
'<div class="role-selection-panel-header"><h3 class="role-selection-panel-title">' + (wsT('chat.rolePanelTitle') || '选择角色') + '</h3>' +
'<button type="button" class="role-selection-panel-close" onclick="wsCloseRolePanel()"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>' +
'</div><div id="ws-role-selection-list" class="role-selection-list-main"></div></div>' +
'</div>' +