fix(composer): show command results as a single-line notice strip by AlphaCatMeow · Pull Request #1038 · Stack-Cairn/LiveAgent · GitHub
Skip to content

fix(composer): show command results as a single-line notice strip - #1038

Merged
xiaozhou26 merged 1 commit into
Stack-Cairn:v2-kbrianfrom
AlphaCatMeow:fix/composer-command-notice
Oct 21, 2026
Merged

xiaozhou26 merged 1 commit into
Stack-Cairn:v2-kbrianfrom
AlphaCatMeow:fix/composer-command-notice

Conversation

@AlphaCatMeow

Copy link
Copy Markdown
Contributor

「/」指令的本地结果面板原来是带边框的卡片:标题一行(会话忙时是「指令执行失败」),正文再以 /goal: 开头。会话忙只是暂时不能发送,却显示成失败;指令名重复出现,一条提示占两到三行。

Closes #1037

改动

  • 所有结果统一为一条提示条:语气图标 + 指令名标签 + 文案 + 关闭按钮;标题只作无障碍名称(aria-label),不再单独占一行。
  • 语气:会话忙为黄色提醒(tone: "warning",role="status"),错误为红色(role="alert"),普通提示为灰色。
  • 会话忙文案缩短:「任务进行中,结束或停止后再发送」/「A task is running. Send it after it finishes or stop it first」。
  • 指令名从文案里拿出来,单独显示为标签;用户模板的长指令名最多占四成宽度,超出截断,悬停看全名。
  • /loop 的结果用同一种提示条:
    • 创建成功:首行「已创建定时任务 · 每 N 分钟」,第二行是单行截断的提示词(悬停看全文),第三行是取消命令 /loop cancel <id>,始终可见。
    • 列表:首行「定时任务 · N」,下方逐行显示 id / 间隔 / 提示词(已停用的加删除线),超过 12rem 滚动;没有任务时只有一行。
  • GUI 与 WebUI 共用 ComposerCommandPanel,两端同时生效;composerCommands.ts 的面板状态新增可选字段 command、tone,只在本地渲染,不进入转录区,也不发给模型。

截图

桌面 GUI(调试版真机,运行中发送 /goal):黄色会话忙提示,草稿放回输入框。

桌面:会话忙提示

桌面 GUI:/loop list 没有任务时的灰色提示条。

桌面:/loop list

WebUI 390 宽(Gateway 内嵌 WebUI):/loop list 灰色提示条,以及 /loop cancel 缺少 id 时的红色用法错误(多行文案在条内换行,关闭按钮不被挤出)。

WebUI 390 宽:/loop list WebUI 390 宽:/loop 用法错误

验证

  • 基线:upstream/v2-kbrian 2075465
  • 静态:typecheck:ui / gui / webui 通过;biome(LF)通过;check-ui-boundaries 通过;git diff --check 通过
  • 新增测试:
    • test/chat/composer-command-notice.test.mjs:会话忙映射为 warning 且带指令名、文案不再带 /goal: 前缀;错误、普通提示三种语气的图标与角色;/loop 创建与列表的提示条(无边框、Repeat 图标、/loop 标签、取消命令、列表行、停用删除线、空列表)。
    • test/chat/command-notice-long-command-chip.test.mjs:长指令名标签有宽度上限并截断,不挤掉文案和关闭按钮(复审时写成先失败的回归)。
    • test/chat/command-notice-loop-long-prompt.test.mjs:长提示词在创建结果里单行截断、悬停看全文(复审时写成先失败的回归)。
    • test/chat/composer-commands.test.mjs:断言随面板状态的新字段调整(message 不带前缀、command 单独给出)。
  • 全量(7 个批次全部运行):总计 3927,通过 3923,失败 3,跳过 1;3 个失败均为本机环境性失败(cargo 冒烟用例超过其 180 秒上限,直接 cargo test 在 Windows 基线也有 23 条环境失败,本 PR 不改 src-tauri;两条按 CWD 读源码,在 crates/agent-gui 下重跑通过)
  • 对抗复审:两轮独立子代理复审。首轮 P2:长指令名标签挤掉文案、黄色图标对比度不足;第二轮 P2:创建结果把长提示词并进首行,600 字提示词时提示条高 256 / 752 / 1200px(1280 / 390 / 320 宽)、把取消命令和输入框推出视口。均已修复并补回归;修复后同样输入为 80 / 128 / 192px,GUI/WebUI × 浅色/深色均无横向溢出。
  • 真机:调试版桌面运行中发送 /goal 出现黄色提示、/loop list 灰色提示;WebUI 390 宽 /loop list 与 /loop cancel(缺 id)各验一遍;用户验收通过。
  • 未覆盖:WebUI 在会话运行中按回车会把 /goal 放进等待队列,不会出现会话忙提示,所以会话忙的截图只有桌面端。

The "/" command result panel was a bordered card with a "Command failed"
title row above the message, which repeated the command as a "/goal: "
prefix. A busy conversation therefore read as a hard failure. Every result
is now one strip: a tone icon, the command name as a chip, the message and a
close button. A busy conversation is a yellow warning with a shorter message,
errors are red and plain notices gray. /loop results use the same strip;
the created task's prompt keeps its own truncated line so the cancel command
stays visible.

Closes Stack-Cairn#1037

@xiaozhou26 xiaozhou26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed notice tone/accessibility, command-chip truncation, long loop prompt limits, cancel visibility, scrollable lists and close behavior. Browser exercised warning/error/info and loop-created/list/empty states, including long text and narrow screens; busy /goal restores draft and retries while idle. No merge blocker found.

Integration: merged #1038/#1040/#1042 locally on v2-kbrian@2075465b without conflicts. Shared UI/GUI/WebUI typechecks, GUI 3407 passed / 10 skipped, WebUI 809 passed, both Vite production builds, UI boundaries and diff checks passed. Browser: real shared components with GUI and WebUI styles at 1280/390/320px; 36 goal active/waiting/editing geometry cases, 144 notice cases across language/theme, busy /goal draft restoration and idle resend, plus existing queue/goal and branch/disclosure interactions. Windows Edge-specific tests skip on macOS; Chrome measurements supplement geometry checks. Native Tauri/live-model E2E not performed.

@xiaozhou26
xiaozhou26 merged commit 3ecb5a4 into Stack-Cairn:v2-kbrian Oct 21, 2026
12 checks passed
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.

2 participants