fix(web-shell): keep pasted text visible - #8230
Conversation
|
|
|
Thanks for the PR! Template looks good ✓ Problem: This is an observed regression, not a theoretical concern. I verified the story against the merge history: #7824 ("preserve pasted text in composer") merged 2026-07-27, and #7810 ("isolate history and session drafts") merged ~13h later on 2026-07-28. The placeholder machinery ( Direction: Aligned. This restores the interaction #7824 intentionally shipped — pasted text stays visible and editable — rather than introducing anything new, and touches no auth/sandbox/model/telemetry/public-contract surface. The upstream CHANGELOG has no reference to this exact placeholder behavior, but paste handling in input surfaces is an actively maintained area, so the fix is squarely in scope. Size: Not applicable — all four files live in Approach: The scope feels right. This is a deletion-heavy revert (-249/+29) of exactly the placeholder machinery — the five helper functions, the two refs, every expand/prune/clear call site, and the large-paste branch of the paste handler, which now returns Risk: No elevated risk signals — none of the changed files match the revert-correlated high-risk paths. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:这是一个已观测到的回归,而非理论性顾虑。我对照合入历史核对了经过:#7824("preserve pasted text in composer")于 2026-07-27 合入,#7810("isolate history and session drafts")约 13 小时后于 2026-07-28 合入。占位符机制( 方向:对齐。本 PR 恢复 #7824 有意发布的交互——粘贴文本保持可见、可编辑——而非引入新东西,且未触及 auth/sandbox/model/telemetry/公共契约。上游 CHANGELOG 没有针对此占位符行为的引用,但输入界面的粘贴处理是活跃维护领域,因此该修复完全在范围内。 规模:不适用——四个文件全部位于 方案:范围合理。这是一次以删除为主的回退(-249/+29),恰好移除占位符机制——五个辅助函数、两个 ref、所有 expand/prune/clear 调用点,以及粘贴处理器中的大段粘贴分支(现返回 风险:无升级风险信号——改动文件均未命中与回退相关的高风险路径。 进入代码审查 🔍 — Qwen Code · qwen3.8-max-preview Reviewed at |
Code reviewMy independent take before reading the diff: a regression that reinstated the paste-placeholder machinery is fixed by deleting that machinery and letting CodeMirror insert plain text natively. That is exactly what this PR does, and it does it completely. I cross-checked the removal against the base: every one of the ~38 references to the paste symbols ( No blockers. Two non-blocking observations:
Test evidence (PR's own CI)The main unit suite is still running on this commit, so nothing is settled yet — I'm reporting what's live, not predicting the outcome. The web-shell visual capture is queued behind it. Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 The author reports 67 focused composer unit/DOM tests passing locally — that is the author's claim, not independently re-run here. The two checks that actually pin this behavior (the 200-line DOM regression test and the Playwright smoke test that asserts pasted text is visible, editable, and submitted as edited) need the ubuntu suite to land green before they count as evidence. Sandboxed verification would settle the residual gap: 中文说明代码审查我在看 diff 之前的独立判断:一个重新引入粘贴占位符机制的回归,应当通过删除该机制、让 CodeMirror 原生插入纯文本来修复。本 PR 正是这么做的,而且做得彻底。 我对照 base 核对了删除范围: 无阻塞项。两个非阻塞观察:
测试证据(PR 自身 CI)主单元测试套件在该 commit 上仍在运行,因此尚无定论——我只报告当前状态,不预测结果。web-shell 视觉截取在其后排队。 主套件需在该 commit 上跑绿,新增的 200 行 DOM 回归测试与 Playwright 冒烟测试(断言粘贴文本可见、可编辑、按编辑后内容提交)才能作为证据。作者称本地有 67 项输入框单元/DOM 测试通过——这是作者的声明,未在此独立复跑。 沙箱验证可补齐剩余缺口: — Qwen Code · qwen3.8-max-preview Reviewed at |
|
Confidence: 4/5 — a clean, complete revert of a verified regression; the only reservations are non-blocking (a narrow followup-dismissal nuance, and interactive verification done on macOS only). Stepping back, this is the fix I would have written. The regression is real and well-evidenced — I confirmed #7824 merged before #7810 and that the placeholder code is still live on The two notes from the review stand as non-blocking: native paste no longer dismisses a visible followup on a large paste into an empty composer, but typing and small pastes never did either, so this is consistency rather than a regression; and the author verified interactively on macOS only, with browser automation intentionally left to the requester. The added 200-line DOM regression test and the updated Playwright smoke test pin the behavior directly, so once CI is green the change is well covered. Approval is deferred until CI lands green on 中文说明置信度:4/5 —— 对一个已核实回归的干净、彻底的回退;唯一保留是非阻塞性的(一个狭窄的 followup 关闭细节,以及仅在 macOS 上做了交互验证)。 退一步看,这正是我会写的修复。回归真实且证据充分——我核实了 #7824 先于 #7810 合入,且占位符代码目前仍在 审查中的两点仍是非阻塞:原生粘贴不再在"空输入框 + 大段粘贴 + followup 可见"时关闭 followup,但输入和小段粘贴本来也不会,因此这是一致性而非回归;作者仅在 macOS 上交互验证,浏览器自动化按要求留给需求方。新增的 200 行 DOM 回归测试与更新后的 Playwright 冒烟测试直接钉住了该行为,因此 CI 跑绿后覆盖充分。 审批推迟到 CI 在该 commit 上跑绿——单元测试套件与 web-shell 视觉截取仍在运行,我不会为一个尚不存在的结果背书。若全部跑绿,finalize 任务会自动发布绑定该 commit 的审批;若有任一跑红或 head 移动,则会保留不发。 — Qwen Code · qwen3.8-max-preview Reviewed at |
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. |
🖼️ web-shell visual previewRendered against a mock daemon (no real backend): the PR base vs this PR head Screenshots · before / after✅ No screenshot changes against the PR base. Full-resolution recordings (.webm) are attached to the workflow run. — Qwen Code · web-shell visuals |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
中文说明
— qwen3.8-max-preview via Qwen Code /review
|
🤝 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. Remove the 中文说明🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。移除 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.8-max-preview via Qwen Code /review
doudouOUC
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
中文说明
未发现问题。LGTM!✅
— qwen3.7-max via Qwen Code /review
|
🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下: No changes were made this round. The only new feedback is a COMMENTED review (not CHANGES_REQUESTED) from the automated reviewer noting a transient CI failure on "Test (ubuntu-latest, Node 22.x)". No failed checks or still-red checks are currently listed, and no inline comments were raised. Local verification confirms the touched tests pass:
No code changes are warranted. 中文说明本轮未做任何更改。 唯一的新反馈是自动审查机器人的一条 COMMENTED 评论(非 CHANGES_REQUESTED),指出 "Test (ubuntu-latest, Node 22.x)" 出现了临时性 CI 失败。当前没有列出任何失败检查或持续红色检查,也没有提出任何行内评论。 本地验证确认相关测试通过:
无需进行代码更改。 Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。 🧠 Handled by Qwen Code · model/模型 |
|
Released in v0.21.3. |
What this PR does
This PR restores the Web Shell behavior introduced by #7824: pasted plain text remains fully visible and editable in the composer, regardless of its character count or number of lines. It removes the large-paste placeholder state and its admission, expansion, pruning, draft, history, and cleanup paths.
Image paste handling remains unchanged. Session-scoped drafts, workspace-scoped prompt history, inline mentions, delayed submission commits, and the other composer behavior introduced after #7824 are retained; they now operate directly on the visible editor text.
The regression coverage now pastes 200 lines into the CodeMirror composer and asserts that the complete text is stored in the editor without a generated placeholder. The browser smoke expectation is also restored to verify that pasted text is visible, editable, and submitted as edited.
Why it's needed
#7824 intentionally removed
[Pasted Content N chars]placeholders so users could inspect and edit pasted content directly. However, #7810 was developed from code that predated #7824 and still contained the placeholder implementation. When that branch was synchronized and reviewed, the old placeholder path remained, and the smoke test was changed from expecting visible pasted text to expecting the placeholder so that it matched the branch behavior. Because #7810 merged after #7824, it unintentionally reinstated the behavior that #7824 had removed.This is observable even for relatively short content: the placeholder logic classified a paste as large when it exceeded either 1,000 characters or 10 lines, so an 833-character multiline paste could still become
[Pasted Content 833 chars].The placeholder indirection also maintained a separate in-memory map that drafts, history, submission, deletion, undo, and session changes had to reconcile. Keeping the pasted source directly in the editor removes that state split and preserves the interaction users expect: what they see and edit is what gets saved and submitted.
Reviewer Test Plan
How to verify
[Pasted Content ...]label.Evidence (Before & After)
[Pasted Content N chars], while the original content lived in a separate in-memory map.Tested on
Environment (optional)
Risk & Scope
The main tradeoff is that very large pasted text is rendered directly by CodeMirror instead of being represented by a short placeholder. This is the intended #7824 interaction. The change is limited to plain-text paste representation; images and all non-paste composer behavior remain in place. No protocol, daemon, SDK, capability, persistence format, or public API changes are introduced.
Linked Issues
中文说明
本 PR 做了什么
本 PR 恢复 #7824 引入的 Web Shell 行为:无论粘贴文本的字符数或行数是多少,文本都完整显示在输入框中并可直接编辑。改动删除了大段粘贴占位符状态,以及围绕占位符的接收、展开、清理、草稿、历史和重置逻辑。
图片粘贴逻辑保持不变。#7824 之后加入的会话级草稿、工作区级输入历史、内联引用、延迟提交确认及其他输入框行为均予以保留;这些功能现在直接使用编辑器中可见的原文。
回归测试会向 CodeMirror 输入框粘贴 200 行文本,并断言编辑器保存完整文本且不生成占位符。浏览器冒烟测试的预期也恢复为验证粘贴文本可见、可编辑,并按编辑后的内容提交。
为什么需要这个改动
#7824 有意移除了
[Pasted Content N chars]占位符,让用户能够直接查看和编辑粘贴内容。但是,#7810 基于 #7824 合入前的代码开发,其分支仍包含旧占位符实现。该分支同步和审查期间保留了旧逻辑,随后为了让冒烟测试与分支行为一致,测试预期也从“显示完整粘贴内容”改成了“显示占位符”。由于 #7810 在 #7824 之后合入,它无意中恢复了 #7824 已删除的行为。这个问题不只影响超长文本:旧逻辑在超过 1,000 字符或者超过 10 行时都会生成占位符,因此一段只有 833 个字符但行数较多的文本也会显示成
[Pasted Content 833 chars]。占位符机制还维护了一份独立的内存映射,草稿、历史、提交、删除、撤销和会话切换都必须与它协调。直接在编辑器保存粘贴原文可以移除这份分裂状态,并确保用户看到和编辑的内容就是最终保存与提交的内容。
Reviewer 测试计划
验证方式
[Pasted Content ...]。前后对比
[Pasted Content N chars],原文保存在独立内存映射中。测试平台
测试环境
风险与范围
主要取舍是超大文本会由 CodeMirror 直接渲染,而不是以短占位符表示;这是 #7824 预期恢复的交互。本次仅修改纯文本粘贴的展示方式,图片和其他非粘贴输入框行为保持不变。不涉及协议、daemon、SDK、capability、持久化格式或公共 API 变更。
关联事项