📄 精简全部 Issue 模板,降低反馈门槛#1593
Merged
Merged
Conversation
cyfung1031
marked this pull request as ready for review
July 16, 2026 13:21
Member
|
是不是太过于复杂了,新功能和版本、浏览器没关系的,除非用户一开始就搞错了,应该是要提bug 而且复杂的模板,有点打击反馈积极性 现有的模板我也想都再简化/减少一点 |
Collaborator
Author
都可以~ 没所谓 |
功能请求模板回退浏览器/ScriptCat 版本等必填环境字段:新功能与版本、 浏览器无关,误报的 bug 应引导去 Bug 模板,而不是让所有人多填几栏。 顶部只保留一句「功能失效/以前能用现在不行请改用 Bug 模板」的提示。 同时精简其余模板: - 删除全部分类下拉框(问题类型/功能领域/文档领域/翻译类型/涉及模块等), 这些由维护者打 label 更准,对提交者只是负担 - Bug 模板的渠道/Manifest/系统/设备类型/浏览器状态合并为一个 browser 字段 - 各模板的可选长尾字段合并为一个「补充信息」 保留 issues/new 预填链接的契约:模板文件名不变,popup「报告问题」用到的 scriptcat-version、browser 两个 id 保留,已安装的旧版本预填同样不受影响。 必填项:Bug 11→5,功能请求 4→3,兼容性 9→7,文档 7→4,翻译 7→5, 技术方案 4→2;总行数 1583→772。中英文模板结构保持一一对应。
Member
|
考虑到会的用户就算没有这些选项也会很好的反馈,不会的用户看到这么多选项会被劝退或者乱填 砍得比较激进 |
模板改动在 review 里几乎看不出问题:YAML 里一个未加引号的 `: ` 会让 GitHub 直接拒绝渲染表单,而中文模板用全角「:」不受影响,diff 上两边看起来一模一样; 字段 id 改名则会让 popup「报告问题」链接的预填静默失效——GitHub 丢弃未知参数, 且已安装的旧版本会一直沿用旧参数名。 scripts/check-issue-templates.mjs 检查三件事: 1. YAML 合法性 + issue-form schema(顶层键、元素类型、id 唯一、markdown 不带 id/validations、dropdown/checkboxes 有选项、checkboxes 不用 validations) 2. 中英文模板(0N ↔ 1N)字段序列、必填性、title/type/labels、选项数量一一对应 3. src/ 中构造的 issues/new 预填链接,其每个参数都能对应到目标模板的真实字段 id —— 用 TypeScript AST 解析而非字符串匹配,解析不出目标模板时报错而非放行 接入 lint / lint:ci(CI 的 Lint job 自动覆盖)与 .husky/pre-commit(校验暂存 快照而非工作区,与 check:i18n 一致)。
Collaborator
Author
不执著。你喜欢 |
Collaborator
Author
|
@CodFrm "仓库现有的 issue 模板应全部通过检查" (check:issue-templates) 这测试有问题 |
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.
修改内容
按 #1593 (comment) 的反馈调整方向:原方案给功能请求模板新增必填环境字段,现改为精简全部 Issue 模板。
功能请求模板:回退浏览器版本、ScriptCat 版本、「是否原本认为已存在」下拉、「当前行为和已尝试的方法」等新增必填项。新功能与浏览器/版本无关,误报的 bug 应该引导去 Bug 模板,而不是让所有提交者多填几栏。顶部只保留一句提示:功能失效、或以前能用现在不行 → 请改用 Bug 模板。
其余模板同步精简:
必填项变化:
模板总行数 1583 → 772。中英文两份模板保持结构一一对应。
保留的例外:翻译模板的语言下拉(决定分派给谁,不是分类噪音)、兼容性模板的 metadata(诊断关键)。
兼容性
https://github.com/scriptscat/scriptcat/issues/new?template=01_bug_report.yaml这类链接的契约保持不变:main逐字节一致src/pages/popup/App.tsx的「报告问题」菜单会拼&scriptcat-version=…&browser=…,因此这两个 id 予以保留;合并后的环境字段沿用browser而不是新起名字,已安装的旧版本发出的旧参数同样继续生效,无需改动代码。新增机械检查
模板问题在 review 里基本看不出来,因此补了
pnpm run check:issue-templates(已接入lint/lint:ci,CI 的 Lint job 自动覆盖;.husky/pre-commit在改动模板或src/TypeScript 时校验暂存快照)。它检查:markdown不带 id/validations、dropdown/checkboxes 有选项、checkboxes 不用validations)0N↔1N)字段序列、必填性、title/type/labels、选项数量一一对应src/中构造的issues/new预填链接,每个参数都能对应到目标模板的真实字段 id——用 TypeScript AST 解析而非字符串匹配,解析不出目标模板时报错而非放行这个检查在本 PR 开发过程中实际抓到两个已经写进分支的错误:
description里一个未加引号的:(note the source: page console)导致 YAML 解析失败,GitHub 会直接拒绝渲染该表单;中文模板因为用全角「:」不受影响,diff 上两边看起来完全一样browser改名成了environment,会让 popup 的预填静默失效验证
pnpm lint:ci通过(prettier / tsc / check:i18n / check:issue-templates / eslint)pnpm exec vitest run scripts/check-issue-templates.test.mjs18 passed.husky/pre-commit拒绝提交,恢复后通过