fix(web-shell): remove duplicate useWebShellPortalRoot import in ChatEditor - #6890
Conversation
…Editor PR QwenLM#6872 ("fix(web-shell): make composer height adaptive") added a second `import { useWebShellPortalRoot } from '../portalRoot'` at ChatEditor.tsx:46 without noticing the identical import already existed at line 21. TypeScript reports: TS2300: Duplicate identifier 'useWebShellPortalRoot'. This fails the web-shell build (`vite build && ... && tsc -p tsconfig.lib.json`) in `npm run prepare`, so every subsequent PR's CI `Install dependencies` step aborts before any real test runs. Remove the duplicate line 46 (keep the earlier import) so `main` builds again. The two callers at lines 247 and 858 continue to resolve to the single retained import.
|
@qwen-code /review |
|
Thanks for the PR! Template looks good ✓ Problem: Observed bug. PR #6872 introduced a duplicate Direction: Aligned — this is a build-breaking regression on Size: Not applicable — the only changed file ( Approach: The scope is exactly right — a single-line deletion that removes the duplicate import. The two consumers of Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:已观测到的 bug。 PR #6872 在 方向:对齐——这是 规模:不适用——唯一修改的文件( 方案:范围完全正确——仅删除重复 import 的一行改动。 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
Code ReviewThe diff is a single-line deletion — exactly what's needed. Independent assessment: given a duplicate Nothing else to flag — this is the minimum possible fix. Real-Scenario TestingReproduced the build failure on Before (main, After (PR branch, Build passes cleanly — no TS2300, no lifecycle failure. ✅ 中文说明代码审查Diff 仅一行删除——完全正确。独立评估:面对第 21 行和第 46 行重复的 没有其他需要标记的问题——这已是最小修复。 真实场景测试在 Before (main, After (PR 分支, 构建干净通过——无 TS2300、无 lifecycle 失败。✅ — Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 5/5 This is a one-line deletion that removes a duplicate import introduced by #6872. The TS2300 error is reproduced on This PR unblocks CI for every other PR against 中文说明信心度:5/5 这是一个单行删除,移除了 #6872 引入的重复 import。TS2300 错误在 此 PR 解除了所有针对 — 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. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed. Not reviewed: chunk 1 — no agent reported covering these; nobody read them.
— qwen3.7-max via Qwen Code /review
|
Thanks for the minimal fix. Tracking issue: #6884. One provenance correction: #6872\u0027s source head contained only one import; the duplicate appeared when that patch composed cleanly with concurrent PR #6804 on the newer main, while PR CI validated the head ref. The one-line deletion here is still the correct repair. |
What this PR does
Removes the duplicate
import { useWebShellPortalRoot } from '../portalRoot'atpackages/web-shell/client/components/ChatEditor.tsx:46, keeping the earlier one at line 21.Why it's needed
PR #6872 (
fix(web-shell): make composer height adaptive) added a second identical import next to a newuseWebShellPortalRoot()call site without noticing the same specifier was already imported earlier in the file. TypeScript reports:That fails the
web-shellbuildscript (vite build && vite build --config vite.lib.config.ts && tsc -p tsconfig.lib.json), which runs fromscripts/prepare.jsduringnpm ciin CI. So every PR opened againstmainafter #6872 landed sees itsInstall dependenciesstep abort before any tests run — the two failing PRs I noticed while testing #6887 both surfaced this same duplicate identifier error, entirely unrelated to their own diffs.Removing the duplicate line at 46 keeps the two
useWebShellPortalRoot()call sites (lines 247 and 858) resolving to the single retained import at line 21, which is whatmainhad before #6872 and what the code intends.Reviewer Test Plan
How to verify
git blame packages/web-shell/client/components/ChatEditor.tsx | grep useWebShellPortalRootonmainbefore this PR shows the same line imported twice (one from the pre-existing import block, one added by fix(web-shell): make composer height adaptive #6872's diff at line 46).line 21: import { useWebShellPortalRoot } from '../portalRoot';, with the two consumers unchanged at lines 247 and 858.npm run typecheckinsidepackages/web-shellno longer reportsTS2300: Duplicate identifier 'useWebShellPortalRoot'. (Other pre-existing errors from unresolved workspace modules on a partially-built tree remain — they are unrelated to this fix and vanish after a fullnpm cibuild, i.e. in CI.)Evidence (Before & After)
Before (excerpt from #6887 CI run 29331201533):
After: the
useWebShellPortalRootline at 46 is deleted; only the line-21 import remains. No user-visible behavior change — the file still usesuseWebShellPortalRoot()in the same two places it did before.Tested on
Environment (optional)
npm run typecheckinsidepackages/web-shell. Verified the duplicate identifier error is gone; remaining local-only errors are workspace-resolution issues that clear oncenpm ciruns (as it does in CI).Risk & Scope
ChatEditor.tsx— only the extra import line was removed.Linked Issues
Follow-up to #6872 (introduced the duplicate). No dedicated issue was filed; the failure is visible on every open PR's CI, e.g. #6887's
Test (ubuntu-latest, Node 22.x)andweb-shell E2E Smokeruns.中文说明
这个 PR 做了什么
移除
packages/web-shell/client/components/ChatEditor.tsx:46处重复的import { useWebShellPortalRoot } from '../portalRoot',保留第 21 行原有那个。为什么需要
PR #6872(
fix(web-shell): make composer height adaptive)在新的useWebShellPortalRoot()调用旁边添加了第二个完全相同的 import,没注意到文件靠上位置已经有了同名 import。TypeScript 报错:这让
web-shell的build脚本(vite build && vite build --config vite.lib.config.ts && tsc -p tsconfig.lib.json)失败,而build会在 CI 的npm ci过程中通过scripts/prepare.js执行。因此 #6872 合入后每个针对main打开的 PR,Install dependencies步骤都会在跑任何测试之前中断——我测试 #6887 时发现的两个失败 PR 都是同一处 duplicate identifier 错误,跟它们自己的 diff 完全无关。删除第 46 行后,两个
useWebShellPortalRoot()调用(第 247、858 行)继续 resolve 到第 21 行保留下来的那个 import,与 #6872 之前main的状态一致,也符合代码原意。复审测试计划
如何验证
git blame packages/web-shell/client/components/ChatEditor.tsx | grep useWebShellPortalRoot在main上会看到同一 specifier 被 import 两次(一个来自原有 import 块,一个是 fix(web-shell): make composer height adaptive #6872 diff 在第 46 行新加的)。第 21 行: import { useWebShellPortalRoot } from '../portalRoot';,两个消费者(第 247、858 行)不变。packages/web-shell里npm run typecheck不再报TS2300: Duplicate identifier 'useWebShellPortalRoot'。(部分构建下 workspace 模块未解析产生的其他既有错误与本修复无关,全量npm ci后消失,即 CI 环境。)证据(Before & After)
Before(摘自 #6887 CI 运行 29331201533):
After:第 46 行
useWebShellPortalRootimport 被删除,仅保留第 21 行的 import。无用户可见行为变更——文件仍在原来的两处使用useWebShellPortalRoot()。测试环境
环境(可选)
packages/web-shell中的npm run typecheck。已确认 duplicate identifier 错误消失;剩余本地 only 错误是 workspace 解析问题,CI 中npm ci后即消失。风险与范围
ChatEditor.tsx中除该 import 外别无它改。关联 Issue
跟进 #6872(引入了 duplicate)。无专门 issue;每个打开的 PR 都能看到该失败,例如 #6887 的
Test (ubuntu-latest, Node 22.x)和web-shell E2E Smoke运行。