fix(web-shell): drop a duplicate import that breaks every PR's CI - #6894
fix(web-shell): drop a duplicate import that breaks every PR's CI#6894wenshao wants to merge 1 commit into
Conversation
`ChatEditor.tsx` imports `useWebShellPortalRoot` twice — once at line 21, and again at line 46, where #6872 added a second copy of an import the file already had. TypeScript answers with `TS2300: Duplicate identifier`, which fails `tsc -p tsconfig.lib.json`, which fails `npm run build --workspace=packages/web-shell`, which runs in the `prepare` lifecycle — so `npm ci` fails, and with it every job on every pull request, not only the ones that touch the web shell. The two `const portalRoot = useWebShellPortalRoot()` call sites are in different components and are both correct; only the second import is redundant.
|
Thanks for the quick fix! Template looks good ✓ Problem: Observed bug with clear evidence — Direction: Aligned — a one-line deletion that restores a working build. Zero risk; the symbol remains imported once and both call sites are untouched. Size: Not applicable (web-shell component, not a core module path). 1 file, 1 deletion, 0 additions. Approach: The minimal possible change — deletes exactly the redundant import. Nothing to cut. Moving on to build verification. 🔍 中文说明感谢快速修复! 模板完整 ✓ 问题:已观测到的 bug,证据明确——#6872 引入了重复的 方向:对齐——删除一行即可恢复构建。零风险;符号仍只 import 一次,两个调用点不受影响。 规模:不适用(web-shell 组件,非核心模块路径)。1 个文件,删除 1 行,新增 0 行。 方案:最小改动——精确删除多余的 import,无需削减。 进入构建验证 🔍 — Qwen Code · qwen3.7-max Reviewed at |
|
Code review: The diff is a textbook one-line fix. Removes the second Before (main)After (this PR)Both runs were executed locally. The remaining TS2307 errors (unresolved workspace package references like Tmux product testing: N/A — this is a build-blocking TypeScript error, not a user-visible behavior change. The before/above is the build output itself. 中文说明代码审查: 标准的一行修复。删除第 46 行重复的 构建验证: Tmux 产品测试:不适用——这是阻塞构建的 TypeScript 错误,非用户可见的行为变更。 — Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 5/5 — Clean across every stage; the simplest possible fix for a build-blocking regression. This is exactly the kind of PR the gate should breeze through: a verified, observed bug ( 中文说明信心度:5/5 — 各阶段全部通过;对阻塞构建的回归问题,这是最简单的修复方式。 这正是 gate 应该快速放行的 PR:已验证的 bug( — Qwen Code · qwen3.7-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
|
Superseded by #6890, which merged the identical fix (removing the duplicate |
|
Superseded by #6890, which landed the identical one-line deletion first. Closing. For the record, the diagnosis stands and is worth keeping visible: the duplicate import failed |
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
What this PR does
Deletes one line.
ChatEditor.tsximportsuseWebShellPortalRoottwice — once at line 21, and again at line 46, where #6872 added a second copy of an import the file already had.Why it's needed
maindoes not install. TypeScript answers the duplicate withTS2300: Duplicate identifier 'useWebShellPortalRoot', which failstsc -p tsconfig.lib.json, which failsnpm run build --workspace=packages/web-shell, which runs in thepreparelifecycle — sonpm cifails, and with it every job on every open pull request, not only the ones that touch the web shell.The two
const portalRoot = useWebShellPortalRoot()call sites are in different components and are both correct. Only the second import is redundant.Reviewer Test Plan
How to verify
On
main:On this branch:
The same failure is visible in CI on any recently-opened PR — e.g. #6892's
Test (ubuntu-latest, Node 22.x)job fails at Install dependencies with exactly those two lines.Evidence (Before & After)
N/A — not user-visible. The before/after is the build output above.
Tested on
Risk & Scope
Linked Issues
Regression from #6872.
中文说明
这个 PR 做了什么
删一行。
ChatEditor.tsx把useWebShellPortalRootimport 了两次——第 21 行一次,第 46 行又一次;后者是 #6872 加的,而这个文件本来就已经 import 过了。为什么需要
main装不上。 TypeScript 报TS2300: Duplicate identifier,于是tsc -p tsconfig.lib.json失败 →npm run build --workspace=packages/web-shell失败 → 而这个 build 跑在prepare生命周期里 →npm ci失败,于是每一个开着的 PR 上的每一个 job 都跟着红,不只是碰了 web shell 的那些。文件里两处
const portalRoot = useWebShellPortalRoot()分属不同组件,都是对的。多余的只有第二个 import。验证
main上:本分支上:
npm run build(全 workspace,按依赖顺序)rc=0,零 TypeScript 错误。同样的失败在任何新开的 PR 的 CI 上都能看到——例如 #6892 的
Test (ubuntu-latest, Node 22.x)就是挂在 Install dependencies,报的正是那两行。风险与范围