For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.0/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.0/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.0/components/execution-item.md.

执行项

执行项使用原生折叠结构呈现单个命令、工具调用、编辑、搜索、浏览器操作或 MCP 调用。它保持稳定的集成契约,领域细节由应用提供。

实时预览
运行聚焦测试npm test -- runtime.spec.ts运行中
PASS tests/runtime.spec.ts Watching cancellation cleanup…
打开外部文档browser · learn.chatgpt.com等待中

打开此站点前需要获得批准。

用法

<details class="execution-item" data-state="running">
  <summary>
    <span data-execution-icon aria-hidden="true">...</span>
    <span data-execution-identity
      ><strong>运行测试</strong><small>npm test</small></span
    >
    <span data-execution-status>运行中</span>
    <span data-execution-disclosure aria-hidden="true">...</span>
  </summary>
  <section>...</section>
  <footer>...</footer>
</details>

参数

API取值用途
class="execution-item"必须用于 <details>原生折叠根节点
data-statequeued、running、waiting、success、error、cancelled与提供方无关的执行状态
data-execution-icon可选工具类型图标;标题已说明操作时作为装饰
data-execution-identity必须操作标题和紧凑目标或命令
data-execution-status推荐文本状态,通常组合 Status Badge
data-execution-disclosure可选具有方向性的折叠图标
直接子 <section>可选参数、输出、补丁、证据或错误详情
直接子 <footer>可选停止、重试、检查或复制操作

状态与变体

将后端特定状态映射到六种公共状态,并在 data-execution-status 中保留具体文案。等待审批或外部输入时使用 waiting。发生错误或取消后保留部分输出。只有父项代表真实委派组时才嵌套执行项,并避免过深的折叠树。

无障碍

原生 <details> 与 <summary> 提供折叠语义和键盘行为。可见标题必须在不依赖图标的情况下说明操作。不要把 Summary 放入按钮中。普通输出使用文本或 <pre>;只有记录确实实时更新时才使用 Live Region,高吞吐流应组合日志查看器。