Skip to content

feat(web-shell): show sessions awaiting user action - #6956

Merged
wenshao merged 4 commits into
QwenLM:mainfrom
chiga0:codex/sidebar-session-attention-status
Jul 15, 2026
Merged

feat(web-shell): show sessions awaiting user action#6956
wenshao merged 4 commits into
QwenLM:mainfrom
chiga0:codex/sidebar-session-attention-status

Conversation

@ytahdn

@ytahdn ytahdn commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Adds localized attention badges to Web Shell sidebar sessions that are waiting for permission approval or user input. Permission requests use a green “Waiting for approval” badge, while AskUserQuestion requests use a blue “User input needed” badge. AskUserQuestion message summaries now prompt for additional information while active and report the number of questions after completion.

Why it's needed

The session API already exposes whether a running session is blocked on permission approval or an AskUserQuestion response, but the sidebar previously showed the same spinner for both states. Users had to open sessions individually to discover which action was required, and completed AskUserQuestion summaries did not communicate how many questions were asked.

Reviewer Test Plan

How to verify

Start one Web Shell session that pauses for tool permission and another that pauses on AskUserQuestion. Confirm the sidebar shows “Waiting for approval” for the permission session and “User input needed” for the question session, with the existing running spinner retained. Resolve an AskUserQuestion request containing multiple questions and confirm its completed message summary reports the question count. Switch between English and Chinese and confirm the corresponding localized labels.

Evidence (Before & After)

Before: blocked sessions showed only the generic running spinner, and completed AskUserQuestion messages said “Asked user”.

After: blocked sessions show distinct approval/input badges, active AskUserQuestion messages request additional information, and completed messages report “Asked N questions”.

Tested on

OS Status
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

Environment (optional)

Web Shell targeted unit test, typecheck, ESLint, and Prettier checks.

Risk & Scope

  • Main risk or tradeoff: Sidebar labels consume additional horizontal space, so long session names truncate sooner while attention is required.
  • Not validated / out of scope: Windows and Linux visual rendering; daemon session API behavior.
  • Breaking changes / migration notes: None.

Linked Issues

N/A

Pictures

image
中文说明

本 PR 的改动

为 Web Shell 侧边栏中等待权限批准或用户输入的会话增加本地化状态标签。权限请求使用绿色“等待批准”标签,AskUserQuestion 请求使用蓝色“需要用户输入”标签。AskUserQuestion 消息在运行中提示补充信息,完成后显示询问的问题数量。

改动原因

会话接口已经提供运行中会话是在等待权限批准还是 AskUserQuestion 回复,但侧边栏此前对两种状态都只显示相同的 spinner。用户必须逐个打开会话才能知道需要执行什么操作,完成后的 AskUserQuestion 摘要也没有显示询问了多少个问题。

Reviewer 测试计划

验证方式

分别启动一个暂停等待工具权限的 Web Shell 会话和一个暂停等待 AskUserQuestion 回复的会话。确认侧边栏对权限会话显示“等待批准”,对提问会话显示“需要用户输入”,并保留已有的运行 spinner。完成一个包含多个问题的 AskUserQuestion 请求,确认完成消息显示问题数量。切换中英文,确认对应文案正确。

前后对比

改动前:阻塞中的会话只显示通用运行 spinner,完成后的 AskUserQuestion 消息显示“已询问用户”。

改动后:阻塞中的会话分别显示权限/输入标签,运行中的 AskUserQuestion 消息提示补充信息,完成消息显示“已询问 N 个问题”。

测试平台

OS 状态
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

环境

运行了 Web Shell 定向单元测试、typecheck、ESLint 和 Prettier 检查。

风险与范围

  • 主要风险或取舍:侧边栏标签会占用更多横向空间,需要用户操作时较长的会话名称会更早截断。
  • 未验证或范围外:Windows 和 Linux 的视觉渲染;daemon 会话接口行为。
  • 破坏性改动或迁移说明:无。

关联 Issue

无。

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

🖼️ web-shell visual preview

Auto-rendered from this PR head 9314398 against a mock daemon (no real backend). Refreshes on every push.

Screenshots · light / dark

viewlightdark
Model Dialogmodel-dialog lightmodel-dialog dark
Permission Panelpermission-panel lightpermission-panel dark
Session Transcriptsession-transcript lightsession-transcript dark
Slash Menuslash-menu lightslash-menu dark
Theme Dialogtheme-dialog lighttheme-dialog dark

Full-resolution recordings (.webm) are attached to the workflow run.

Qwen Code · web-shell visuals

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Template looks good ✓

Problem: Observed UX gap — the session API already exposes isWaitingForPermission and isWaitingForUserQuestion (confirmed in acp-bridge/src/bridgeTypes.ts), but the sidebar showed the same spinner for both states. Users had to open each session to discover what action was needed. Real, user-visible problem.

Direction: Aligned. Distinguishing permission-blocked from input-blocked sessions is a clear usability improvement, and showing AskUserQuestion question counts is a natural companion change. No direct CHANGELOG reference, but the area is squarely within web-shell's scope.

Size: Not applicable — all changes are in packages/web-shell/, no core infrastructure touched.

Approach: The scope feels right. Five files, +135/-18, and every line serves the stated goal. The attention badge logic is a simple ternary chain, the CSS uses existing design tokens, and the getAskUserQuestionCount helper is minimal. The latest commit (9314398ca) also addresses both actionable suggestions from the prior review — active AskUserQuestion summaries now render standalone "Provide information" without the "Running" prefix, and badge text opacity was bumped from 72% to 95% for AA contrast compliance. No scope creep or unrelated changes.

Moving on to code review. 🔍

中文说明

感谢贡献!

模板完整 ✓

问题:已观测到的 UX 差距——会话 API 已提供 isWaitingForPermissionisWaitingForUserQuestion 字段(在 acp-bridge/src/bridgeTypes.ts 中确认),但侧边栏此前对两种状态都只显示相同的 spinner。用户必须逐个打开会话才能知道需要什么操作。真实、可观测的问题。

方向:对齐。区分权限阻塞和输入阻塞是明确的可用性改进,显示 AskUserQuestion 问题数量是自然的配套改动。CHANGELOG 无直接参考,但该领域完全在 web-shell 范围内。

规模:不适用——所有改动都在 packages/web-shell/,未触及核心基础设施。

方案:范围合理。5 个文件,+135/-18,每一行都服务于目标。attention badge 逻辑是简单的三元链,CSS 使用现有设计 token,getAskUserQuestionCount 辅助函数很精简。最新提交(9314398ca)还处理了上一轮审查的两个可操作建议——运行中的 AskUserQuestion 摘要现在独立显示"补充信息",不再带"正在执行"前缀,badge 文字不透明度从 72% 提升到 95% 以满足 AA 对比度要求。无范围蔓延或无关改动。

进入代码审查 🔍

Qwen Code · qwen3.7-max

Reviewed at 9314398ca97713acb71f99f06c616f05cc34afd8 · re-run with @qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Code Review

Re-run after the author addressed both actionable review suggestions in 9314398ca:

Wording fix: Active AskUserQuestion summaries now show standalone "Provide information" / "补充信息" without the misleading "Running/正在执行" prefix. The fix is clean — formatToolGroupSummary returns early with t('toolGroup.summary.provideInformation') for active ask_user_question tools, and SingleToolSummary excludes isAskUserQuestion from the runningPrefix computation (!isAskUserQuestion && isActiveToolStatus(tool.status) && ...). No "Running Provide information" is possible.

Contrast fix: Badge text now mixes 95% of the status token with 5% theme foreground (color-mix(in srgb, var(--success-color) 95%, var(--foreground))), replacing the prior 72%-over-transparent treatment. This preserves the subtle 10% tinted background while bringing the text color close to the full token value, well above AA contrast against the near-white sidebar.

Everything else from the prior review still holds: the dual-flag priority logic correctly makes permission win when both flags are set, getAskUserQuestionCount gracefully falls back to 1 for legacy/empty args, the CSS follows existing color-mix patterns and hover/focus opacity rules, and i18n is complete for both languages with correct pluralization.

No correctness issues, security concerns, or AGENTS.md violations found.

Real-Scenario Testing

This is a Web Shell UI change (React sidebar badges + message summaries). Visual verification of the sidebar badges requires browser rendering — not achievable via tmux terminal capture. Unit tests cover the new logic comprehensively (28 ToolGroup tests, 27 sidebar tests, 1627/1627 total across 103 files).

Dev server from PR worktree:

qwen serve: daemon log → /home/github-runner/actions-runner-6/_work/_temp/qwen-home/debug/daemon/serve-363125.log
qwen serve: Web Shell UI served from /home/github-runner/actions-runner-6/_work/qwen-code/qwen-code/.qwen/worktrees/triage/packages/web-shell/dist
qwen serve listening on http://127.0.0.1:4170 (mode=http-bridge, workspace=/home/github-runner/actions-runner-6/_work/qwen-code/qwen-code/.qwen/worktrees/triage)
qwen serve: bound to workspace "/home/github-runner/actions-runner-6/_work/qwen-code/qwen-code/.qwen/worktrees/triage"
qwen serve: startup timing: processToListenMs=3197 runQwenServeToListenMs=2517
qwen serve: bearer auth disabled (loopback default). Set QWEN_SERVER_TOKEN to enable.
2026-07-15T14:37:45.198Z [INFO] [DAEMON] deferred runtime: scheduling fallback start in 1000ms
2026-07-15T14:37:46.199Z [INFO] [DAEMON] deferred runtime: fallback timer fired, starting
2026-07-15T14:37:47.126Z [INFO] [DAEMON] ideEnvPresent=false primary=/home/github-runner/actions-runner-6/_work/qwen-code/qwen-code/.qwen/worktrees/triage secondary= daemon workspace roots initialized
qwen serve: session reaper started (interval 60000ms, idle threshold 1800000ms)
qwen serve: /acp WebSocket transport enabled on /acp

Dev server starts cleanly with no errors. The PR build serves from the worktree's built web-shell/dist.

Unit tests: 1627/1627 passed across 103 test files. Typecheck and ESLint clean.

中文说明

代码审查

作者在 9314398ca 中处理了上一轮审查的两个可操作建议后重新运行:

文案修复: 运行中的 AskUserQuestion 摘要现在独立显示"补充信息" / "Provide information",不再带误导性的"正在执行/Running"前缀。修复方式简洁——formatToolGroupSummary 对运行中的 ask_user_question 工具提前返回 t('toolGroup.summary.provideInformation')SingleToolSummaryisAskUserQuestion 排除在 runningPrefix 计算之外。不可能再出现"Running Provide information"。

对比度修复: badge 文字现在使用 95% 状态 token 与 5% 主题前景色混合(color-mix(in srgb, var(--success-color) 95%, var(--foreground))),替代了之前 72% 不透明度的处理。保留了微妙的 10% 色调背景,同时将文字颜色提升到接近完整 token 值,在近乎白色的侧边栏上远超 AA 对比度要求。

上一轮审查的其它结论仍然成立:双标志优先级逻辑正确地在两者都置位时让权限优先,getAskUserQuestionCount 对旧数据/空数组优雅回退到 1,CSS 遵循现有 color-mix 模式和 hover/focus 透明度规则,i18n 中英文完整且复数处理正确。

未发现正确性问题、安全隐患或 AGENTS.md 违规。

真实场景测试

这是 Web Shell UI 改动(React 侧边栏 badge + 消息摘要)。侧边栏 badge 的视觉验证需要浏览器渲染——无法通过 tmux 终端捕获实现。单元测试全面覆盖了新逻辑(28 个 ToolGroup 测试,27 个侧边栏测试,103 个测试文件共 1627/1627 通过)。

开发服务器干净启动,无错误。PR 构建从 worktree 的 web-shell/dist 提供服务。

单元测试: 103 个测试文件中 1627/1627 通过。Typecheck 和 ESLint 均通过。

Qwen Code · qwen3.7-max

Reviewed at 9314398ca97713acb71f99f06c616f05cc34afd8 · re-run with @qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Confidence: 5/5 — clean across every stage; review feedback addressed, all tests green.

The re-run confirms the author addressed both actionable suggestions from the prior review: active AskUserQuestion summaries now render standalone "Provide information" (no more "Running Provide information"), and badge text opacity was bumped to 95% for AA contrast compliance. The implementation is minimal (5 files, +135/-18), the CSS follows existing conventions, i18n is complete, and all 1627 web-shell tests pass with clean typecheck and lint.

The two deferred suggestions — collapsed-sidebar dot indicator and sidebar render test — are correctly scoped out: the first is a separate feature, and the second was explicitly deferred per the resolved review thread. Neither blocks this PR.

Ships it. ✅

中文说明

置信度:5/5 — 各阶段均通过;审查反馈已处理,所有测试通过。

重新运行确认作者处理了上一轮审查的两个可操作建议:运行中的 AskUserQuestion 摘要现在独立显示"补充信息"(不再出现"正在执行 补充信息"),badge 文字不透明度提升到 95% 以满足 AA 对比度要求。实现精简(5 个文件,+135/-18),CSS 遵循现有规范,i18n 完整,全部 1627 个 web-shell 测试通过,typecheck 和 lint 均干净。

两个延后的建议——折叠侧边栏圆点指示器和侧边栏渲染测试——范围划分正确:前者是独立功能,后者已在已解决的审查线程中明确延后。均不阻塞本 PR。

可以合入。✅

Qwen Code · qwen3.7-max

Reviewed at 9314398ca97713acb71f99f06c616f05cc34afd8 · re-run with @qwen-code /triage

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@ytahdn
ytahdn requested review from chiga0 and wenshao July 15, 2026 10:50

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Suggestions are inline. Not reviewed: chunk 1 — no agent reported covering these; nobody read them.

— qwen3.7-max via Qwen Code /review

Comment thread packages/web-shell/client/components/sidebar/WebShellSidebar.tsx
Comment thread packages/web-shell/client/components/messages/ToolGroup.tsx

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Downgraded from Approve: CI failing (route).

— qwen3.7-max via Qwen Code /review

qwen-code-ci-bot pushed a commit that referenced this pull request Jul 15, 2026
@wenshao

wenshao commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Code Review — feat(web-shell): show sessions awaiting user action

Reviewed the diff (5 files, +133/−14). Overall this is a clean, well-scoped change that reuses existing tokens/patterns and ships matching EN/ZH strings and unit tests. No blocking issues found; a few minor suggestions below.

Overview

  • Sidebar sessions blocked on approval now render a green "Waiting for approval" badge; sessions blocked on AskUserQuestion render a blue "User input needed" badge, both alongside the existing running spinner.
  • AskUserQuestion tool-group summaries now read "Provide information" while active and "Asked N questions" when complete (replacing the flat "Asked user"), with the count derived from args.questions.

What's correct / done well

  • Dual-flag priority is handled. Both isWaitingForPermission and isWaitingForUserQuestion can be true simultaneously (bridge derives them by iterating pendingInteractions, bridge.ts:1533). needsUserInput = !isWaitingForPermission && isWaitingForUserQuestion correctly makes permission win, so a mixed state shows the green badge and green styling — no ambiguous rendering.
  • Flexbox is sound. .sessionMetaSlot { flex: 0 0 auto } keeps the badge from shrinking, and .sessionText (via the rule at WebShellSidebar.module.css:472) has min-width:0; overflow:hidden; text-overflow:ellipsis, so the session name truncates instead of overflowing the row. The documented tradeoff (names truncate sooner) is real but contained.
  • getAskUserQuestionCount fallback is sensible. questions is the correct schema key (the tool defines questions: Array<…>, 1–4 items — askUserQuestion.ts:84), and defaulting non-array/empty payloads to 1 cleanly covers streaming/legacy calls.
  • i18n is consistent. Both EN and ZH updated; Messages = Record<string, MessageValue> (i18n.tsx:16) is an open record, so retiring toolGroup.summary.askedUser and adding the two new keys is type-safe with no dangling references.
  • CSS mirrors existing patternscolor-mix tinting like .sessionLoading, and the hover/focus opacity-hide rules extend the .sessionTime/.sessionLoading treatment for .sessionAttention consistently (including the :not(.runningSession) qualifier, which is correct since a waiting session is a runningSession).
  • Good unit coverage of the summary logic: active vs. completed, multi-question count, and the legacy/empty→1 fallback.

Suggestions (all non-blocking)

  1. Wording nit — "Running Provide information". In formatToolGroupSummary, an active ask_user_question feeds provideInformation into toolGroup.running, yielding "Running Provide information" (ZH: "正在执行 补充信息"). Grammatically this reads a little off. Consider a phrasing that stands on its own (e.g. treat the ask as a special case that renders "Provide information" / "需要补充信息" without the "Running/正在执行" prefix). Purely cosmetic.
  2. Contrast (a11y). The badge text uses color-mix(in srgb, var(--success-color) 72%, transparent) (green) / --agent-blue-500 at 72% over a 10% tint. At 12px, 72%-opacity --success-color (#48bb78 in light theme) risks falling below WCAG AA 4.5:1 on a near-white sidebar. Worth a quick contrast check; bumping the text opacity or using a darker token would be safer.
  3. Collapsed sidebar has no signal. The badge only renders in the !collapsed branch, so users with a collapsed sidebar still can't tell which session needs action. A small dot indicator for collapsed mode would be a reasonable follow-up (out of scope here).
  4. Test gap — sidebar branch. The tool-summary path is well tested, but the new sidebar logic (dual-flag priority, needsUserInput styling selection) isn't covered by a unit test. Given how simple the branch is this is optional, but a small render test would lock in the priority behavior.

Security / performance

  • No concerns. Badge/label text is static i18n; getAskUserQuestionCount is O(1); per-session computation in render is trivial. No user-controlled content reaches aria-label or the DOM.

中文小结

改动清晰、范围合理,复用了已有的设计 token 与样式模式,EN/ZH 文案与单测均已补齐,未发现阻塞性问题。

  • 正确点isWaitingForPermissionisWaitingForUserQuestion 可能同时为真(bridge.ts:1533 遍历 pendingInteractions 推导),当前逻辑让「等待批准」优先,处理正确;.sessionMetaSlot { flex:0 0 auto } 配合 .sessionTextmin-width:0 截断,不会撑破行宽;getAskUserQuestionCount 对空/非数组回退为 1 合理,questions 也是正确的 schema 字段(1–4 个);Messages 是开放 record,键改名类型安全。
  • 建议(均非阻塞):①「Running Provide information / 正在执行 补充信息」读起来略拗口,可考虑对提问态单独文案,不加「正在执行」前缀;②徽标文字用 72% 不透明度的绿色/蓝色,12px 下浅色主题可能不满足 WCAG AA 对比度,建议核对;③折叠侧边栏未展示该状态,可作后续补充;④侧边栏双标志优先级逻辑缺单测,建议补一个渲染测试。
  • 安全/性能:无风险,文案为静态 i18n,计算为 O(1)。

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Suggestions are inline. Not reviewed: chunk 1 — no agent reported covering these; nobody read them.

— qwen3.7-max via Qwen Code /review

Comment thread packages/web-shell/client/components/messages/ToolGroup.tsx Outdated
@wenshao

wenshao commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

✅ Local runtime verification — PR #6956

I built the branch and drove the real WebShellSidebar and ToolGroup code — not just the unit tests — on Linux (which the PR checklist marks ⚠️). Both features behave exactly as described, with no console errors and no regressions in the existing sidebar suites. Recommendation: safe to merge.

Before → After (real component, headless Chromium)

The core win is visible immediately: on main all three blocked/running sessions render an identical spinner, so you can't tell which one needs you. With this PR the permission session gets a green Waiting for approval pill and the AskUserQuestion session a blue User input needed pill.

before vs after

Localization (English / 中文)

i18n en vs zh

How it was verified

Both screenshots come from the actual WebShellSidebar component mounted in a real browser (Vite dev + Playwright/Chromium), with the daemon SDK hooks fed fixed session fixtures. Same fixtures were rendered against main (materialized as a sibling component) for the "Before" panel.

Area Method Result
ToolGroup question-count summaries PR's own unit suite 28/28 pass
↳ tests actually pin the logic 3 targeted mutations all 3 killed
Sidebar attention badges real component in jsdom, all states + EN/ZH 7/7 pass
↳ test actually pins the logic 1 mutation (needsUserInput) killed
Badge colours (green vs blue) computed style in Chromium distinct & correct
Existing sidebar suites regression run 25/25 pass
Console / page errors in browser captured across all renders 0
Detail 1 — badge state matrix (real component)

Driving the real component with sessions in every attention state produced:

Session state (isWaitingForPermission / isWaitingForUserQuestion / hasActivePrompt) Badge Colour Extras
permission / – / active Waiting for approval green srgb(0.282, 0.733, 0.471) = #48bb78 spinner kept
– / question / active User input needed blue srgb(0.404, 0.522, 1) = #6785ff spinner kept
both / active Waiting for approval (permission wins) green
permission / – / idle Waiting for approval green no spinner, no time
– / – / idle (none) time shown
– / – / active (none) spinner only

This matches the code: needsUserInput = !isWaitingForPermission && isWaitingForUserQuestion, and the time is suppressed while a badge is shown. Colours are read via getComputedStyle, so the green/blue split is proven at the pixel level, not just by class name.

Detail 2 — mutation testing (proves the tests have teeth)

To confirm the suites would actually catch a regression, I introduced deliberate bugs and re-ran:

ToolGroup.tsx

  • getAskUserQuestionCount → always 1"Asked 3 questions" / "Asked 2 questions" tests fail ✔
  • active-status branch forced off ⇒ "Provide information" single-tool test fails ✔
  • formatToolGroupSummary active-name branch forced off ⇒ "Running Provide information" test fails ✔

WebShellSidebar.tsx

  • drop the !isWaitingForPermission guard from needsUserInput ⇒ the "permission wins when both flags set" test fails (badge wrongly gets the blue sessionAttentionUserInput class) ✔

All mutations were reverted; the working tree matches the PR head.

Detail 3 — how to reproduce locally
# unit + mutation surface
cd packages/web-shell
npx vitest run client/components/messages/ToolGroup.test.tsx      # 28 pass
npx vitest run client/components/sidebar/                          # existing sidebar suites pass

# real-browser render: mount WebShellSidebar with faked daemon hooks under
# Vite dev, drive with Playwright, screenshot ?v=before|after & ?lang=en|zh-CN

The browser harness fakes only the five daemon-SDK hooks the sidebar reads (useConnection/useActions/useWorkspace/useWorkspaceActions/useSessions) and re-exports everything else real, so the component tree is otherwise untouched.

Notes / nits (non-blocking)

  • As the PR itself calls out, the pill eats horizontal space so long session names truncate sooner (Refactor authRe…). Working as intended; visible in the screenshots.
  • The AskUserQuestion chat-summary change (Provide information while active, Asked N questions when done, legacy/empty → 1) is a pure function and is fully covered by the 28 unit tests above, so I verified it there rather than with a screenshot.

中文版本(点击展开)

✅ 本地真实运行验证 —— PR #6956

我在 Linux 上构建了该分支,并真实驱动了 WebShellSidebarToolGroup 组件代码(不仅仅是单元测试)——PR 勾选表中 Linux 标为 ⚠️,这里补上。两个功能都与描述完全一致,浏览器无任何 console 报错,也没有破坏现有侧边栏测试。结论:可以合并。

改动前 → 改动后(真实组件,headless Chromium)

核心价值一眼可见:在 main 上,三个"阻塞/运行中"的会话都只显示相同的 spinner,无法区分哪个在等你操作。合入本 PR 后,权限会话显示绿色 Waiting for approval(等待批准),AskUserQuestion 会话显示蓝色 User input needed(需要用户输入)。

(对比图见上方 01-before-after-en.png

本地化(英文 / 中文)

(中英对照图见上方 02-i18n-en-zh.png:英文 Waiting for approval / User input needed,中文 等待批准 / 需要用户输入)

验证方式

两张截图均来自真实的 WebShellSidebar 组件,在真实浏览器中挂载(Vite dev + Playwright/Chromium),仅把 daemon SDK 的 hook 替换为固定的会话数据。"改动前"面板用 main 版本的同名组件、相同数据渲染。

范围 方式 结果
ToolGroup 问题计数摘要 PR 自带单元测试 28/28 通过
↳ 测试确实锁住了逻辑 3 处定向变异 3 处全部被杀
侧边栏关注状态标签 jsdom 中真实组件,覆盖所有状态 + 中英文 7/7 通过
↳ 测试确实锁住了逻辑 1 处变异(needsUserInput 被杀
标签颜色(绿 vs 蓝) Chromium computed style 正确且可区分
现有侧边栏测试 回归运行 25/25 通过
浏览器 console / page 报错 全程捕获 0

状态矩阵(真实组件):

会话状态(等待权限 / 等待提问 / 运行中) 标签 颜色 其它
权限 / – / 运行 等待批准 绿 #48bb78 保留 spinner
– / 提问 / 运行 需要用户输入 #6785ff 保留 spinner
两者都有 / 运行 等待批准(权限优先) 绿
权限 / – / 空闲 等待批准 绿 无 spinner、无时间
– / – / 空闲 显示时间
– / – / 运行 仅 spinner

与代码一致:needsUserInput = !isWaitingForPermission && isWaitingForUserQuestion;标签出现时隐藏时间。颜色通过 getComputedStyle 读取,绿/蓝区分在像素层面得到证明。

变异测试(证明测试有效):

  • ToolGroup.tsxgetAskUserQuestionCount 恒为 1 → "Asked N questions" 测试失败 ✔;关闭 active 分支 → "Provide information" 测试失败 ✔;关闭 formatToolGroupSummary 的 active 名称分支 → "Running Provide information" 测试失败 ✔。
  • WebShellSidebar.tsx:去掉 needsUserInput!isWaitingForPermission 守卫 → "两个标志都置位时权限优先" 测试失败 ✔。
  • 所有变异均已还原,工作区与 PR HEAD 一致。

说明 / 小建议(不阻塞合并)

  • 如 PR 所述,标签占用横向空间,较长的会话名会更早被截断(Refactor authRe…),属预期行为,截图可见。
  • AskUserQuestion 聊天摘要的改动(运行中显示 补充信息、完成后显示 已询问 N 个问题、旧数据/空数组按 1 计)是纯函数,已被上面的 28 个单元测试完整覆盖,故用单测而非截图验证。

Verified locally on Linux against the PR head merged with main. Screenshots rendered from the real component; no source was modified in the verified tree.

@ytahdn

ytahdn commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the actionable review suggestions in 9314398ca:\n\n- Active AskUserQuestion summaries now show standalone “Provide information” / “补充信息” without the misleading Running/正在执行 prefix.\n- Badge backgrounds remain at the requested subtle 10% tint, while text now mixes 95% of the status token with 5% theme foreground. This preserves the intended visual treatment and brings the light-theme green/blue text above AA contrast against the tinted sidebar background.\n\nThe collapsed-sidebar indicator is a reasonable follow-up but is outside this PR’s requested expanded-row badge scope. The sidebar DOM test suggestion remains intentionally deferred per the author’s explicit test-scope decision, as noted in the resolved thread.

qwen-code-ci-bot pushed a commit that referenced this pull request Jul 15, 2026
wenshao pushed a commit that referenced this pull request Jul 15, 2026
Add a `sidebar attention` scenario: four sessions in distinct states —
waiting-on-permission, waiting-on-user-question, running, idle — so the
sidebar renders #6956's "Waiting for approval" / "User input needed"
attention pills. Renders in light and dark; asserts on session names
(present with or without the pills) so the frame is the same shape on
main and the PR, letting the before/after preview surface the pills.

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Not reviewed: chunk 1 — no agent reported covering these; nobody read them.

— qwen3.7-max via Qwen Code /review

@ytahdn

ytahdn commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

@qwen-code /triage

@doudouOUC doudouOUC left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve — clean, well-scoped web-shell UI change; no blocking issues.

Verified:

  • Both isWaitingForPermission / isWaitingForUserQuestion can be set at once (bridge pendingInteractions); giving permission priority is a sound choice, and the blue variant is correctly gated to the pure-question state.
  • Sidebar three-way render (badge / spinner / time) is correct; running spinner is retained alongside the badge as described.
  • getAskUserQuestionCount fallback is safe and args.questions has a real data source (merged from remembered permission info), so completed summaries show the true count rather than always falling back to 1.
  • Types are correct (DaemonSessionSummary declares both fields); CSS tokens exist for light/dark; layout truncates the session name so the fixed-width badge can't overflow.
  • i18n complete in EN + ZH; old askedUser key fully removed with no remaining consumers.
  • ToolGroup.test.tsx passes locally (28/28), covering active / completed / multi-question / both fallback paths.

Non-blocking nits (fine to defer): the badge <span> carries a redundant aria-label identical to its visible text; and the sidebar DOM has no regression test (already acknowledged by the author as an intentional out-of-scope gap).

CI note: the only red check, review-pr, ran exactly 30m10s — a workflow timeout of the automated reviewer, not a code defect. All functional checks (unit tests, typecheck/lint, E2E smoke, visuals) are green.

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@wenshao
wenshao added this pull request to the merge queue Jul 15, 2026
Merged via the queue into QwenLM:main with commit 03e796e Jul 15, 2026
88 of 91 checks passed
pull Bot pushed a commit to Stars1233/qwen-code that referenced this pull request Jul 16, 2026
…wenLM#6964)

* test(web-shell): add a mermaid diagram visual scenario

Add a `mermaid diagram` scenario to the visuals suite so the preview
covers the Mermaid rendering surface — an assistant message with a
mermaid fenced flowchart. It renders the real MermaidBlock (async
mermaid import, injected <svg>) in light and dark, waiting on the
rendered SVG so the capture is never the "rendering…" placeholder.

This is the surface the diagram zoom/pan work (QwenLM#6881) enriches, so once
the before/after preview lands it gives that PR a real before/after
target instead of an unrelated canned screenshot.

* test(web-shell): add a split-view (+ maximize) visual scenario

Add a `split view` scenario: enter the two-pane split via the `?split=a,b`
deep link, then maximize one pane (QwenLM#6951). Captures the tiled state (both
panes, with the maximize controls) and the maximized state (one pane
filling, restore control) in light and dark, driving the real SplitView
against the mock daemon serving two sessions.

* test(web-shell): add a sidebar attention-badge visual scenario

Add a `sidebar attention` scenario: four sessions in distinct states —
waiting-on-permission, waiting-on-user-question, running, idle — so the
sidebar renders QwenLM#6956's "Waiting for approval" / "User input needed"
attention pills. Renders in light and dark; asserts on session names
(present with or without the pills) so the frame is the same shape on
main and the PR, letting the before/after preview surface the pills.

* test(web-shell): derive the split view's second session from the scenario list

Addresses a review suggestion: the split view test hardcoded the
'previous-session' id, which only worked because it is in
createWebShellDaemonScenario's default sessions list. Derive the second
pane's session from the scenario's own list instead (and throw a clear
error if absent), so a future rename/removal of that default surfaces as
a self-explaining failure rather than a confusing SSE connection timeout.

* test(web-shell): tidy split copy and mermaid width in visual scenarios

Address review nits on the visual scenarios:
- Split scenario: the mock replays the same events into both panes, so
  "Here is the first pane of the split." read wrong in the second pane.
  Use pane-neutral copy ("Here are the two sessions, side by side.").
- Mermaid scenario: the flowchart's rightmost node clipped at the code-block
  edge at the 1280px capture viewport. Shorten the node labels (same nodes and
  flow) so the whole diagram fits with margin.

Re-ran both scenarios (light + dark) locally: 4/4 pass, and confirmed in the
captures that the diagram no longer clips and the neutral copy reads correctly
in both panes.

* test(web-shell): capture split-view restore and assert all sidebar sessions

Address review nits on the visual scenarios:
- Split view: after maximize, click "Restore pane" and capture the restored
  tiled layout, asserting the maximize control returns on both panes — so a
  regression in the restore path is caught, not just the tiled and maximized
  states.
- Sidebar attention: assert all four session names render (not just the two
  waiting ones). The running session is also the loaded one, so its name also
  shows in the main view — scope the running/idle checks to the sidebar
  landmark so the match stays unambiguous.

---------

Co-authored-by: wenshao <wenshao@example.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants