Repository navigation
fix(web): 编辑「不使用 LOOP」的需求时选中的 LOOP 能真正绑定;Markdown 行内代码保留空格 - #1516
Open
Robert0622 wants to merge 1 commit into
Open
Robert0622 wants to merge 1 commit into
Robert0622 wants to merge 1 commit into
Conversation
…ep spaces in inline code Editing a requirement delivered without a LOOP and picking a LOOP echoed sopMode "none" back, so the server dropped the LOOP while the operation log recorded "关联 LOOP" and dispatch then failed. Picking a LOOP there now sends "sop" (and restores scheduling unless the checkbox was changed), the empty option reads "不使用 LOOP", dispatch without a LOOP explains what to do, and the audit only records "关联 LOOP" when one is actually stored. Inline code in rendered Markdown collapsed runs of spaces (white-space normal); it now keeps them like the chatbot does and wraps long tokens. Co-Authored-By: Claude Code <noreply@anthropic.com>
Collaborator
Author
crispinhu27
approved these changes
Nov 27, 2026
crispinhu27
left a comment
Collaborator
There was a problem hiding this comment.
审查范围(head e27f508e,base fd039e51)
初审。逐行读过 7 个文件的完整 diff,并沿调用链核对了 issueFromForm / openIssue / dispatchIssue、internal/repo/issues.go 的保存归一化(prepareIssueForSave、bindDefaultWorkflow)、internal/httpapi/issues.go 的 issueChangeDetail,以及绑定接口 PUT /api/issues/:id/sops 既有的 sop 抬升规则。
实际验证
在隔离环境(无 GitHub 凭据的独立用户、独立 MariaDB 11.8 与数据库、独立端口)分别部署 fd039e51(对照)与 e27f508e,用真实 Chromium 驱动界面复现与复核:
- A 修复前(
fd039e51):编辑「不使用 LOOP」需求(sopMode:none)→ 空选项文案是「使用来源默认流程」;选中 LOOP 保存后GET仍为sopMode:none、workflowId为空,操作日志却记「关联 LOOP」。与描述一致,确认是本 PR 修复的问题。 - A 修复后(
e27f508e):同一操作后workflowId=cr1516-fix、sopMode清空、automationState=eligible,操作日志记一条「关联 LOOP」。只改优先级保存时仍为none/ignored,日志只记「优先级」,不再误记。英文界面空选项显示No LOOP。普通 LOOP 需求空选项仍是「使用来源默认流程」,保存不受影响。 - B:真实页面样式下
renderRequirementMarkdown渲染的`slugify("Hello, World!")`计算样式为white-space: break-spaces、overflow-wrap: anywhere,textContent保留两个空格;1440px 与 300/320px 宽度下容器无横向溢出。
自动化:go build ./...、go vet ./internal/httpapi/ ./web/、go test ./web/ 通过;go test -run TestRequirementWithoutSOPEditAuditMatchesStoredLOOP ./internal/httpapi/ 通过;webtest 全量 399/399 通过。CI 在该 head 上 16 项全部 success(core、platform-required、browser、e2e 均绿)。
结论
未发现本 PR 引入的可确认缺陷,按现有证据批准。两点说明,不阻塞:
issueChangeDetail判断「是否真的绑定了 LOOP」用的是请求里的sopMode,而不是落库后的实体;当前服务端归一化下两者一致(bindDefaultWorkflow会保留非空workflowId),所以行为正确,但若将来归一化新增「丢弃无效 workflowId」的规则,这行需要同步。- PR 描述里的真实 LOOP 多执行器运行、私有库 PR #2 等属于作者环境,本次未独立复验;本结论只覆盖前端交付方式切换、审计日志与行内代码样式这三项可复现的行为。
(GitHub 接口不支持在评论里附图,截图与驱动脚本留在审查侧临时工作区,未上传。)
This was referenced Nov 27, 2026
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.













本 PR 修复 11-28 04:00 全量走查(main
fd039e51)中确认的两个前端缺陷。两个问题都先在 main 上复现,修复后又在真实部署(MariaDB + 真实 LLM 执行器 + 私有库)上验证过。截图托管在 Robert0622/LoopForge release
review-assets-sweep-1128-0400。A. 编辑「不使用 LOOP」的需求时选了 LOOP,保存后 LOOP 被丢掉,操作日志却记成「关联 LOOP」,执行也会报错
问题原因
web/app/issues.js的编辑表单issueFromForm会原样回传旧的sopMode:"none"。服务端归一化(internal/repo/issues.go)看到WithoutSOP()就会清空workflowId,所以用户刚选的 LOOP 被静默丢掉。internal/httpapi/issues.go的issueChangeDetail在归一化之前比较workflowId,于是操作日志写了「关联 LOOP」,但库里实际并没有关联。none和刚选的 LOOP 一起发出去,服务端返回该需求不使用 LOOP,请先选择要运行的 LOOP。复现(main)
Textkit 缺陷修复 LOOP),保存,界面提示保存成功。/api/issues/:id返回sopMode:"none"、workflowId:""。该需求不使用 LOOP,请先选择要运行的 LOOP。修复方案
issueFromForm:对「不使用 LOOP」的需求,只要用户在这里选了 LOOP,就视为切换为 LOOP 交付,发送sopMode:"sop",与绑定接口PUT /api/issues/:id/sops的语义一致。ignored(不参与自动调度)是「不使用 LOOP」模式带来的,所以只要用户没有改动这个复选框,就发送空的automationState,由服务端恢复可调度。用户主动勾选过的话保留ignored。none,不改变「编辑不丢失不使用 LOOP 的选择」这一既有约定(已有用例覆盖)。dispatchIssue:「不使用 LOOP」且没选 LOOP 时,直接提示「这条需求不使用 LOOP,请先选择要运行的 LOOP」,不再发出注定失败的请求。issueChangeDetail:只在保存后真的存下了 LOOP(after.WorkflowID != "" && !after.WithoutSOP())时才记「关联 LOOP」。修复后
sopMode变为sop,workflowId等于所选 LOOP,automationState变为eligible,操作日志记「关联 LOOP」。B. Markdown 行内代码把连续空格压成一个
问题原因
web/artifacts.css里共享的.markdown-body code:not(pre code)没有设置white-space,于是继承了normal,`Hello, World!`会显示成Hello, World!。在需求、断言、命令参数这类场景里,空格本身就是信息。chatbot 端的.markdown code早已使用white-space: break-spaces,两端表现不一致。受影响的地方:需求描述、运行/审批中的产物预览、技能库 Markdown、资产预览。这些地方都使用同一条规则。
修复方案
在这条共享规则里加上
white-space: break-spaces; overflow-wrap: anywhere,保留空格,同时让超长 token 能换行,不撑破容器;index.html同步更新artifacts.css的缓存版本号。起初还试过
box-decoration-break: clone,但它会让换行后的行内代码溢出容器约 4px,所以最后没有采用。宽度 1440 和 390 下均已确认没有溢出。测试
新增用例。以下三项在 main 上都会失败,加上修复后通过:
internal/httpapi/issue_sop_mode_test.goTestRequirementWithoutSOPEditAuditMatchesStoredLOOP:none+workflowId保存时,需求仍为不使用 LOOP,操作日志只记「优先级」。sop+workflowId时,LOOP 已绑定,状态为eligible,操作日志记「关联 LOOP」。webtest/tests/issue-no-sop.test.mjs:sop并恢复调度;动过复选框时保留 ignored;没选 LOOP 时执行不发请求并给出提示;选了 LOOP 时执行发送所选 LOOP。webtest/tests/markdown-inline-code.test.mjs:共享规则保留空格,且没有其他样式表把它覆盖回 normal/nowrap;渲染后的需求描述保留了双空格。回归:
go vet ./internal/httpapi/ ./web/通过,go test ./web/通过。go test ./internal/httpapi/:只有TestMainBotBrowserStartsAndDrivesRunBrowser、TestBrowserStreamPushesFramesAndRunsCommands两个用例失败,原因是本机没有 Chromium;main 上同样失败。影响与风险
sop抬升规则。pre code代码块不受影响。另外,本轮在真实返工中又复现了「退回/重试时补充上下文在提示词里重复出现」的问题(main 上 implement 的提示词里同一段上下文出现了 3 次)。这个问题已有 #1490 在修,修法相同,因此本 PR 不重复修改
approvals.js;验证结果写在 #1490 的评论里。🤖 Generated with Claude Code