Repository navigation
refactor(app): move modules shared with the WebUI out of the desktop shell - #77
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
在 macOS 桌面端和已配对的 React WebUI(含 406px 窄屏)上实测了 共用 UI 与桌面端图片附件英文 → 简体中文切换、图标、加载指示、Pi 模型选择、可关闭的 toast、侧边栏会话时间、打开已有会话、分叉会话均正常。窄屏 WebUI 新建对话并收到了真实的 Pi 回复。桌面端在支持图片的模型下选择本地 PNG 后,输入框显示了附件名和缩略图。 已有的桌面端发送问题(main 上同样复现)Pi 回复之后约 2 分钟,桌面端把已发送的 prompt 恢复成草稿,并提示发送未确认。在 剪贴板粘贴图片、把图片实际发送给模型没有测试。 |
改动说明
web/src(React WebUI)和app/的两端共用层(chat/、composer/、state/、ui/)此前直接引用桌面专属目录app/shell/里的模块。这个 PR 把这些实际上两端共用的模块下沉到共用层,并加测试把关边界。app/state/:i18n、open-chat、session-fork、read-open-session、sidebar-projects、sidebar-session-age。app/ui/:app-toasts、app-toast-runtime、pi-logo、lucide-icons.json、lucide-icon-names.json、Lucide-LICENSE(scripts/generate-desktop-icons.mjs的输出路径同步修改)。LocalFileReader:composer-attachments、composer-store、chat-workspace原来通过Pick<DesktopShell, "readLocalFile">依赖app/shell/desktop-shell,改为依赖新的app/state/local-file-reader.ts,DesktopShell继承该接口。tests/unit/layer-boundaries.spec.mjs,禁止app/{chat,client,composer,lib,state,ui}和web/src引用app/shell/、app/settings/、app/hosts/。没有用 oxlint,因为它目前整体忽略app/和web/。AGENTS.md、app/README.md、.trellis/spec中的路径同步更新。绝大多数文件的改动只是 import 路径改写,没有行为变化。
验证方式
均在 macOS 上、rebase 到
b0e8a856之后执行并通过:pnpm checkpnpm testpnpm buildpnpm generate:icons --checknsh check(nsh 0.8.0 稳定版)nsh test(645 个测试)没有手动运行桌面端或 WebUI 做界面验证。
Link to Devin session: https://app.devin.ai/sessions/b13262aacab440eb9780b2eac9524bdb
Open in Devin Desktop: https://app.devin.ai/desktop/session/b13262aacab440eb9780b2eac9524bdb?variant=devin
Requested by: @hsingjui