Repository navigation
refactor(chat): 按职责整理聊天和工作区目录 - #94
Open
3316891527 wants to merge 4 commits into
Open
3316891527 wants to merge 4 commits into
3316891527 wants to merge 4 commits into
Conversation
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.
变更说明 / Description
工作区和聊天代码沿用历史
chat.webview、components等归类,文件浏览、编辑器、预览、消息渲染和输入功能的边界不清楚。本次新增提交按现有职责迁移目录和共享声明,使维护者能够按功能定位代码,并保持现有执行逻辑。本分支以 #93 的文件操作实现为基线,目标分支仍为
dev,因此当前完整 diff 同时包含 #93 的前置改动;目录整理提交为d4e90bd1,补充提交029426a5修正 Android Test 的 XML 字符串写法。当前增量评审范围为9b9bb75d..029426a5;三份功能改动另在 #95 中联合验证。背景与动机 / Context and motivation
原
conversation.chat.webview同时包含工作区、编辑器、文件浏览器、网页预览、提及候选和终端入口。工作区迁出后,chat仍有 13 个直属子包,部分共享状态类型定义在具体 UI 文件里,增加了定位和维护引用的成本。改动范围 / Changes
将工作区、浏览器、编辑器和预览迁入
ui.features.conversation.workspace,主页与导航归入workspace.hub,终端入口归入automation.terminal,移除旧工作区包路径,原入口和运行行为保持一致。将聊天根层整理为
screens、modules、foundation、viewmodel,按输入、消息、附件、历史、角色、语音、分享、侧栏、导出和用量组织功能,减少同一功能分散在多个根包的问题。在
chat.foundation.model原样提取 9 个共享声明到 6 个文件,保留名称、字段、默认值和可见性,让队列存储与状态协调能够直接引用共享声明。同步显式导入、原同包引用、全限定名和相关测试路径,保留列表源码的来源版本及许可说明,补充逐文件迁移清单、静态验证记录和完整回归范围。
在
app/src/androidTest/.../ToolCardStreamBoundaryAndroidTest.kt中将 4 处包含 XML 属性双引号的测试数据改为 Kotlin 三引号原始字符串,保留插值和原有 8 项测试断言,避免属性值被解析为 Kotlin 标识符。前置文件操作改动与范围
当前 diff 包含 #93 的已有实现:
core/files/transfer以固定缓冲区复制本机文件,工作区复制、移动和删除使用进度窗口,失败或取消按既有工具路由处理。复制和删除对应的 17 条 JVM 回归用例及 9 组界面语言资源一并保留。本次新增目录整理提交没有调整发送、流式渲染、工具调用、文件操作、语音或导出的执行规则,没有拆分 Gradle 模块或拆解
ChatViewModel内部逻辑。兼容性与风险 / Compatibility and risks
Kotlin 源码包路径和测试包路径发生变化,仓库内调用已同步。应用名字、application ID、logo、工作区实际文件目录、数据库、配置格式和预览服务端口不因本次目录整理改变。
迁移风险主要是遗漏包引用;已完成声明体与引用映射核对,编译和运行结果仍待仓库 CI 与 Android 界面回归。
关联 Issue / Related issue
N/A:本次新增提交属于内部目录维护,由现有职责混杂的问题触发。前置 PR:#93。工具与权限整理 #92 已在集成 PR #95 中共同验证;#95 的同一测试文件已包含相同的字符串修正。
验证方式 / Verification
静态证据与完整回归记录
两轮整理合并对照了 1938 个既有 Kotlin、Java 源文件;除包路径、导入和清单内原样提取的共享声明外,声明体一致。聊天部分核对了 374 处显式导入、46 处原同包引用,保留全部 19 个既有聊天回归类。
证据 / Evidence
Android Tests 分支入口。原目录整理提交的手动派发已受理;本次补充提交未手动派发工作流。此链接为工作流分支筛选页,不代表结果已经通过。
检查清单 / Checklist
dev;如目标为main,我已说明这是维护者发布同步 / The target branch isdevfor regular work; if it ismain, I explained why this is a maintainer-led release syncCandidate checks覆盖改动范围,并会处理技术失败项 /Candidate checkscovers the change scope and technical failures will be addressed