Skip to content

fix(web): 修正空状态与提示文案,补充 Cursor 密钥前缀说明 - #1443

Open
eust-w wants to merge 6 commits into
Tencent:mainfrom
eust-w:consolidate/g2
Open

eust-w wants to merge 6 commits into
Tencent:mainfrom
eust-w:consolidate/g2

Conversation

@eust-w

@eust-w eust-w commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

问题

若干空状态 / 提示文案不准确或误导:

修改

  • 运行 / 角色:区分“完全没有数据”和“搜索筛选无匹配”,前者提示从需求列表启动。
  • 需求搜索:有关键词时提示“未找到与当前关键词匹配的需求”;仅有筛选时提示筛选无匹配;同步 / 新建引导只在无搜索无筛选时显示。
  • 模板页:项目有默认 LOOP 时,空状态写出该 LOOP 及来源(通用模板 / 团队共享 / 内置 / 本项目),(名称已转义)。不改变运行时规则,也不对“默认 LOOP 对哪些需求生效”下结论。
  • 讨论区:说明这里只展示已有评论、暂不能直接发表,沟通请到“会话”页签(仅文案,不涉及产品行为变更)。
  • Cursor:凭据说明改为新密钥以 grok_ 开头、旧 crsr_ 仍可用;仅用于 clilive 构建标签下的测试日志脱敏的前缀列表补上 grok_(没有运行时校验)。代码里没有找到前缀校验,[Bug]: cursor的密钥已经全部使用grok_开头了,没有crsr_的密钥了 #959 的真实原因可能另有其因,故只用 Refs。
  • 新增 / 更新对应 webtest 与英文翻译。

Fixes #1353
Fixes #1355
Refs #1356
Refs #1364
Refs #959

验证

  • webtest 全量通过(388,已 rebase 到最新 main)。
  • go build ./internal/runtime/ 通过,gofmt 无新增问题。
  • 未运行 Go 测试全量、go vet -tags clilive(需要前端构建产物),未做浏览器目测。

本 PR 合并了此前单独提交的 #1415、#1417、#1419、#1421、#1423。

🤖 Generated with Claude Code

@cocofhu cocofhu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

合并前需要先 rebase:当前和 main 冲突。#1314 在这之后改了 web/i18n-en.js 和 web/app/runs.js。

grok_ 只加进了 //go:build clilive 的 redactLive,没有运行时校验。指引文案可以留,说明里的「日志脱敏」建议改成测试日志。

运行、角色、需求搜索的空状态区分是对的。

Comment thread web/app/sops.js Outdated
const def=id&&(state.data?.workflows||[]).find(w=>w.id===id);
if(!def)return base;
const source=def.generic?'通用模板':def.projectId?(def.projectId===project.id?'本项目':'团队共享'):'内置';
return `当前项目默认使用「${def.name||def.id}」(${source}),仅新需求适用;本项目还没有自建或复制的 LOOP。可切换到对应范围查看,或复制后修改。`;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def.name 直接拼进后面的 sopCatalog.innerHTML。LOOP 名称是用户能写的,这里要用 escapeHTML(def.name || def.id)。

「仅新需求适用」把 #1356 里标成待确认的规则写成了事实。issue.workflowId 为空时,defaultSOPForIssue() 仍会用项目默认 LOOP,不限新建。建议删掉这句,或改成「已单独绑定 LOOP 的需求不会跟着变」。这句是动态拼出来的,英文词典也配不上。

@cocofhu cocofhu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先不要合。和 main 冲突;默认 LOOP 名称拼进了 innerHTML,需要转义;「仅新需求适用」把还没确认的规则写成了事实。具体见上面的行内评论。

eust-w and others added 6 commits November 26, 2026 04:38
…daction

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fixes Tencent#1356

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… claim

Address review: the name was interpolated into innerHTML unescaped, and
"仅新需求适用" stated a rule that Tencent#1356 still marks as unconfirmed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@eust-w

eust-w commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

感谢 review,已按意见修改并 rebase 到最新 main(冲突已解决):

  • def.name 现在用 escapeHTML(def.name || def.id) 转义,并补了一个名称含 <img ...> 的测试,确认不会生成元素。
  • 删掉了“仅新需求适用”,不再对默认 LOOP 的适用范围下结论,也就不再有动态拼接导致英文词典对不上的问题。
  • PR 说明里的“日志脱敏”已改成:grok_ 只加进了 clilive 构建标签下的测试日志脱敏前缀,没有运行时校验;[Bug]: cursor的密钥已经全部使用grok_开头了,没有crsr_的密钥了 #959 仍用 Refs。

webtest 全量通过(388)。

@eust-w

eust-w commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@cocofhu 已按上面的评论修改并推送,麻烦有空时再看一下,谢谢。

@Robert0622 Robert0622 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review & Deploy Test: PASS ✅

Reviewed changes: Empty states now distinguish "no data at all", "nothing matches search", and "nothing matches filters" for both issues and runs. LOOP empty state names the project's default LOOP with XSS-escaped output. Discussion tab explains read-only. Cursor key note adds grok_ prefix, live-test redaction list updated.

Deploy test: Service running, all endpoints accessible.

Minor notes (non-blocking):

  • P3: Production diagnostics (diagnosticKey) still doesn't cover crsr_/grok_ — only the live-test helper was updated (pre-existing gap).
  • P3: "点击搜索框右侧 ×" relies on browser's native clear button, which Firefox does not show.

loopforge-pr-review:62e78cb8e407d35032b7aced6f701b929656b13d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants