refactor(cli): remove unused EnumSelector component - #9997
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Thanks for the PR! Template looks good ✓ Problem: Verified, not theoretical. I grepped Direction: Aligned — this is subtraction, not addition; removing a component nothing mounts is a pure maintenance win. No CHANGELOG direction signal needed for deleting unreferenced code. Size: Not applicable — no core paths touched (all three files are under Approach: The scope is exactly right. The PR deletes precisely the three files needed and nothing else, and correctly leaves Risk: No elevated risk signals — no high-risk paths matched. One note for transparency: the author @qqqys has write access and is a Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:已核实,非理论问题。我在 方向:对齐——这是减法而非加法;删除无人挂载的组件是纯维护收益。删除无引用代码无需 CHANGELOG 方向信号。 规模:不适用——未触及核心路径(三个文件均在 方案:范围恰好。PR 精确删除所需的三个文件,别无其他,并且正确地保留了 风险:无升级风险信号——未命中高风险路径。一点透明说明:作者 @qqqys 拥有 write 权限且是 进入代码审查 🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewMy independent approach to "remove an unused component" would be: prove zero consumers (exact name, case/kebab/snake variants, barrel re-exports, dynamic-import shapes), then delete the component together with its colocated test and snapshot, and let CI confirm nothing breaks. This PR does exactly that. Going through the diff against
No critical blockers, no convention violations. Nothing to fix. Test evidenceUnattended CI run — I never build or execute PR code; the evidence below is the PR's own CI, fetched via the API for commit Not verified / not applicable: no user-visible behavior changes, so there is no TUI surface to drive and no behavioural claim for a sandboxed lane to settle. The author reports local Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 中文说明代码审查我对"删除未使用组件"的独立方案是:先证明零消费者(精确名、大小写/kebab/snake 变体、barrel 再导出、动态导入形态),再连同其同目录测试与快照一并删除,由 CI 兜底确认。本 PR 的做法与此完全一致。 对照
无阻塞性问题,无规范违背。无需修改。 测试证据无人值守 CI 运行——不会构建或执行 PR 代码;以上证据来自 PR 自身的 CI,经 API 拉取(提交 未验证 / 不适用:无用户可见行为变化,故无 TUI 表面可驱动,也无行为性主张需要沙箱通道裁决。作者自述本地 — Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 3/5 — clean review, but the fork-refactor guardrail needs a maintainer's sign-off. Stepping back: this is about as clean as a deletion PR gets. The problem is verified (I independently confirmed zero consumers on Why not approve then? Pure policy, not doubt. The approval guardrail is mechanical: a cross-repository PR with a Context that should make the sign-off quick: the author @qqqys is a maintainer with write access and a ⏸️ Deferring to @wenshao @pomelo-nwu — the fork-refactor approval guardrail blocks auto-approval; review itself is clean (see Stages 1–2), needs a human maintainer's sign-off. 中文说明置信度:3/5 —— 审查干净,但 fork-refactor 护栏需要维护者签核。 退一步看:这是一个删除类 PR 能做到的最干净的程度。问题已核实(我在 那为何不批准?纯粹是政策,而非疑虑。审批护栏是机械的:跨仓库(fork)且标题为 让签核可以快速完成的背景:作者 @qqqys 是拥有 write 权限的维护者、 ⏸️ 转交 @wenshao @pomelo-nwu —— fork-refactor 审批护栏阻止自动批准;审查本身干净(见 Stage 1–2),需要人类维护者签核。 — Qwen Code · qwen3.8-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
中文说明
— qwen3.8-max via Qwen Code /review (v0.22.0)
|
@qwen-code /takeover |
|
🤝 Takeover engaged: the autofix loop now manages this PR — it will address new review feedback and resolve base conflicts until the label is removed or the round cap is reached. This is a fork PR, so the first round comes from the next scheduled scan (usually within minutes). Remove the 中文说明🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。本 PR 来自 fork,首轮处理将由下一次定时扫描执行(通常几分钟内)。移除 |
|
🔀 Base updated: red check(s) [Test (ubuntu-latest, Node 22.x)] pass on current main — merged current main via update-branch; CI will re-run. 中文说明🔀 已更新 base:红色检查 [Test (ubuntu-latest, Node 22.x)] 在当前 main 上通过 —— 已通过 update-branch 合入当前 main,CI 将重新运行。 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
中文说明
未发现问题。LGTM!✅
— qwen3.8-max via Qwen Code /review (v0.22.0)
|
🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下: Autofix review round — no action neededFeedback triaged: 1 item — review [rv:5017090095]: " Decision: no code change. The CI-failure claim was true when the review ran but is now refuted by current evidence; there is nothing to fix in this PR. Evidence
OutcomeNo commit was made and no files were changed. No further action is required from the autofix loop on this finding; the next CI evaluation of the PR head should report the check as passing. 中文说明Autofix 审查轮次 — 无需任何操作处理的反馈: 1 条 — 审查 [rv:5017090095]:" 决定:不修改代码。 该 CI 失败的指控在审查发生时属实,但已被当前证据推翻;本 PR 没有任何需要修复的内容。 证据
结果未创建任何提交,未修改任何文件。autofix 循环无需对该指控采取进一步操作;下一次对 PR 头部的 CI 评估应显示该检查已通过。 Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。 🧠 Handled by Qwen Code · model/模型 |
|
Released in v0.22.2. |
What this PR does
Removes a UI selector component that is no longer referenced anywhere in the codebase, together with the test and snapshot that existed solely to cover it. The component renders a left-right value picker for enum-typed settings, but no screen or component mounts it; its only callers were its own unit test and snapshot. Nothing else changes.
Why it's needed
Dead surface is a cost: every contributor who reads it has to work out what wires it up, and the answer here is "nothing". The component arrived with an upstream sync and was never referenced in this repository's history — no production code, no string-keyed registry entry, no dynamic import path. Its dedicated test and snapshot exist only to cover the component itself, so they go with it.
Reviewer Test Plan
How to verify
This is a pure deletion of code nothing references. Verify the absence of consumers rather than behavior:
rg -n '\bEnumSelector\b' packages integrations integration-tests scripts .github docs-site— expect zero hits after this PR (the only three before it were the component, its test, and its snapshot).npm run build && npm run bundle && npm run typecheck— all green locally with this change (a type-only break from a removed export would surface here; typecheck does not run in CI).npm run lint:ci— green locally with this change.No user-visible behavior changes, so no before/after TUI evidence applies.
Evidence (Before & After)
N/A — non-UI change (dead-code deletion; nothing rendered this component).
Tested on
Environment (optional)
Local
npm run build && npm run bundle && npm run typecheckandnpm run lint:ciin a clean worktree offorigin/main.Risk & Scope
Linked Issues
Part of the dead-surface cleanup tracked in #10000.
Machine details (find-simplifications)
enum-selector— class 2, dead component with its test and snapshot.packages/cli/src/ui/components/shared/EnumSelector.tsx(87 lines),EnumSelector.test.tsx(152 lines),__snapshots__/EnumSelector.test.tsx.snap(9 lines) — 248 lines deleted, 0 added (git diff --numstat)..github,.husky,.vscode,patches, root build/lint manifests, tracked.qwenfiles) resolves to exactly three paths — the component itself (declaration), its test (test-only), and its snapshot (snapshot). Zero production consumers; zero string-keyed references (checkedstring-keys,build-graph,generated,vi-mock,mirrors,dyn-import,cli-flags,assetschecklist rows); no integration-test reference (second pass without test exclusions); no design-doc or plan mentions it.packages/cli/src— landable, notpackages/core/channels/SDK/acp-bridge), full-corpus grep, own-file check (no in-file caller beyond the declaration), hidden-consumer checklist, test-only check, unwire history (no binding text ever existed — it was never wired), design-doc ownership (none).origin/main(4a281f2efc): same three paths, no commits touching the symbol since the survey, branch base freshly fetched.npm run build && npm run bundle && npm run typecheckgreen;npm run lint:cigreen; targeted vitest skipped by design (the deletion carries the surface's only test; corpus re-grep on the landing checkout returned zero surviving references). Self-audit: two clean passes.eslint.legacy-filenames.mjsentry (.tsxis outside the kebab-case rule), no i18n locale keys (component took display strings via props), no docs rows.中文说明
本 PR 做了什么
删除一个在代码库中已无任何引用的 UI 选择器组件,以及仅为覆盖它而存在的测试和快照。该组件渲染一个用于枚举类设置项的左右切换选择器,但没有任何界面或组件挂载它;它唯一的调用方就是它自己的单元测试和快照。除此之外没有任何其他改动。
为什么需要
死代码是一种成本:每个读到它的人都得弄清是什么在用它,而这里的答案是“没有任何东西”。该组件随一次上游同步进入本仓库,在整个历史中从未被引用——没有生产代码、没有字符串键注册项、没有动态导入路径。它专属的测试和快照只为覆盖组件本身而存在,因此一并删除。
评审者测试计划
如何验证
这是一次对无任何引用代码的纯删除。请验证消费者的缺失,而不是行为:
rg -n '\bEnumSelector\b' packages integrations integration-tests scripts .github docs-site—— 本 PR 之后应无任何命中(之前仅有的三处即组件本身、其测试与其快照)。npm run build && npm run bundle && npm run typecheck—— 本地在包含本改动的情况下全部通过(删除导出可能引发的纯类型问题会在这里暴露;typecheck 不在 CI 中运行)。npm run lint:ci—— 本地在包含本改动的情况下通过。由于没有用户可见的行为变化,无需前后对比的 TUI 证据。
证据(改动前后)
N/A —— 非 UI 改动(死代码删除;该组件从未被渲染)。
测试环境
环境(可选)
在基于
origin/main的干净 worktree 中本地运行npm run build && npm run bundle && npm run typecheck与npm run lint:ci。风险与范围
关联 Issue
属于 #10000 跟踪的死代码清理工作。
机器细节见上方英文 “Machine details (find-simplifications)” 折叠块:候选编号
enum-selector(第 2 类:死组件连同其测试与快照),共删除 248 行、新增 0 行;全语料库搜索证明消费者恰为组件自身、其测试与其快照三处;调查协议各步骤及落地前的重新核验均已执行;构建、打包、类型检查与lint:ci全部通过;因删除本身带走了该表面唯一的测试,按流程跳过定向 vitest,改以落地检出上的语料库复扫(零残留引用)兜底;无允许列表条目、无 i18n 键、无文档行等连带清理项。