Repository navigation
feat(desktop): Chat 会话支持重命名并显示进行中状态 - #141
Merged
Merged
Conversation
This was referenced Nov 10, 2026
codesstar
force-pushed
the
feat/v130-chat-rename-running
branch
from
November 11, 2026 08:51
d23fcf9 to
317b702
Compare
Cloud Chat rows only offered move and delete. They now rename like Work rows: a Rename menu item and a title double-click open a dialog that posts to BiSheng's existing POST /api/v1/chat/conversation/rename under the same history grant deletion uses. The main process validates the name against message_session.name (1-255 characters, no control characters) and tells the open enterprise document so it can reread the conversation name. The native Chat view yields while the dialog is open, as for deletion. The enterprise document can now report which conversations are still generating (reportRunning). The host validates the report from the current main frame, keeps it per document and identity, and the sidebar shows the same ongoing StateDot as Work rows with a screen-reader label. Older documents that never report leave the list unchanged. Tests: rename and activity contracts in enterprise-chat-view, real-primitive dialog/row coverage in cloud-chat-rename-running, native view yielding in desktop-modes-ui; fixtures updated for the new overlay and navigation fields.
…results Project pages and the current search keep their own copies of a conversation, so a rename now updates them in place (they are ordered by creation time and are not reread). A page requested before the rename finished keeps the new name. Every row the sidebar shows can open the rename dialog; the host still checks its own routes.
codesstar
force-pushed
the
feat/v130-chat-rename-running
branch
from
November 11, 2026 10:12
317b702 to
3d66574
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chat 模式梳理中的两项:云端会话不能重命名,进行中的会话没有进度提示。Work 会话行两者都有,Chat 行原先只有“移入项目 / 删除”。(替代 #138:#136 已合入,本 PR 直接基于
V1.3.0,只含本次改动。)重命名
POST /api/v1/chat/conversation/rename,沿用删除的授权方式:可信窗口与主 frame、当前账号代际、会话须已出现在本账号当前的历史或项目 / 搜索读取结果中(主进程routes)。名称按message_session.name校验(去首尾空白后 1–255 字符,不含控制字符)。成功后通知嵌入网页重新读取会话名;失败不通知。进行中提示
dshChatPresentation.reportRunning上报仍在生成的会话。主进程只接受当前主 frame、当前路径(report.path === url.pathname,在ipc-message入口对所有上报统一校验)的上报,按 id 格式与数量(≤100)校验,文档重载或账号变化时清空。进行中状态仅用于展示,不参与授权。StateDot进行中图标(沿用其减少动态效果处理),悬停卡片同步显示“进行中”,并通过aria-describedby提供读屏文案。feat/3.1.0-beta1)。未升级的网页不会上报,客户端保持现状、不报错。基于
V1.3.0@a17dc3cd。验证
npm run typecheck、npm run build、git diff --check通过;npm test完整回归 355 个文件:3,667 项通过,5 项按环境条件跳过,0 失败。test/cloud-chat-rename-running.test.mjs(真实 primitives):菜单 / 双击打开、组字、失败重试、账号切换丢弃;项目分页中不在已加载历史页的旧会话、三类搜索结果(不在历史且无项目 / 有项目但不在历史 / 同时在历史)改名后行标题更新;改名前发出的项目分页或搜索结果晚到不带回旧名,改名后的读取以服务端为准;进行中图标在历史、项目分页、搜索结果三处显示。项目 / 搜索相关的 6 条在修复前的实现上全部失败。test/enterprise-chat-view.test.ts补主进程契约:改名成功与通知;越权、非法 / 超长名称、控制字符、失败响应、登出丢弃;只由项目分页或搜索结果列出的会话可以改名(去掉projectConversations的路由登记时这两条失败)。进行中上报覆盖非主 frame、路径不符、伪造 id、非数组、超量;拒绝用例显式从主 frame 发送,确保执行到路径和列表校验(逐项去掉主 frame、路径、id、数量检查时,各只有对应一条失败)。test/desktop-modes-ui.test.mjs补弹窗期间原生视图让位;菜单项断言由['Move to project', 'menu']改为['rename', 'Move to project', 'menu'](新契约:云端行菜单以重命名开头,与 Work 一致)。test/desktop-client-ui.test.ts的槽位注册列表多一个shell.overlay(重命名弹窗)。搜索夹具、账号展示夹具同步新增的renaming与running字段。真实环境(macOS 开发版,109 测试服务器,2026-11-11,基于本 PR 当前提交)
aria-modal,预填原名并全选;弹窗期间嵌入 Chat 页面visibilityState为hidden,关闭后恢复visible;名称去首尾空白后写入服务端(经history重读确认,update_time同步更新),侧栏行即时更新。dshChatPresentation.reportRunning,对应行出现StateDot与读屏文案“进行中”,图标不遮挡标题;伪造 id 被拒(日志invalid_running_report)并保持原列表;清空后消失。/api/v1/chat/projects/*返回 404),项目分页与服务端搜索结果的改名只有自动化测试覆盖,未做真实环境验证。未完成 / 已知限制
feat/3.1.0-beta1上已校验会话归属(53afe2a71),早先描述中“未校验”的说法有误。