Repository navigation
Unify the chat workbench and application shell (startup contract fixed) - #1503
Open
Zhong-Chenchen wants to merge 17 commits into
Open
Zhong-Chenchen wants to merge 17 commits into
Zhong-Chenchen wants to merge 17 commits into
Conversation
Keep upstream main's newer chat, credential, runner, SOP and settings behaviour and re-apply the unified entry changes on top of it instead of reverting them. - The workbench mounts in the page (#chatRoot) and the shell talks to it through window.loopforgePlatform; the iframe bridge stays only for embedded surfaces such as the SOP orchestrator and previews. - Project, session, issue, theme, sidebar, environment, credential, assistant-preference, quick-access-return and requirement-handoff updates travel through the shared application state. - /chatbot/ still redirects to the platform entry, except for embedded ?surface= requests, so the SOP orchestrator panel keeps working. - Upstream tests are kept: chatbot vitest, webtest and the Go suites pass as they do on main.
The platform shell links a single /chatbot/assets/workbench.css. Vite split the static CSS graph into workbench.css and workbench2.css, so the unified workbench loaded only the first half: the home hero and composer lost their layout and the executor and mention menus overflowed the viewport at short and mobile sizes. Disable CSS code splitting so the pinned stylesheet name holds the whole graph.
The platform translates the chat UI inside the unified shell, including aria-labels, so the chip's "移除引用 <name>" label became "Remove reference <translated name>" and lost the reference's own name. Split the accessible name into a translated prefix and a name node that opts out of translation, matching the visible chip, and let the references spec expect the English prefix in the English variants.
Resolve the requirement-composer source assertion: the handoff now travels
through platformNotify('mentionIssue') and upstream renamed the SOP label to
LOOP.
# Conflicts: # chatbot/src/App.jsx # web/app.js # web/syntax_test.go # webtest/tests/composer-flow.test.mjs
# Conflicts: # chatbot/src/App.jsx # chatbot/src/RichContent.jsx # chatbot/src/useChat.js # web/app.js
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.
Closes #118
这个 PR 是什么
把首页的 React 对话工作台从同源 iframe 搬到主文档的
#chatRoot,删掉agentflow-chat-ready握手和多种父子窗口消息,让管理导航与聊天共享同一个文档;保留 LOOP 编排与内容预览的隔离。原 PR #990 完成了这个结构迁移,但评审时发现启动与状态的归属没有收敛成一个契约,派生出一个 P1 和若干行为回归。这个分支在原结构上把它们修掉了,并已合入最新
main(含 #1434 knowledge、#1440 aiSchedules、#1450 privileged Docker sandboxes in settings 等)。相对
main:77 个文件,+1796 / −818,17 个提交。原 #990 将关闭,讨论历史留在那边。修的问题
P1 · 聊天模块失败会带塌整个平台
原来
web/app/start.js只注册window.loopforgeBootstrap,启动被挪到chatbot/src/main.jsx的 effect 里。入口 JS 或其静态依赖 404 / 解析失败时该 effect 不存在,内部.catch()捕不到,boot()里的鉴权、bind()、首屏路由、loader 收尾都不执行 —— 设置页、需求页全部进不去。现在原生启动器自己持有幂等
bootPromise,聊天只消费就绪状态;聊天失败只在工作台区域内显示可重试错误,其它页面照常可用。CSS 也一并处理:聊天样式加载不再阻塞原生启动脚本,样式挂起或 404 时给区域级错误与重试,不会出现无样式工作台。行为回归
?inline样式一起改写,注入管理页 ShadowRoot 后匹配不到祖先,.composer从relative变static、textarea 112px 变 60px、@弹层失去定位。现在 scope 转换只作用于工作台样式表。?chatSession=s-1#/collaboration,从会话详情进入会清空当前会话、从设置进入会保留。现在路由收敛成单一解析,首次加载 / 同页 hash / 跨页 / 前进后退共用,消费入站路由不再回写 URL。document再到window,Ctrl/⌘+K 会同时弹出两套搜索框并抢焦点;模型菜单展开时一次 Escape 会关掉两层。现在单点派发、下游尊重defaultPrevented、Escape 只由最上层消费并回焦。新建需求→New requirement),可复制内容不再是模型原文。现在消息正文、Markdown、产物内容与对象名标记为不可翻译,翻译只作用于 UI 标签。入口与缓存
immutable,固定名继续no-store。surface返回 404,旧/chatbot/迁移链接 302 回宿主。subscribeState、从未赋值的bootLoaderTimer等死代码。测试与门禁
unified-entry用例(它还在按SOP文案找元素,界面早已是 LOOP),并把确定性浏览器用例接进 head 构建的 browser job。验证
go build ./...(-buildvcs=false)、go vet ./...go test ./web、定向internal/httpapi/ schedule 用例chatbotVitestwebtestchatbot/browser/unified-entry.test.mjs合并后
git merge-base --is-ancestor origin/main HEAD成立,分支落后main0 个提交。已知限制
knowledge(feat: bind knowledge MCP services to workflow nodes and chat sessions #1434)与aiSchedules(feat(schedule,chat): 会话侧栏双栏分栏(个人 / 定时任务)与定时任务立即执行及直达最近执行 #1440)深层交互只有自动化套件覆盖,未做人工点检。go test ./...在本机仍有环境性失败(Chromium 启动、缺libiconv、internal/httpapi包级超时),这些在main上同样复现,不是本分支引入。说明
评审发现的问题由独立评审会话复核过两轮;本分支的问题清单与解决方式逐条对应,未夹带与本 PR 无关的重构。