Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
refactor(ui): unify collection page patterns (#5258)
Jiayuan Zhang5541819f9817
diff --git a/docs/design.md b/docs/design.mdindex eea51a4a20..2472bad90b 100644--- a/docs/design.md+++ b/docs/design.md@@ -2,6 +2,8 @@本文档定义 Multica 的视觉语言和交互规范。所有 UI 开发以此为准。+页面级信息架构、布局组合与一致性治理见 [`ui-consistency-audit.md`](./ui-consistency-audit.md)。+---## 1. 设计哲学diff --git a/docs/ui-consistency-audit.md b/docs/ui-consistency-audit.mdnew file mode 100644index 0000000000..430caff265--- /dev/null+++ b/docs/ui-consistency-audit.md@@ -0,0 +1,363 @@+# Multica UI 一致性问题与页面模式层治理++> Status: Draft+> Owner: TBD+> Last updated: 2026-07-11+> Related implementation: [PR #5263](https://github.com/multica-ai/multica/pull/5263)++## TL;DR++Multica 当前的主要 UI 问题不是缺少颜色 token、Button 或 Card,而是缺少一层被明确命名、文档化和持续执行的 **Page Pattern Layer(页面模式层)**。++现有基础大致分成三层:++1. `packages/ui/styles/` 已经提供颜色、surface、间距等设计 token。+2. `packages/ui/components/` 已经提供 Button、Input、Card、Tabs、Empty 等基础组件。+3. `packages/views/` 中也已经出现 `CollectionPageHeader`、`CollectionPageState`、`SettingsTab`、`SettingsSection`、`SettingsCard`、`SettingsRow` 等页面模式的早期实现。++但第三层仍然是局部的、未完成的:没有覆盖所有主要页面类型,没有清晰的使用边界,也没有 review checklist 或迁移计划。因此业务页面仍然会自行决定标题、导航、卡片、分割线、表单、空状态和保存反馈,最终形成“基础组件相同,但页面体验不同”的局面。++Agent 详情页重构是页面模式层的一次试点,不应停留在单页优化。下一步应该把其中可复用的结构提炼为明确的页面模式,再逐步迁移其他页面。++---++## 1. 文档目的++本文档用于:++- 记录本轮 UI review 中发现的问题,避免问题只存在于对话和截图中。+- 明确 UI 不一致的架构根因,而不是继续逐页修补 CSS。+- 区分 Design Token、基础组件、页面模式和业务页面各自的职责。+- 记录 Agent 详情页试点中已经处理或仍需验证的事项。+- 给出下一阶段 UI 治理的优先级、验收标准和开放问题。++本文档不是新的视觉规范。颜色、字体、surface、间距和基础交互仍以 [`docs/design.md`](./design.md) 为准。++---++## 2. 核心判断:缺失的是页面模式层++### 2.1 当前 UI 分层++| 层级 | 回答的问题 | 当前载体 | 当前状态 |+| --- | --- | --- | --- |+| Design Token | 颜色、间距、圆角、阴影应该是什么 | `packages/ui/styles/`、`docs/design.md` | 基本完整 |+| UI Primitive | Button、Input、Card、Tabs 如何表现 | `packages/ui/components/` | 基本完整 |+| Page Pattern | 页面标题、分区、导航、列表、设置表单、状态页如何组合 | `packages/views/layout/`、`packages/views/settings/components/settings-layout.tsx` 等 | **局部存在,但未固化** |+| Business Page | Agent、Issue、Runtime 等具体业务如何呈现 | `packages/views/<domain>/` | 大量自行组合 |++Token 和 Primitive 只能保证局部视觉相似,不能自动保证页面一致。它们不会回答以下问题:++- 列表页标题、数量、描述和主操作应该放在哪里?+- 设置页应该用卡片还是平铺?一行可以放几个设置?+- 二级导航应该横向还是纵向?什么时候需要 URL 深链?+- Detail 页面如何区分状态概览、工作记录和配置?+- Empty、Loading、Error、Not Found 是否共享尺寸和文案结构?+- 可编辑列表是持续显示多个 Input,还是列表 + 单个 composer?+- 保存状态、未保存提醒和离开保护如何统一?++如果这些问题没有标准答案,每个业务页面就会重新设计一次。++### 2.2 根因++当前问题可以概括为:++> 底层 token 和基础组件已经比较完整,但中间的“页面模式层”没有被明确固化,也没有被持续执行。++具体表现为:++1. **模式没有被命名。** 开发者知道有 Card、Tabs 和 Empty,但不知道当前页面属于 Collection、Settings 还是 Workbench Detail。+2. **模式没有完整覆盖。** Collection 和 Settings 已经有早期抽象,Detail、Editable List、Inspector、Split Pane 等仍主要由页面自行实现。+3. **模式没有使用边界。** 什么时候用 Card、什么时候只用 spacing、什么时候允许 divider,仍依赖个人判断。+4. **模式没有持续执行。** 缺少新页面 checklist、视觉回归样例和跨页面 review,局部 PR 很容易重新引入平行实现。+5. **复用多停留在 JSX。** 相似页面会复制布局 class,而不是复用带语义的页面组件;一旦规范变化,需要逐页修改。++---++## 3. 已发现的问题++### 3.1 全局问题++| 类别 | 当前问题 | 影响 |+| --- | --- | --- |+| 页面 Header | 标题高度、左右 padding、数量、描述和操作区组合不一致 | 页面切换时节奏跳变 |+| 二级导航 | 同类配置有的横向、有的纵向,有的只存在本地 state | 信息架构和深链行为不稳定 |+| Section 分组 | Card、divider、背景色和纯 spacing 混用,缺少明确优先级 | 页面过重或分组不清 |+| 表单布局 | 单行单项、双列设置、label/value 比例和保存区位置不一致 | 扫读和操作成本增加 |+| 列表编辑 | 有的持续显示 Input,有的用 dialog,有的就地编辑 | 同类操作需要重新学习 |+| 状态页面 | Empty、Loading、Error、Not Found 各自实现 | 图标、留白、文案和操作不一致 |+| 保存反馈 | Toast、inline status、disabled button、dirty guard 组合不统一 | 用户无法稳定判断是否已保存 |+| 内容约束 | 长描述、代码、ID 和用户输入的换行/截断策略不统一 | 容易溢出或出现密集文本墙 |+| 响应式与无障碍 | icon-only action、focus、移动端折叠依赖页面自行处理 | 容易产生不可访问或小屏失效的页面 |++### 3.2 Agent 详情页问题记录++状态说明:++- **已实现**:当前 Agent 详情页重构分支已有对应实现。+- **试点中**:已在 Agent 页面采用,但尚未抽象或推广为全局模式。+- **待验证**:需要在合并前进行完整视觉或交互回归。+- **开放**:仍需要产品或架构决策。++| 区域 | 问题 | 处理方向 | 状态 |+| --- | --- | --- | --- |+| 整体信息架构 | 原详情页更像后端字段检查器,观察、工作和配置混在一起 | 重组为 Overview、Work、Capabilities、Settings | 试点中 |+| 二级导航 | Capabilities 与 Settings 的二级选项使用横向菜单,扩展后拥挤 | 桌面端采用稳定的纵向 section nav,并保持 URL 深链 | 已实现 |+| Integrations | 本地 feature flag 默认关闭,Capabilities 中缺少 Integrations | 根据系统配置显示 Integrations,并纳入 Capabilities | 已实现 |+| Overview / Attention | “Tasks Need Attention”价值不明确、优先级过高 | 无明确干预价值时移除,不制造伪告警 | 已实现 |+| Overview / Recent Work | 条目过少;Issue 维度还是 Session 维度没有明确 | 增加可见条目;产品语义见开放问题 §8.1 | 试点中 |+| Overview / Skills | 多个 skill 时 divider 与下方横线粘连 | 优先用 spacing 分组,避免连续 divider | 待验证 |+| Instructions | System Prompt 被设计成单行 Input | 使用支持长文本、Markdown 和合理高度的 Textarea | 已实现 |+| MCP | 描述过长,缺少换行和信息层级,呈现为密集文本墙 | 缩短主文案,把说明拆成辅助信息并约束宽度 | 已实现 |+| General | 信息展示感强,不像配置页;Visibility 等交互不顺手 | 使用标准 Settings section/row,明确 label、description、control | 试点中 |+| Settings 分组 | 页面缺少稳定分组,或使用不符合 surface 规范的 Card | 独立设置组使用白色 SettingsCard;组间使用 section spacing | 已实现 |+| Settings 行布局 | 一行放两个 setting,扫读和响应式表现差 | 默认单行单项;除非字段天然组成一个原子输入 | 已实现 |+| Access | Shared 等权限不是简单 toggle,现有交互不能表达复杂规则 | Access 独立为 Settings 子 Tab,使用专门权限模型 | 试点中 |+| Details | Owner、Created、Updated 等只读元数据被放进 Settings | 从可编辑设置中移出,放到 Overview 或 inspector | 已实现 |+| Environment | 当前结构可暂时保留 | 后续迁移到统一 editable key-value pattern | 开放 |+| Custom Args | 横线过多;每个参数永久显示为 Input;新增一项就增加一个输入框和 divider | 改为有序 token 列表;只有新增/编辑项进入 composer;独立命令预览 | 已实现 |++### 3.3 Custom Args 暴露出的通用模式问题++Custom Args 并不只是一个局部样式问题,它暴露了 “Editable List” 页面模式缺失:++- 数据在静止状态下应该首先是列表,不是表单。+- 编辑态应该是临时状态,不应该让所有条目永久显示为 Input。+- 新增操作应该把内容加入列表,而不是无限扩张表单结构。+- 参数顺序有语义,应明确显示顺序。+- 每个列表项对应一个 argv token;包含空格的 token 不应被前端自行拆分。+- 命令预览属于结果反馈,应和编辑列表分开呈现。++这个模式未来可以复用于:Custom Args、Environment Variables、Webhook Headers、Repository Rules、Token/Secret 列表等,但不同数据类型需要保留各自的验证和敏感信息策略。++---++## 4. 建议固化的页面模式++### 4.1 Collection Page++适用于 Agents、Projects、Skills、Runtimes、Squads、Autopilots 等实体集合。++应统一:++- Header 的 icon、title、count、description 和 actions。+- 列表/网格容器的 page padding 和滚动策略。+- Empty、Loading、Error、No Results 状态。+- 主操作在小屏下的收缩方式。+- 筛选、搜索和视图切换的位置。++现有基础:++- `packages/views/layout/collection-page.tsx`+- `CollectionPageHeader`+- `CollectionPageHeaderAction`+- `CollectionPageState`++下一步不是再造一套组件,而是补齐使用文档、样例和迁移覆盖。++### 4.2 Settings Page++适用于 Workspace Settings、Account Settings、Agent Settings 和其他配置型页面。++应统一:++- `SettingsTab → SettingsSection → SettingsCard → SettingsRow` 的层级。+- 默认单行单项;复杂 compound control 必须说明原因。+- label、description 和 control 的宽度与对齐。+- auto-save 与 explicit save 两种模式的反馈。+- dirty state、离开保护、error 和 success 状态。+- 权限不足时的只读表现。++现有基础:++- `packages/views/settings/components/settings-layout.tsx`+- `SettingsTab`+- `SettingsSection`+- `SettingsCard`+- `SettingsRow`+- `SettingsSaveState`++需要决定这些组件是否继续归属于 Settings domain,还是迁移到更通用的 `packages/views/layout/`。++### 4.3 Workbench Detail Page++适用于 Agent、Runtime、Squad、Member 等同时包含身份、状态、历史和配置的详情页。++应统一:++- Identity header:名称、状态、关键 metadata 和主操作。+- 一级导航:Overview、Work/Activity、Capabilities、Settings。+- 二级导航:当选项超过 2–3 个或文案较长时使用纵向 section nav。+- Overview 只呈现判断和行动所需的信息,不复制全部字段。+- Settings 只放可编辑配置;只读 metadata 不混入设置。+- URL 必须反映 tab/section 状态,支持刷新和分享。+- 不为不存在的健康度或进度制造伪指标。++Agent 详情页是此模式的第一个试点,但不能直接把 Agent 业务组件当作全局抽象。应先识别 Runtime、Squad、Member 的共同结构,再定义最小公共 API。++### 4.4 Editable List++适用于用户维护一个有序或无序的小型配置集合。++默认交互:++1. 静止状态显示列表项。+2. 点击 Add 后只出现一个 composer。+3. 点击 Edit 后只让目标项进入编辑态。+4. Enter 提交,Escape 取消;新增/编辑时焦点进入输入区。+5. 删除先更新本地 draft;外部持久化由统一 Save 或 auto-save 策略负责。+6. 空状态仍保留清晰的主操作。+7. 长值必须支持截断、换行或展开查看。++不应把所有 Editable List 都抽成一个万能业务组件。可以共享布局、状态和 action slot,但验证、字段结构和安全策略留在 domain 层。++### 4.5 Page State++所有页面至少需要明确以下状态:++- Initial loading+- Background refreshing+- Empty+- No search results+- Permission denied+- Not found+- Recoverable error+- Fatal error++这些状态应复用一致的尺寸、语气和 action 位置,但不能用同一条空状态文案覆盖不同原因。++---++## 5. 组件归属原则++| 内容 | 推荐位置 | 约束 |+| --- | --- | --- |+| 无业务语义的原子组件 | `packages/ui/` | 不得依赖 `@multica/core` |+| 跨 domain 的页面模式 | `packages/views/layout/` | 只定义布局、slot 和交互契约 |+| 某类页面的共享模式 | `packages/views/<domain-or-pattern>/` | 允许有限业务语义,但不得绑定平台路由 |+| 具体业务页面 | `packages/views/<domain>/` | 组合模式并负责数据、权限和文案 |+| Next.js / Electron 接线 | app platform layer | 不进入 shared views |++判断一个结构是否应该抽取时,优先问:++1. 它表达的是视觉细节,还是稳定的页面语义?+2. 第二个真实使用者是谁?+3. 抽取后能否减少业务页面对 spacing、divider、responsive class 的重复决策?+4. 是否能通过 slot 保持业务差异,而不是制造大量 boolean prop?++---++## 6. 下一步实施计划++### Phase 0:建立基线++- [ ] 为 Collection、Settings、Workbench Detail、Editable List、Page State 各补一个 canonical example。+- [ ] 建立页面清单,标记每个页面当前采用的模式和偏差。+- [x] 给 `docs/design.md` 增加本文件入口。+- [ ] 确认 Agent 详情页试点的视觉和交互验收结果。++### Phase 1:固化现有模式++- [ ] 补齐 Collection Page 的 loading、filter toolbar 和 responsive 规范。+- [ ] 明确 Settings explicit-save / auto-save 两套状态契约。+- [ ] 从 Agent 详情页提炼最小 Workbench Detail shell,而不是复制整页。+- [ ] 提炼 Editable List 的布局契约,并用第二个真实页面验证抽象。+- [ ] 为 pattern components 增加结构和无障碍测试。++### Phase 2:迁移高频页面++建议优先级:++1. Agents / Skills / Runtimes / Projects 等 collection 页面。+2. Workspace Settings 与 Agent Settings。+3. Runtime / Squad / Member detail 页面。+4. Environment、Custom Args 和其他 editable configuration lists。++每次迁移应是小 PR,不在同一 PR 中同时改变业务行为和全局视觉规范。++### Phase 3:持续执行++- [ ] 在 PR template 中加入 Page Pattern checklist。+- [ ] 新页面必须声明采用的 page pattern;偏离时说明原因。+- [ ] 给 canonical examples 增加 light/dark、中文/英文和窄屏视觉回归。+- [ ] 定期删除迁移后遗留的平行组件和重复 class 组合。+- [ ] 将审计从一次性项目变成每个季度的 UI consistency review。++---++## 7. 验收标准++页面模式层达到可用状态,需要同时满足:++1. 新页面可以先选择页面模式,再填充业务内容,而不是从空白 `<div>` 开始。+2. 同类页面的 header、导航、section、empty/error 和 action 位置一致。+3. 业务页面不再重复决定基础 padding、divider、card 和保存反馈。+4. 模式组件支持 keyboard、focus、overflow、responsive 和 i18n 长文案。+5. light/dark、中文/英文、desktop/web 至少有 canonical visual coverage。+6. 模式允许业务差异,但偏差是显式决定,不是无意复制。+7. 新抽象至少由两个真实页面验证,避免只为单页包装 JSX。++---++## 8. 开放问题++### 8.1 Agent Recent Work 使用 Issue 还是 Session 维度++需要先确认该区块回答的问题:++- 如果回答“这个 Agent 最近交付了什么”,Issue/Task 是更接近用户心智的单位。+- 如果回答“这个 Agent 最近每次执行发生了什么”,Session 是更准确的诊断单位。++建议不要在同一个平铺列表中混合两个粒度。可以默认使用 Issue/Task 维度,把最新 Session 状态作为行内 metadata;完整 Session 历史留在 Work 页面。++### 8.2 Settings pattern 的归属++当前实现位于 `packages/views/settings/components/settings-layout.tsx`,但 Agent Settings 已经复用它。需要决定:++- 保持当前位置,把 Settings 当作共享 pattern package;或+- 迁移到 `packages/views/layout/settings-*`,让归属与实际用途一致。++在迁移前不要再创建第二套 Settings layout。++### 8.3 Card 与 flat section 的边界++默认遵循 `docs/design.md` 的容器优先级:spacing → 单条 divider → 背景变化 → Card。++建议补充的判断是:++- 独立设置组、可整体操作的信息块可以使用 Card。+- 连续阅读内容、元数据清单和普通列表不应每项一张 Card。+- Card 内不要再通过多层 border 制造“卡片套卡片”。++### 8.4 Detail pattern 的最小公共部分++Agent、Runtime、Squad 和 Member 的详情页并不完全相同。抽象前需要确认真正共享的是 shell、header、navigation 和 section layout,还是还包括 inspector。原则上优先抽取稳定外壳,业务内容通过 slot 注入。++---++## 9. 新页面 Review Checklist++- [ ] 这个页面属于哪一种 page pattern?+- [ ] 是否复用了现有 Header、Section、State 和 Action 模式?+- [ ] 是否出现了业务页面自定义的 Card、divider 或 empty state?为什么?+- [ ] 设置是否默认单行单项?复合字段是否真的是一个原子输入?+- [ ] URL 是否反映 tab、filter、pagination 或 section 等可分享状态?+- [ ] Loading、Empty、Error、Permission 和 Not Found 是否被分别处理?+- [ ] 长文案、长 ID、用户输入和窄屏是否不会溢出?+- [ ] icon-only button 是否有 accessible name?键盘 focus 是否可见?+- [ ] light/dark 和至少一种 CJK locale 是否完成视觉检查?+- [ ] 是否新增了一个只服务当前页面、但其实表达通用模式的本地组件?++---++## 10. 相关文件++- [`docs/design.md`](./design.md)+- `packages/ui/styles/tokens.css`+- `packages/ui/components/`+- `packages/views/layout/collection-page.tsx`+- `packages/views/layout/page-header.tsx`+- `packages/views/settings/components/settings-layout.tsx`+- `packages/views/agents/components/agent-detail-page.tsx`+- `packages/views/agents/components/agent-overview-pane.tsx`+- `packages/views/agents/components/tabs/custom-args-tab.tsx`diff --git a/packages/ui/components/ui/button.tsx b/packages/ui/components/ui/button.tsxindex dfa8abd531..d43f920308 100644--- a/packages/ui/components/ui/button.tsx+++ b/packages/ui/components/ui/button.tsx@@ -6,7 +6,7 @@ import { cva, type VariantProps } from "class-variance-authority"import { cn } from "@multica/ui/lib/utils"const buttonVariants = cva(- "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform] outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants: {variant: {diff --git a/packages/ui/components/ui/empty.tsx b/packages/ui/components/ui/empty.tsxindex 0635fb1685..a9580d88fb 100644--- a/packages/ui/components/ui/empty.tsx+++ b/packages/ui/components/ui/empty.tsx@@ -55,9 +55,9 @@ function EmptyMedia({)}-function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {+function EmptyTitle({ className, ...props }: React.ComponentProps<"h2">) {return (- <div+ <h2data-slot="empty-title"className={cn("font-heading text-sm font-medium tracking-tight",@@ -70,7 +70,7 @@ function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {return (- <div+ <pdata-slot="empty-description"className={cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",diff --git a/packages/ui/components/ui/list-grid.tsx b/packages/ui/components/ui/list-grid.tsxindex 46a9acf77d..683ed115e9 100644--- a/packages/ui/components/ui/list-grid.tsx+++ b/packages/ui/components/ui/list-grid.tsx@@ -85,6 +85,7 @@ function ListGridHeaderCell({if (!onSort) {return (<div+ role="columnheader"className={cn("flex min-w-0 items-center px-2 text-xs text-muted-foreground",align === "right" && "justify-end",@@ -99,6 +100,14 @@ function ListGridHeaderCell({const Arrow = sorted === "asc" ? ArrowUp : ArrowDown;return (<div+ role="columnheader"+ aria-sort={+ sorted === "asc"+ ? "ascending"+ : sorted === "desc"+ ? "descending"+ : undefined+ }className={cn("flex min-w-0 items-center px-2",align === "right" && "justify-end",@@ -145,6 +154,7 @@ function ListGridBody({}: React.ComponentProps<"div">) {return (<div+ role="rowgroup"className={cn("col-span-full grid grid-cols-subgrid content-start",className,@@ -196,6 +206,7 @@ function ListGridCell({}: React.HTMLAttributes<HTMLDivElement>) {return (<div+ role="cell"className={cn("flex min-w-0 items-center px-2", className)}{...props}/>diff --git a/packages/ui/components/ui/tabs.tsx b/packages/ui/components/ui/tabs.tsxindex b2856216f0..73fb91867d 100644--- a/packages/ui/components/ui/tabs.tsx+++ b/packages/ui/components/ui/tabs.tsx@@ -58,7 +58,7 @@ function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {<TabsPrimitive.Tabdata-slot="tabs-trigger"className={cn(- "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-[color,background-color,border-color,box-shadow] group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",diff --git a/packages/ui/styles/base.css b/packages/ui/styles/base.cssindex c9b4ec0bc1..ab562383f1 100644--- a/packages/ui/styles/base.css+++ b/packages/ui/styles/base.css@@ -233,6 +233,11 @@}@media (prefers-reduced-motion: reduce) {+ .animate-entrance-spin,+ .animate-onboarding-enter,+ .animate-welcome-emoji-pop,+ .animate-completion-badge,+ .animate-completion-check,.animate-chat-impulse,.animate-chat-text-shimmer,.animate-nav-progress-sweep {diff --git a/packages/views/agents/components/agent-access-settings.tsx b/packages/views/agents/components/agent-access-settings.tsxnew file mode 100644index 0000000000..6d9d7d4e68--- /dev/null+++ b/packages/views/agents/components/agent-access-settings.tsx@@ -0,0 +1,50 @@+"use client";++import type { Agent, MemberWithUser } from "@multica/core/types";+import {+ SettingsCard,+ SettingsSection,+} from "../../settings/components/settings-layout";+import { useT } from "../../i18n";+import { AccessPicker } from "./inspector/access-picker";++export function AgentAccessSettings({+ agent,+ members,+ currentUserId,+ onDirtyChange,+ onUpdate,+}: {+ agent: Agent;+ members: MemberWithUser[];+ currentUserId: string | null;+ onDirtyChange?: (dirty: boolean) => void;+ onUpdate: (id: string, data: Record<string, unknown>) => Promise<void>;+}) {+ const { t } = useT("agents");++ return (+ <SettingsSection+ title={t(($) => $.access.section_title)}+ description={t(($) => $.inspector.section_access_hint)}+ >+ <SettingsCard>+ <AccessPicker+ permissionMode={agent.permission_mode}+ invocationTargets={agent.invocation_targets}+ visibility={agent.visibility}+ members={members}+ ownerId={agent.owner_id}+ canEdit={+ currentUserId !== null && agent.owner_id === currentUserId+ }+ hasComposioAllowlist={+ (agent.composio_toolkit_allowlist ?? []).length > 0+ }+ onDirtyChange={onDirtyChange}+ onChange={(next) => onUpdate(agent.id, next)}+ />+ </SettingsCard>+ </SettingsSection>+ );+}diff --git a/packages/views/agents/components/agent-detail-inspector.tsx b/packages/views/agents/components/agent-detail-inspector.tsxindex f3999af909..584c561113 100644--- a/packages/views/agents/components/agent-detail-inspector.tsx+++ b/packages/views/agents/components/agent-detail-inspector.tsx@@ -1,674 +1,309 @@"use client";-import {- useEffect,- useState,- type ReactNode,-} from "react";-import { Loader2, Pencil } from "lucide-react";+import { useCallback, useEffect, useMemo, useState } from "react";import type {Agent,AgentRuntime,MemberWithUser,} from "@multica/core/types";-import {- AGENT_DESCRIPTION_MAX_LENGTH,- type AgentPresenceDetail,-} from "@multica/core/agents";+import { AGENT_DESCRIPTION_MAX_LENGTH } from "@multica/core/agents";import { isImeComposing } from "@multica/core/utils";-import { useTimeAgo } from "../../i18n";-import { Button } from "@multica/ui/components/ui/button";-import { ActorAvatar } from "../../common/actor-avatar";-import { AvatarUploadControl } from "../../common/avatar-upload-control";import { Input } from "@multica/ui/components/ui/input";+import { Textarea } from "@multica/ui/components/ui/textarea";+import { AvatarUploadControl } from "../../common/avatar-upload-control";import {- Dialog,- DialogContent,- DialogFooter,- DialogHeader,- DialogTitle,-} from "@multica/ui/components/ui/dialog";-import {- Popover,- PopoverContent,- PopoverTrigger,-} from "@multica/ui/components/ui/popover";-import { PropRow } from "../../common/prop-row";-import { availabilityConfig } from "../presence";-import { CharCounter } from "./char-counter";+ SettingsCard,+ SettingsRow,+ SettingsSaveState,+ SettingsSection,+} from "../../settings/components/settings-layout";+import { useAutoSave } from "../../settings/components/use-auto-save";import { useT } from "../../i18n";-import { ConcurrencyPicker } from "./inspector/concurrency-picker";+import { CharCounter } from "./char-counter";import { ModelPicker } from "./inspector/model-picker";import { RuntimePicker } from "./inspector/runtime-picker";-import { SkillAttach } from "./inspector/skill-attach";-import { ThinkingPropRow } from "./inspector/thinking-prop-row";-import { AccessPicker } from "./inspector/access-picker";-import { LarkAgentBindButton } from "../../settings/components/lark-tab";-import { SlackAgentBindButton } from "../../settings/components/slack-tab";+import { ThinkingSettingField } from "./inspector/thinking-prop-row";interface InspectorProps {agent: Agent;runtime: AgentRuntime | null;- owner: MemberWithUser | null;- presence: AgentPresenceDetail | null | undefined;- // Below: needed for inline edit. The inspector now owns the editing surface- // (no Settings tab anymore), so the parent has to pass through everything- // a write needs.runtimes: AgentRuntime[];members: MemberWithUser[];currentUserId: string | null;- /**- * Computed by the parent via `useAgentPermissions(agent).canEdit.allowed`.- * When false the inspector renders all editable surfaces as static- * read-only displays — pickers become text/badges, name/description lose- * their pencil affordance, the avatar is no longer clickable, and the- * "Attach skill" trigger is hidden. Mirrors the backend gate at- * `server/internal/handler/agent.go:519-535`.- */canEdit: boolean;onUpdate: (id: string, data: Record<string, unknown>) => Promise<void>;- /**- * Focus the overview pane's Integrations tab. The inspector's Lark status- * row is read-only and deep-links here; Manage / Disconnect live in the- * tab so the destructive action exists in exactly one place.- */- onShowIntegrations: () => void;+}++interface ProfileDraft {+ name: string;+ description: string;+}++function profileDraftsEqual(left: ProfileDraft, right: ProfileDraft) {+ return left.name === right.name && left.description === right.description;}/**- * Left 320px column of the agent detail page. Holds the agent's identity card- * (avatar / name / description / status), inline-editable properties, and- * skills.- *- * **All editing happens here** — there is no separate Settings tab. The- * trade-off is that the inspector carries some weight (4 inline pickers plus- * 3 popovers for name/description/avatar), but it eliminates the "see vs- * edit" mode split that the previous Settings tab created. Users no longer- * have to switch tabs and hunt for the field they were already looking at.+ * Full-width General settings form. Every editable value is presented as an+ * explicit field; compact inspector chips are used only through their+ * settings-field variants, where the whole control is a visible click target.*/export function AgentDetailInspector({agent,runtime,- owner,- presence,runtimes,members,currentUserId,canEdit,onUpdate,- onShowIntegrations,}: InspectorProps) {const { t } = useT("agents");- const timeAgo = useTimeAgo();- const update = (data: Record<string, unknown>) => onUpdate(agent.id, data);- const isOnline = runtime?.status === "online";-- return (- <aside className="flex w-full flex-col rounded-lg border bg-background md:h-full md:min-h-0 md:overflow-y-auto">- {/* Identity */}- <div className="flex flex-col gap-3 border-b px-5 pb-5 pt-5">- <AvatarEditor agent={agent} canEdit={canEdit} onUpdate={update} />- <NameAndDescription- agent={agent}- canEdit={canEdit}- onUpdate={update}- />- <PresenceBadge presence={presence} />- </div>-- {/* Properties — editable when canEdit. When the current user lacks- permission, each picker self-renders a static read-only display so- the value is visible but not interactive. */}- <Section label={t(($) => $.inspector.section_properties)}>- <PropRow label={t(($) => $.inspector.prop_runtime)} interactive={false}>- <RuntimePicker- value={agent.runtime_id}- runtimes={runtimes}- members={members}- currentUserId={currentUserId}- canEdit={canEdit}- onChange={(id) => update({ runtime_id: id })}- />- </PropRow>- <PropRow label={t(($) => $.inspector.prop_model)} interactive={false}>- <ModelPicker- runtimeId={agent.runtime_id}- runtimeOnline={!!isOnline}- value={agent.model ?? ""}- canEdit={canEdit}- onChange={(m) => update({ model: m })}- />- </PropRow>- <ThinkingPropRow- runtimeId={agent.runtime_id}- runtimeOnline={!!isOnline}- provider={runtime?.provider ?? ""}- model={agent.model ?? ""}- value={agent.thinking_level ?? ""}- canEdit={canEdit}- onChange={(v) => update({ thinking_level: v })}- />- <PropRow label={t(($) => $.inspector.prop_visibility)} interactive={false}>- <AccessPicker- permissionMode={agent.permission_mode}- invocationTargets={agent.invocation_targets}- visibility={agent.visibility}- members={members}- // Access is OWNER-ONLY (MUL-3963): a workspace admin can edit other- // agent properties (canEdit) but NOT who may run the agent. Gate the- // picker on ownership specifically so non-owners get the read-only- // state instead of a control the backend would reject with 403.- canEdit={- currentUserId !== null && agent.owner_id === currentUserId- }- hasComposioAllowlist={- (agent.composio_toolkit_allowlist ?? []).length > 0- }- onChange={(next) => update(next)}- />- </PropRow>- <PropRow label={t(($) => $.inspector.prop_concurrency)} interactive={false}>- <ConcurrencyPicker- value={agent.max_concurrent_tasks}- canEdit={canEdit}- onChange={(n) => update({ max_concurrent_tasks: n })}- />- </PropRow>- </Section>+ const { t: ts } = useT("settings");+ const update = useCallback(+ (data: Record<string, unknown>) => onUpdate(agent.id, data),+ [agent.id, onUpdate],+ );- {/* Details — read-only (no hover, no chip styling — these aren't clickable) */}- <Section label={t(($) => $.inspector.section_details)}>- {owner && (- <PropRow label={t(($) => $.inspector.prop_owner)} interactive={false}>- <span className="flex min-w-0 items-center gap-1.5">- <ActorAvatar- actorType="member"- actorId={owner.user_id}- size="xs"- />- <span className="truncate">{owner.name}</span>- </span>- </PropRow>- )}- <PropRow label={t(($) => $.inspector.prop_created)} interactive={false}>- <span className="text-muted-foreground">- {timeAgo(agent.created_at)}- </span>- </PropRow>- <PropRow label={t(($) => $.inspector.prop_updated)} interactive={false}>- <span className="text-muted-foreground">- {timeAgo(agent.updated_at)}- </span>- </PropRow>- </Section>+ const [name, setName] = useState(agent.name);+ const [description, setDescription] = useState(agent.description ?? "");- {/* Skills */}- <div className="flex flex-col border-b px-5 py-4">- <div className="mb-2 flex items-center gap-2">- <span className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground">- {t(($) => $.inspector.section_skills)}- </span>- <span className="font-mono text-[10px] tabular-nums text-muted-foreground/70">- {agent.skills.length}- </span>- </div>- <div className="flex flex-wrap gap-1">- {agent.skills.map((s) => (- <span- key={s.id}- className="rounded-md bg-muted px-1.5 py-0.5 font-mono text-[10px] font-medium text-muted-foreground"- >- {s.name}- </span>- ))}- <SkillAttach agent={agent} canEdit={canEdit} />- </div>- </div>+ useEffect(() => {+ setName(agent.name);+ setDescription(agent.description ?? "");+ // Reset only when moving to another agent. Cache updates from this form+ // must not erase a newer local draft while an autosave is in flight.+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [agent.id]);- {/* Integrations — surfaces external-channel bind entry points- (Lark + Slack today; Discord in the future). Each bind button- self-hides when its server-side install capability gate is- closed, so this section may render empty on deployments without- a configured channel — that's intentional and matches the- "don't surface a flow that will fail" guarantee. We only mount- it for editors: viewers shouldn't see a CTA they can't action. */}- {canEdit && (- <div className="flex flex-col px-5 py-4">- <div className="mb-2 flex items-center gap-2">- <span className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground">- {t(($) => $.inspector.section_integrations)}- </span>- </div>- <div className="flex flex-wrap gap-2">- <LarkAgentBindButton- agentId={agent.id}- agentName={agent.name}- agentOwnerId={agent.owner_id}- onShowConnectedDetails={onShowIntegrations}- />- <SlackAgentBindButton- agentId={agent.id}- agentName={agent.name}- onShowConnectedDetails={onShowIntegrations}- />- </div>- </div>- )}- </aside>+ const profileDraft = useMemo(+ () => ({ name: name.trim(), description }),+ [description, name],);-}--// ----------------------------------------------------------------------------// Layout helpers-// -----------------------------------------------------------------------------function Section({- label,- children,-}: {- label: string;- children: ReactNode;-}) {- return (- <div className="border-b px-5 py-4">- <div className="mb-1 -mx-2 px-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground">- {label}- </div>- <div className="grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5">- {children}- </div>- </div>+ const savedProfile = useMemo(+ () => ({+ name: agent.name,+ description: agent.description ?? "",+ }),+ [agent.description, agent.name],);-}--// ----------------------------------------------------------------------------// Identity — avatar / name / description editors-// -----------------------------------------------------------------------------function AvatarEditor({- agent,- canEdit,- onUpdate,-}: {- agent: Agent;- canEdit: boolean;- onUpdate: (data: Record<string, unknown>) => Promise<void>;-}) {- if (!canEdit) {- return (- <div className="h-14 w-14 shrink-0 overflow-hidden rounded-full">- <ActorAvatar actorType="agent" actorId={agent.id} size="2xl" />- </div>- );- }-- return (- <AvatarUploadControl- variant="agent"- value={agent.avatar_url ?? null}- name={agent.name}- size={56}- onUploaded={(url) => onUpdate({ avatar_url: url })}- />+ const saveProfile = useCallback(+ async (next: ProfileDraft) => {+ await update({ name: next.name, description: next.description });+ },+ [update],);-}+ const profileAutoSave = useAutoSave({+ value: profileDraft,+ savedValue: savedProfile,+ onSave: saveProfile,+ enabled:+ canEdit &&+ profileDraft.name.length > 0 &&+ profileDraft.description.length <= AGENT_DESCRIPTION_MAX_LENGTH,+ isEqual: profileDraftsEqual,+ });-function NameAndDescription({- agent,- canEdit,- onUpdate,-}: {- agent: Agent;- canEdit: boolean;- onUpdate: (data: Record<string, unknown>) => Promise<void>;-}) {- const { t } = useT("agents");- if (!canEdit) {- return (- <div className="flex flex-col gap-1">- <span className="text-base font-semibold leading-tight">- {agent.name}- </span>- {agent.description ? (- <span className="text-xs leading-relaxed text-muted-foreground">- {agent.description}- </span>- ) : (- <span className="text-xs italic leading-relaxed text-muted-foreground/50">- {t(($) => $.inspector.no_description_placeholder)}- </span>- )}- </div>- );- }+ const isOnline = runtime?.status === "online";+ const nameInvalid = name.trim().length === 0;return (- <div className="flex flex-col gap-1">- <InlineEditPopover- value={agent.name}- onSave={(v) => onUpdate({ name: v.trim() })}- kind="input"- title={t(($) => $.inspector.rename_title)}- placeholder={t(($) => $.inspector.rename_placeholder)}- validate={(v) => (v.trim().length > 0 ? null : t(($) => $.inspector.rename_required))}+ <div className="space-y-8">+ <SettingsSection+ title={t(($) => $.inspector.section_profile)}+ description={t(($) => $.inspector.section_profile_hint)}+ action={+ <SettingsSaveState+ status={profileAutoSave.status}+ savingLabel={ts(($) => $.auto_save.saving)}+ savedLabel={ts(($) => $.auto_save.saved)}+ errorLabel={ts(($) => $.auto_save.failed)}+ />+ }>- {(triggerProps) => (- <button- type="button"- {...triggerProps}- className="group -mx-1 inline-flex items-center gap-1.5 self-start rounded px-1 text-left text-base font-semibold leading-tight transition-colors hover:bg-accent/50"+ <SettingsCard>+ <SettingsRow+ label={t(($) => $.inspector.avatar_label)}+ description={t(($) => $.inspector.avatar_hint)}+ controlClassName="sm:max-w-none">- <span>{agent.name}</span>- <Pencil className="h-3 w-3 shrink-0 text-muted-foreground/0 transition-colors group-hover:text-muted-foreground" />- </button>- )}- </InlineEditPopover>+ <div className="flex justify-start sm:justify-end">+ <AvatarUploadControl+ variant="agent"+ value={agent.avatar_url ?? null}+ name={agent.name}+ size={56}+ disabled={!canEdit}+ onUploaded={(url) => update({ avatar_url: url })}+ />+ </div>+ </SettingsRow>- <DescriptionEditor- value={agent.description ?? ""}- onSave={(v) => onUpdate({ description: v })}- />- </div>- );-}+ <SettingsRow+ label={t(($) => $.inspector.name_label)}+ controlClassName="sm:w-80"+ >+ <div>+ <Input+ type="text"+ name="agent-name"+ autoComplete="off"+ aria-label={t(($) => $.inspector.name_label)}+ value={name}+ onChange={(event) => setName(event.target.value)}+ onBlur={profileAutoSave.flush}+ disabled={!canEdit}+ aria-invalid={nameInvalid || undefined}+ />+ {nameInvalid ? (+ <p className="mt-1 text-xs text-destructive">+ {t(($) => $.inspector.rename_required)}+ </p>+ ) : null}+ </div>+ </SettingsRow>-// Description editor — modal because the description benefits from a roomy-// composition surface (the inline popover was 288 px wide × 3 rows, too-// cramped to read or edit anything substantial). Name stays in the inline-// popover above: a single line is the right shape for it.-//-// The editor body is split into a child component that mounts only while-// the dialog is open. That way the draft state is initialised from `value`-// at mount time and never reset by an external update mid-edit — closing-// the dialog unmounts the body, reopening starts fresh with the latest-// value. This is the React-recommended replacement for the-// `useEffect(reset, [value])` anti-pattern (see "You Might Not Need an-// Effect" — Resetting state with a key / mount).-function DescriptionEditor({- value,- onSave,-}: {- value: string;- onSave: (next: string) => Promise<void>;-}) {- const { t } = useT("agents");- const [open, setOpen] = useState(false);+ <SettingsRow+ label={t(($) => $.inspector.description_label)}+ controlClassName="sm:w-96"+ align="start"+ >+ <div>+ <Textarea+ name="agent-description"+ autoComplete="off"+ aria-label={t(($) => $.inspector.description_label)}+ value={description}+ onChange={(event) => setDescription(event.target.value)}+ onBlur={profileAutoSave.flush}+ disabled={!canEdit}+ rows={5}+ maxLength={AGENT_DESCRIPTION_MAX_LENGTH}+ className="resize-y"+ placeholder={t(($) => $.inspector.description_placeholder)}+ />+ <CharCounter+ length={[...description].length}+ max={AGENT_DESCRIPTION_MAX_LENGTH}+ />+ </div>+ </SettingsRow>+ </SettingsCard>+ </SettingsSection>- return (- <>- <button- type="button"- onClick={() => setOpen(true)}- className="group -mx-1 inline-flex items-start gap-1.5 self-start rounded px-1 text-left text-xs leading-relaxed transition-colors hover:bg-accent/50"+ <SettingsSection+ title={t(($) => $.inspector.section_execution)}+ description={t(($) => $.inspector.section_execution_hint)}>- {value ? (- <span className="text-muted-foreground">{value}</span>- ) : (- <span className="italic text-muted-foreground/50">{t(($) => $.inspector.no_description_placeholder)}</span>- )}- <Pencil className="mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/0 transition-colors group-hover:text-muted-foreground" />- </button>-- <Dialog open={open} onOpenChange={setOpen}>- <DialogContent className="sm:max-w-lg">- {open && (- <DescriptionEditorBody- initialValue={value}- onSave={onSave}- onClose={() => setOpen(false)}+ <SettingsCard>+ <SettingsRow+ label={t(($) => $.inspector.prop_runtime)}+ controlClassName="sm:w-80"+ >+ <RuntimePicker+ variant="field"+ showLabel={false}+ value={agent.runtime_id}+ runtimes={runtimes}+ members={members}+ currentUserId={currentUserId}+ canEdit={canEdit}+ onChange={(id) => update({ runtime_id: id })}/>- )}- </DialogContent>- </Dialog>- </>- );-}--function DescriptionEditorBody({- initialValue,- onSave,- onClose,-}: {- initialValue: string;- onSave: (next: string) => Promise<void>;- onClose: () => void;-}) {- const { t } = useT("agents");- const [draft, setDraft] = useState(initialValue);- const [saving, setSaving] = useState(false);-- const length = [...draft].length;- const overLimit = length > AGENT_DESCRIPTION_MAX_LENGTH;- const dirty = draft !== initialValue;-- const commit = async () => {- if (overLimit || !dirty) return;- setSaving(true);- try {- await onSave(draft);- onClose();- } catch {- // toast handled by parent's onUpdate- } finally {- setSaving(false);- }- };-- return (- <>- <DialogHeader>- <DialogTitle>{t(($) => $.inspector.edit_description_title)}</DialogTitle>- </DialogHeader>- <div className="flex flex-col gap-2">- <textarea- autoFocus- value={draft}- onChange={(e) => setDraft(e.target.value)}- placeholder={t(($) => $.inspector.description_placeholder)}- rows={6}- onKeyDown={(e) => {- if (e.key === "Escape") {- onClose();- return;- }- if (isImeComposing(e)) return;- if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {- e.preventDefault();- void commit();+ </SettingsRow>+ <SettingsRow+ label={t(($) => $.inspector.prop_model)}+ controlClassName="sm:w-80"+ >+ <ModelPicker+ variant="field"+ showLabel={false}+ runtimeId={agent.runtime_id}+ runtimeOnline={!!isOnline}+ value={agent.model ?? ""}+ canEdit={canEdit}+ onChange={(model) => update({ model })}+ />+ </SettingsRow>+ <ThinkingSettingField+ label={t(($) => $.inspector.prop_thinking)}+ runtimeId={agent.runtime_id}+ runtimeOnline={!!isOnline}+ provider={runtime?.provider ?? ""}+ model={agent.model ?? ""}+ value={agent.thinking_level ?? ""}+ canEdit={canEdit}+ onChange={(thinkingLevel) =>+ update({ thinking_level: thinkingLevel })}- }}- className="w-full resize-none rounded-md border bg-transparent px-3 py-2 text-sm outline-none focus-visible:border-input"- />- <CharCounter length={length} max={AGENT_DESCRIPTION_MAX_LENGTH} />- </div>- <DialogFooter>- <Button- variant="ghost"- size="sm"- onClick={onClose}- disabled={saving}- >- {t(($) => $.inspector.cancel)}- </Button>- <Button- size="sm"- onClick={() => void commit()}- disabled={saving || overLimit || !dirty}- >- {saving ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : t(($) => $.inspector.save)}- </Button>- </DialogFooter>- </>+ />+ <SettingsRow+ label={t(($) => $.inspector.prop_concurrency)}+ controlClassName="sm:w-80"+ >+ <ConcurrencyField+ value={agent.max_concurrent_tasks}+ canEdit={canEdit}+ onSave={(next) => update({ max_concurrent_tasks: next })}+ />+ </SettingsRow>+ </SettingsCard>+ </SettingsSection>+ </div>);}--// Generic single-field popover editor used for name / description. Keeps the-// trigger styling fully in the caller's hands by using a render prop.-function InlineEditPopover({+function ConcurrencyField({value,+ canEdit,onSave,- kind,- title,- placeholder,- validate,- children,}: {- value: string;- onSave: (next: string) => Promise<void>;- kind: "input" | "textarea";- title: string;- placeholder?: string;- validate?: (v: string) => string | null;- children: (triggerProps: {- onClick: (e: React.MouseEvent) => void;- }) => ReactNode;+ value: number;+ canEdit: boolean;+ onSave: (next: number) => Promise<void>;}) {const { t } = useT("agents");- const [open, setOpen] = useState(false);- const [draft, setDraft] = useState(value);- const [saving, setSaving] = useState(false);- const [error, setError] = useState<string | null>(null);+ const [draft, setDraft] = useState(String(value));+ const min = 1;+ const max = 50;- // Reset draft when popover opens or upstream value changes between sessions.- useEffect(() => {- if (open) {- setDraft(value);- setError(null);- }- }, [open, value]);+ useEffect(() => setDraft(String(value)), [value]);- const commit = async () => {- const err = validate?.(draft) ?? null;- if (err) {- setError(err);- return;- }- if (draft === value) {- setOpen(false);+ const commit = () => {+ const next = Number(draft);+ if (!Number.isInteger(next) || next < min || next > max) {+ setDraft(String(value));return;}- setSaving(true);- try {- await onSave(draft);- setOpen(false);- } catch {- // toast handled by parent's onUpdate- } finally {- setSaving(false);- }+ if (next !== value) void onSave(next);};return (- <Popover open={open} onOpenChange={setOpen}>- <PopoverTrigger- render={children({ onClick: () => setOpen(true) }) as React.ReactElement}+ <div>+ <Input+ id="agent-concurrency"+ type="number"+ name="agent-concurrency"+ autoComplete="off"+ inputMode="numeric"+ min={min}+ max={max}+ value={draft}+ onChange={(event) => setDraft(event.target.value)}+ onBlur={commit}+ onKeyDown={(event) => {+ if (isImeComposing(event)) return;+ if (event.key === "Enter") {+ event.preventDefault();+ commit();+ }+ }}+ disabled={!canEdit}+ aria-label={t(($) => $.inspector.prop_concurrency)}+ className="font-mono tabular-nums"/>- <PopoverContent align="start" className="w-72 p-3">- <div className="space-y-2">- <p className="text-xs font-medium">{title}</p>- {kind === "input" ? (- <Input- autoFocus- value={draft}- onChange={(e) => {- setDraft(e.target.value);- if (error) setError(null);- }}- placeholder={placeholder}- onKeyDown={(e) => {- if (e.key === "Escape") {- setOpen(false);- return;- }- if (isImeComposing(e)) return;- if (e.key === "Enter") {- e.preventDefault();- void commit();- }- }}- className="h-8"- />- ) : (- <textarea- autoFocus- value={draft}- onChange={(e) => {- setDraft(e.target.value);- if (error) setError(null);- }}- placeholder={placeholder}- onKeyDown={(e) => {- if (e.key === "Escape") {- setOpen(false);- return;- }- if (isImeComposing(e)) return;- if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {- e.preventDefault();- void commit();- }- }}- rows={3}- className="w-full resize-none rounded-md border bg-transparent px-2 py-1.5 text-xs outline-none focus-visible:border-input"- />- )}- {error && <p className="text-xs text-destructive">{error}</p>}- <div className="flex items-center justify-end gap-2">- <Button- variant="ghost"- size="sm"- onClick={() => setOpen(false)}- disabled={saving}- >- {t(($) => $.inspector.cancel)}- </Button>- <Button- size="sm"- onClick={() => void commit()}- disabled={saving || draft === value}- >- {saving ? (- <Loader2 className="h-3.5 w-3.5 animate-spin" />- ) : (- t(($) => $.inspector.save)- )}- </Button>- </div>- </div>- </PopoverContent>- </Popover>- );-}--// ----------------------------------------------------------------------------// Presence badge — unchanged from the previous version-// -----------------------------------------------------------------------------function PresenceBadge({- presence,-}: {- presence: AgentPresenceDetail | null | undefined;-}) {- const { t } = useT("agents");- // Archived is carried by the unified presence (deriveAgentPresenceDetail- // sets availability="archived" before any runtime/task scan), so the- // normal path below renders the gray "Archived" badge with no special- // case here — same single source of truth as every other status surface.- if (!presence) {- return (- <span className="inline-flex h-5 w-20 animate-pulse rounded-md bg-muted" />- );- }- const av = availabilityConfig[presence.availability];- return (- <div className="flex flex-wrap items-center gap-1.5">- <span- className={`inline-flex items-center gap-1.5 rounded-md border px-1.5 py-0.5 text-xs ${av.textClass}`}- >- <span className={`h-1.5 w-1.5 rounded-full ${av.dotClass}`} />- {t(($) => $.availability[presence.availability])}- </span>+ <p className="mt-1 text-xs text-muted-foreground">+ {t(($) => $.pickers.concurrency_range, { min, max })}+ </p></div>);}diff --git a/packages/views/agents/components/agent-detail-page.tsx b/packages/views/agents/components/agent-detail-page.tsxindex 47161d325d..cbae661f50 100644--- a/packages/views/agents/components/agent-detail-page.tsx+++ b/packages/views/agents/components/agent-detail-page.tsx@@ -4,13 +4,21 @@ import { useState } from "react";import {AlertCircle,ArrowLeft,+ Bot,+ Clock3,Lock,MoreHorizontal,+ Plus,+ Server,Trash2,} from "lucide-react";import { toast } from "sonner";import { useQuery, useQueryClient } from "@tanstack/react-query";-import type { Agent, UpdateAgentRequest } from "@multica/core/types";+import type {+ Agent,+ AgentRuntime,+ UpdateAgentRequest,+} from "@multica/core/types";import {type AgentPresenceDetail,useWorkspacePresenceMap,@@ -18,6 +26,7 @@ import {import { api, ApiError } from "@multica/core/api";import { useAuthStore } from "@multica/core/auth";import { useWorkspaceId } from "@multica/core/hooks";+import { useModalStore } from "@multica/core/modals";import { useWorkspacePaths } from "@multica/core/paths";import {agentListOptions,@@ -44,12 +53,12 @@ import {} from "@multica/ui/components/ui/dropdown-menu";import { Skeleton } from "@multica/ui/components/ui/skeleton";import { AppLink, useNavigation } from "../../navigation";-import { BreadcrumbHeader } from "../../layout/breadcrumb-header";import { PageHeader } from "../../layout/page-header";-import { availabilityConfig } from "../presence";-import { AgentDetailInspector } from "./agent-detail-inspector";+import { ActorAvatar } from "../../common/actor-avatar";+import { AgentPresenceIndicator } from "./agent-presence-indicator";+import { VisibilityBadge } from "./visibility-badge";import { AgentOverviewPane, type DetailTab } from "./agent-overview-pane";-import { useT } from "../../i18n";+import { useT, useTimeAgo } from "../../i18n";interface AgentDetailPageProps {agentId: string;@@ -97,7 +106,7 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {// signature handles the not-found / loading case internally so the early// returns below don't violate the rules of hooks. Backend gates archive// and restore identically to edit, so a single `canEdit` covers them all.- const { canEdit } = useAgentPermissions(agent, wsId);+ const { canAssign, canEdit } = useAgentPermissions(agent, wsId);const [confirmArchive, setConfirmArchive] = useState(false);@@ -248,9 +257,16 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {<div className="flex flex-1 min-h-0 flex-col"><DetailHeaderagent={agent}+ runtime={runtime}presence={presence}backHref={paths.agents()}+ canAssign={canAssign.allowed}canArchive={canEdit.allowed}+ onAssign={() =>+ useModalStore+ .getState()+ .open("quick-create-issue", { agent_id: agent.id })+ }onArchive={() => setConfirmArchive(true)}/>@@ -283,25 +299,16 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {</div>)}- <div className="flex flex-1 min-h-0 flex-col gap-3 overflow-y-auto p-3 md:grid md:grid-cols-[320px_minmax(0,1fr)] md:gap-4 md:overflow-hidden md:p-6">- <AgentDetailInspector+ <div className="flex flex-1 min-h-0 flex-col overflow-hidden">+ <AgentOverviewPaneagent={agent}runtime={runtime}owner={owner}- presence={presence}runtimes={runtimes}members={members}- currentUserId={currentUser?.id ?? null}- canEdit={canEdit.allowed}- onUpdate={handleUpdate}- onShowIntegrations={() => setTabNavIntent("integrations")}- />-- <AgentOverviewPane- agent={agent}- runtimes={runtimes}onUpdate={handleUpdate}currentUserId={currentUser?.id ?? null}+ canEdit={canEdit.allowed}navIntent={tabNavIntent}onNavIntentHandled={() => setTabNavIntent(null)}/>@@ -355,64 +362,113 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {function DetailHeader({agent,+ runtime,presence,backHref,+ canAssign,canArchive,+ onAssign,onArchive,}: {agent: Agent;+ runtime: AgentRuntime | null;presence: AgentPresenceDetail | null;backHref: string;+ canAssign: boolean;canArchive: boolean;+ onAssign: () => void;onArchive: () => void;}) {const { t } = useT("agents");+ const timeAgo = useTimeAgo();const isArchived = !!agent.archived_at;- const av = presence- ? { ...availabilityConfig[presence.availability], label: t(($) => $.availability[presence.availability]) }- : null;- // Last-task state is intentionally not surfaced in the header — the- // Recent work section on this page already shows the same information- // (and richer: titles, timestamps, error messages). Showing "Completed"- // up here was redundant chrome.return (- <BreadcrumbHeader- segments={[{ href: backHref, label: t(($) => $.page.title) }]}- leaf={- <>- <h1 className="min-w-0 truncate text-sm font-medium text-foreground">{agent.name}</h1>- {av && presence && (- <span- className={`inline-flex shrink-0 items-center gap-1.5 rounded-md border px-1.5 py-0.5 text-xs ${av.textClass}`}- >- <span className={`h-1.5 w-1.5 rounded-full ${av.dotClass}`} />- {av.label}- </span>- )}- </>- }- actions={- !isArchived && canArchive ? (+ <header className="shrink-0 border-b bg-background px-4 pb-5 pt-3 sm:px-6">+ <div className="mx-auto max-w-[1440px]">+ <div className="flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground">+ <AppLink+ href={backHref}+ className="rounded-sm transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ >+ {t(($) => $.page.title)}+ </AppLink>+ <span aria-hidden="true">/</span>+ <span className="truncate text-foreground">{agent.name}</span>+ </div>++ <div className="mt-4 flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">+ <div className="flex min-w-0 items-start gap-4">+ <ActorAvatar+ actorType="agent"+ actorId={agent.id}+ size="2xl"+ profileLink={false}+ className="ring-1 ring-border"+ />+ <div className="min-w-0 pt-0.5">+ <div className="flex flex-wrap items-center gap-x-3 gap-y-1.5">+ <h1 className="min-w-0 text-balance text-xl font-semibold tracking-tight sm:text-2xl">+ {agent.name}+ </h1>+ <AgentPresenceIndicator detail={presence} />+ </div>+ <p className="mt-1 max-w-2xl text-pretty text-sm leading-6 text-muted-foreground">+ {agent.description || t(($) => $.inspector.no_description_placeholder)}+ </p>+ <div className="mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-muted-foreground">+ <span className="inline-flex min-w-0 items-center gap-1.5">+ <Bot className="h-3.5 w-3.5 shrink-0" aria-hidden="true" />+ <span className="truncate">{agent.model || t(($) => $.pickers.model_default)}</span>+ </span>+ <span className="inline-flex min-w-0 items-center gap-1.5">+ <Server className="h-3.5 w-3.5 shrink-0" aria-hidden="true" />+ <span className="truncate">+ {runtime?.name ?? t(($) => $.pickers.runtime_none)}+ </span>+ </span>+ <VisibilityBadge value={agent.visibility} />+ <span className="inline-flex items-center gap-1.5">+ <Clock3 className="h-3.5 w-3.5" aria-hidden="true" />+ {t(($) => $.detail.updated, { when: timeAgo(agent.updated_at) })}+ </span>+ </div>+ </div>+ </div>++ <div className="flex shrink-0 items-center gap-2 self-end lg:self-start">+ {!isArchived && canAssign && (+ <Button type="button" size="sm" onClick={onAssign}>+ <Plus className="h-4 w-4" aria-hidden="true" />+ {t(($) => $.detail.assign_work)}+ </Button>+ )}+ {!isArchived && canArchive ? (<DropdownMenu><DropdownMenuTriggerrender={<Button variant="ghost" size="icon-sm" />}+ aria-label={t(($) => $.detail.more_actions_aria)}>- <MoreHorizontal className="h-4 w-4 text-muted-foreground" />+ <MoreHorizontal+ className="h-4 w-4 text-muted-foreground"+ aria-hidden="true"+ /></DropdownMenuTrigger><DropdownMenuContent align="end" className="w-auto"><DropdownMenuItemvariant="destructive"onClick={onArchive}>- <Trash2 className="h-3.5 w-3.5" />+ <Trash2 className="h-3.5 w-3.5" aria-hidden="true" />{t(($) => $.detail.more_archive)}</DropdownMenuItem></DropdownMenuContent></DropdownMenu>- ) : null- }- />+ ) : null}+ </div>+ </div>+ </div>+ </header>);}@@ -435,25 +491,25 @@ function BackHeader({ paths, title }: { paths: string; title: string }) {function DetailLoadingSkeleton() {return (<div className="flex flex-1 min-h-0 flex-col">- <PageHeader className="px-5">- <Skeleton className="h-5 w-48" />- </PageHeader>- <div className="flex flex-1 min-h-0 flex-col gap-3 overflow-y-auto p-3 md:grid md:grid-cols-[320px_minmax(0,1fr)] md:gap-4 md:overflow-hidden md:p-6">- <div className="flex flex-col gap-4 rounded-lg border p-5">+ <div className="shrink-0 border-b px-6 pb-5 pt-3">+ <Skeleton className="h-4 w-48" />+ <div className="mt-4 flex items-start gap-4"><Skeleton className="h-14 w-14 rounded-full" />- <Skeleton className="h-5 w-40" />- <Skeleton className="h-3 w-full" />- <div className="space-y-2">- <Skeleton className="h-3 w-3/4" />- <Skeleton className="h-3 w-2/3" />- <Skeleton className="h-3 w-1/2" />+ <div className="flex-1 space-y-3">+ <Skeleton className="h-7 w-64" />+ <Skeleton className="h-4 w-full max-w-xl" />+ <Skeleton className="h-4 w-full max-w-lg" /></div></div>- <div className="flex flex-col gap-4 rounded-lg border p-6">- <Skeleton className="h-6 w-64" />- <Skeleton className="h-4 w-full" />- <Skeleton className="h-4 w-5/6" />- <Skeleton className="h-4 w-4/6" />+ </div>+ <div className="flex flex-1 flex-col p-6">+ <Skeleton className="h-9 w-96" />+ <div className="mt-6 grid flex-1 gap-6 xl:grid-cols-[minmax(0,1fr)_320px]">+ <div className="space-y-5">+ <Skeleton className="h-48 w-full" />+ <Skeleton className="h-64 w-full" />+ </div>+ <Skeleton className="h-96 w-full" /></div></div></div>diff --git a/packages/views/agents/components/agent-list-toolbar.tsx b/packages/views/agents/components/agent-list-toolbar.tsxindex f1cb1e4a99..d156c93498 100644--- a/packages/views/agents/components/agent-list-toolbar.tsx+++ b/packages/views/agents/components/agent-list-toolbar.tsx@@ -201,6 +201,7 @@ export function AgentListToolbar({<Inputvalue={search}onChange={(e) => onSearchChange(e.target.value)}+ aria-label={t(($) => $.page.search_placeholder)}placeholder={t(($) => $.page.search_placeholder)}className="h-8 w-56 pl-8 text-sm"/>diff --git a/packages/views/agents/components/agent-overview-pane.test.tsx b/packages/views/agents/components/agent-overview-pane.test.tsxindex 0a53497338..d3cf69574e 100644--- a/packages/views/agents/components/agent-overview-pane.test.tsx+++ b/packages/views/agents/components/agent-overview-pane.test.tsx@@ -1,12 +1,16 @@// @vitest-environment jsdomimport { describe, it, expect, vi, beforeEach } from "vitest";-import { render, screen } from "@testing-library/react";+import { fireEvent, render, screen } from "@testing-library/react";import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import type { Agent, AgentRuntime } from "@multica/core/types";import { I18nProvider } from "@multica/core/i18n/react";import enCommon from "../../locales/en/common.json";import enAgents from "../../locales/en/agents.json";+import {+ NavigationProvider,+ type NavigationAdapter,+} from "../../navigation";const TEST_RESOURCES = { en: { common: enCommon, agents: enAgents } };@@ -15,6 +19,13 @@ const TEST_RESOURCES = { en: { common: enCommon, agents: enAgents } };// not what each tab does, so we stub the heavy children.vi.mock("./tabs/activity-tab", () => ({ActivityTab: () => <div>activity-tab</div>,+ AgentPerformanceSummary: () => <div>performance-summary</div>,+}));+vi.mock("./agent-overview-summary", () => ({+ AgentOverviewSummary: () => <div>agent-overview-summary</div>,+}));+vi.mock("./agent-access-settings", () => ({+ AgentAccessSettings: () => <div>agent-access-settings</div>,}));vi.mock("./tabs/instructions-tab", () => ({InstructionsTab: () => <div>instructions-tab</div>,@@ -115,19 +126,41 @@ function renderPane(runtimes: AgentRuntime[]) {const queryClient = new QueryClient({defaultOptions: { queries: { retry: false } },});+ const navigation: NavigationAdapter = {+ push: vi.fn(),+ replace: vi.fn(),+ back: vi.fn(),+ pathname: "/acme/agents/agent-1",+ searchParams: new URLSearchParams(),+ getShareableUrl: (path) => path,+ };return render(<I18nProvider locale="en" resources={TEST_RESOURCES}>- <QueryClientProvider client={queryClient}>- <AgentOverviewPane- agent={baseAgent}- runtimes={runtimes}- onUpdate={vi.fn().mockResolvedValue(undefined)}- />- </QueryClientProvider>+ <NavigationProvider value={navigation}>+ <QueryClientProvider client={queryClient}>+ <AgentOverviewPane+ agent={baseAgent}+ runtime={runtimes[0] ?? null}+ owner={null}+ runtimes={runtimes}+ members={[]}+ onUpdate={vi.fn().mockResolvedValue(undefined)}+ canEdit+ />+ </QueryClientProvider>+ </NavigationProvider></I18nProvider>,);}+function openCapabilities() {+ fireEvent.click(screen.getByRole("tab", { name: /^Capabilities$/i }));+}++function openSettings() {+ fireEvent.click(screen.getByRole("tab", { name: /^Settings$/i }));+}+beforeEach(() => {larkListingRef.current = { installations: [], configured: false };slackListingRef.current = { installations: [], configured: false };@@ -145,15 +178,17 @@ describe("AgentOverviewPane MCP tab visibility", () => {["OpenClaw", "openclaw"],])("renders the MCP tab when the agent runs on the %s runtime", (_label, provider) => {renderPane([makeRuntime(provider)]);- expect(screen.getByRole("button", { name: /^MCP$/i })).toBeInTheDocument();+ openCapabilities();+ expect(screen.getByRole("tab", { name: /^MCP$/i })).toBeInTheDocument();});it("hides the MCP tab for providers whose backend does not read mcp_config", () => {// Saving an MCP config on e.g. Gemini would be a silent no-op at run// time — that's the bug this hiding logic is meant to prevent.renderPane([makeRuntime("gemini")]);+ openCapabilities();expect(- screen.queryByRole("button", { name: /^MCP$/i }),+ screen.queryByRole("tab", { name: /^MCP$/i }),).not.toBeInTheDocument();});@@ -162,7 +197,8 @@ describe("AgentOverviewPane MCP tab visibility", () => {// the runtimes query resolving. Hiding the tab would flicker it off and// then back on, which reads as a bug.renderPane([]);- expect(screen.getByRole("button", { name: /^MCP$/i })).toBeInTheDocument();+ openCapabilities();+ expect(screen.getByRole("tab", { name: /^MCP$/i })).toBeInTheDocument();});});@@ -170,8 +206,9 @@ describe("AgentOverviewPane Integrations tab visibility", () => {it("shows the Integrations tab once the deployment has Lark configured", async () => {larkListingRef.current = { installations: [], configured: true };renderPane([makeRuntime("claude")]);+ openCapabilities();expect(- await screen.findByRole("button", { name: /^Integrations$/i }),+ await screen.findByRole("tab", { name: /^Integrations$/i }),).toBeInTheDocument();});@@ -180,8 +217,9 @@ describe("AgentOverviewPane Integrations tab visibility", () => {// a Slack-only deployment was hiding the tab (and its bind entry).slackListingRef.current = { installations: [], configured: true };renderPane([makeRuntime("claude")]);+ openCapabilities();expect(- await screen.findByRole("button", { name: /^Integrations$/i }),+ await screen.findByRole("tab", { name: /^Integrations$/i }),).toBeInTheDocument();});@@ -189,8 +227,17 @@ describe("AgentOverviewPane Integrations tab visibility", () => {// Default refs are configured:false; the tab must not appear on// deployments without either integration, the common case.renderPane([makeRuntime("claude")]);+ openCapabilities();expect(- screen.queryByRole("button", { name: /^Integrations$/i }),+ screen.queryByRole("tab", { name: /^Integrations$/i }),).not.toBeInTheDocument();});});++describe("AgentOverviewPane Settings navigation", () => {+ it("gives Access its own settings tab", () => {+ renderPane([makeRuntime("claude")]);+ openSettings();+ expect(screen.getByRole("tab", { name: /^Access$/i })).toBeInTheDocument();+ });+});diff --git a/packages/views/agents/components/agent-overview-pane.tsx b/packages/views/agents/components/agent-overview-pane.tsxindex 06e8c93fca..d05a7d03cb 100644--- a/packages/views/agents/components/agent-overview-pane.tsx+++ b/packages/views/agents/components/agent-overview-pane.tsx@@ -1,20 +1,12 @@"use client";-import { useEffect, useMemo, useState } from "react";-import {- Activity,- Blocks,- BookOpenText,- FileText,- KeyRound,- ListTodo,- Plug,- Router,- Terminal,- Webhook,-} from "lucide-react";+import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useQuery } from "@tanstack/react-query";-import type { Agent, AgentRuntime } from "@multica/core/types";+import type {+ Agent,+ AgentRuntime,+ MemberWithUser,+} from "@multica/core/types";import { providerSupportsMcpConfig } from "@multica/core/agents";import { useFeatureEnabled } from "@multica/core/config";import { COMPOSIO_MCP_APPS_FLAG } from "@multica/core/feature-flags";@@ -31,6 +23,7 @@ import {AlertDialogHeader,AlertDialogTitle,} from "@multica/ui/components/ui/alert-dialog";+import { cn } from "@multica/ui/lib/utils";import { ActivityTab } from "./tabs/activity-tab";import { InstructionsTab } from "./tabs/instructions-tab";import { SkillsTab } from "./tabs/skills-tab";@@ -40,319 +33,451 @@ import { McpConfigTab } from "./tabs/mcp-config-tab";import { AgentMcpTab } from "./tabs/agent-mcp-tab";import { IntegrationsTab } from "./tabs/integrations-tab";import { RuntimeConfigTab } from "./tabs/runtime-config-tab";+import { AgentDetailInspector } from "./agent-detail-inspector";+import { AgentAccessSettings } from "./agent-access-settings";+import { AgentOverviewSummary } from "./agent-overview-summary";import { ActorIssuesPanel } from "../../common/actor-issues-panel";import { useT } from "../../i18n";+import { useNavigation } from "../../navigation";++type DetailSection = "overview" | "work" | "capabilities" | "settings";export type DetailTab =- | "activity"- | "tasks"+ | "overview"+ | "work"| "instructions"| "skills"- | "env"- | "custom_args"| "mcp_config"| "composio_mcp"| "integrations"+ | "general"+ | "access"+ | "env"+ | "custom_args"| "runtime_config";-const TAB_LABEL_KEY: Record<DetailTab, "activity" | "tasks" | "instructions" | "skills" | "environment" | "custom_args" | "mcp_config" | "composio_mcp" | "integrations" | "runtime_config"> = {- activity: "activity",- tasks: "tasks",- instructions: "instructions",- skills: "skills",- env: "environment",- custom_args: "custom_args",- mcp_config: "mcp_config",- composio_mcp: "composio_mcp",- integrations: "integrations",- runtime_config: "runtime_config",+type SecondaryTab = {+ id: DetailTab;+ labelKey:+ | "instructions"+ | "skills"+ | "mcp_config"+ | "composio_mcp"+ | "integrations"+ | "general"+ | "access"+ | "environment"+ | "custom_args"+ | "runtime_config";};-const detailTabs: {- id: DetailTab;- icon: typeof FileText;-}[] = [- { id: "activity", icon: Activity },- { id: "tasks", icon: ListTodo },- { id: "instructions", icon: FileText },- { id: "skills", icon: BookOpenText },- { id: "env", icon: KeyRound },- { id: "custom_args", icon: Terminal },- { id: "mcp_config", icon: Plug },- { id: "composio_mcp", icon: Blocks },- { id: "integrations", icon: Webhook },- { id: "runtime_config", icon: Router },+const CAPABILITY_TABS: SecondaryTab[] = [+ { id: "instructions", labelKey: "instructions" },+ { id: "skills", labelKey: "skills" },+ { id: "mcp_config", labelKey: "mcp_config" },+ { id: "composio_mcp", labelKey: "composio_mcp" },+ { id: "integrations", labelKey: "integrations" },];+const SETTINGS_TABS: SecondaryTab[] = [+ { id: "general", labelKey: "general" },+ { id: "access", labelKey: "access" },+ { id: "env", labelKey: "environment" },+ { id: "custom_args", labelKey: "custom_args" },+ { id: "runtime_config", labelKey: "runtime_config" },+];++const TOP_TABS: { id: DetailSection; labelKey: DetailSection }[] = [+ { id: "overview", labelKey: "overview" },+ { id: "work", labelKey: "work" },+ { id: "capabilities", labelKey: "capabilities" },+ { id: "settings", labelKey: "settings" },+];++const CAPABILITY_IDS = new Set<DetailTab>(+ CAPABILITY_TABS.map((tab) => tab.id),+);+const SETTINGS_IDS = new Set<DetailTab>(SETTINGS_TABS.map((tab) => tab.id));+const DETAIL_VIEWS = new Set<DetailTab>([+ "overview",+ "work",+ ...CAPABILITY_TABS.map((tab) => tab.id),+ ...SETTINGS_TABS.map((tab) => tab.id),+]);++function isDetailTab(value: string | null): value is DetailTab {+ return value !== null && DETAIL_VIEWS.has(value as DetailTab);+}++function sectionForView(view: DetailTab): DetailSection {+ if (view === "overview") return "overview";+ if (view === "work") return "work";+ if (CAPABILITY_IDS.has(view)) return "capabilities";+ return "settings";+}+interface AgentOverviewPaneProps {agent: Agent;+ runtime: AgentRuntime | null;+ owner: MemberWithUser | null;runtimes: AgentRuntime[];+ members: MemberWithUser[];onUpdate: (id: string, data: Record<string, unknown>) => Promise<void>;- /**- * The viewer's user id. Gates the creator-only MCP tab — the tab entry is- * only rendered when the viewer is the agent owner (`agent.owner_id`),- * matching the backend's owner-only read/write of the toolkit allowlist- * (MUL-3870). `null` while auth is still loading hides the tab.- */currentUserId?: string | null;- /**- * One-shot request from a sibling (the inspector's compact Lark status- * row) to focus a specific tab. Routed through the same `requestTabChange`- * the tab buttons use, so the unsaved-changes guard still fires. The pane- * calls `onNavIntentHandled` to clear it after consuming.- */+ canEdit: boolean;navIntent?: DetailTab | null;onNavIntentHandled?: () => void;}/**- * Right-pane on the agent detail page:- *- * - Activity (default) — what the agent is doing now / how it's been doing /- * what it just finished. The "watch state" surface.- * - Tasks — assigned/created issues using the shared issue board/list.- * - Instructions / Skills / Env / Custom Args — four editing surfaces.- *- * The previous Settings tab was deleted because every field on it is now- * inline-editable in the inspector (left column) — runtime / model /- * visibility / concurrency via PropRow + Picker, and avatar / name /- * description via popover. Two entry points for the same writes was just- * extra concept count without extra capability.- *- * Activity is the landing tab because most visits to this page are diagnostic- * ("what is this agent doing / why did it fail?"), not configuration tweaks.- *- * **Unsaved-changes guard**: every config tab reports its dirty state up via- * `onDirtyChange`. Switching to another tab while the active tab is dirty- * pops a confirm dialog — without it, switching tabs would silently drop- * unsaved edits because each tab manages its own local state and remounts on- * tab change.+ * Agent workbench organised around user intent instead of backend fields.+ * Overview answers "what is happening now?", Work owns the issue surface,+ * Capabilities describes what the agent can do, and Settings describes how+ * it runs. The lower-level editors stay intact so the reorganisation does not+ * alter persistence or permission semantics.*/export function AgentOverviewPane({agent,+ runtime,+ owner,runtimes,+ members,onUpdate,currentUserId,+ canEdit,navIntent,onNavIntentHandled,}: AgentOverviewPaneProps) {const { t } = useT("agents");const wsId = useWorkspaceId();- const composioMCPAppsEnabled = useFeatureEnabled(COMPOSIO_MCP_APPS_FLAG, false);- const [activeTab, setActiveTab] = useState<DetailTab>("activity");+ const navigation = useNavigation();+ const urlView = navigation.searchParams.get("view");+ const composioMCPAppsEnabled = useFeatureEnabled(+ COMPOSIO_MCP_APPS_FLAG,+ false,+ );+ const [activeView, setActiveView] = useState<DetailTab>(() =>+ isDetailTab(urlView) ? urlView : "overview",+ );const [activeDirty, setActiveDirty] = useState(false);- // Holds the destination when a tab change is intercepted by the dirty- // guard. Null means no pending change. The AlertDialog reads non-null as- // "open".- const [pendingTab, setPendingTab] = useState<DetailTab | null>(null);-- const runtime = agent.runtime_id- ? runtimes.find((r) => r.id === agent.runtime_id) ?? null- : null;-- // Cached per-workspace and shared with the inspector's bind button, so this- // is at most one extra GET per workspace. We only read `configured` to- // decide whether the Integrations tab is worth showing at all.+ const [pendingView, setPendingView] = useState<DetailTab | null>(null);+ const lastUrlViewRef = useRef(urlView);+const { data: larkListing } = useQuery({...larkInstallationsOptions(wsId),enabled: !!wsId,});- const larkConfigured = larkListing?.configured === true;const { data: slackListing } = useQuery({...slackInstallationsOptions(wsId),enabled: !!wsId,});- const slackConfigured = slackListing?.configured === true;- // The Integrations tab appears once EITHER channel is wired on the- // deployment, so a Slack-only deployment (no Lark) still surfaces it.- const integrationsConfigured = larkConfigured || slackConfigured;-- // The MCP tab is only shown when the agent's runtime backend actually- // consumes mcp_config — see providerSupportsMcpConfig. We default to- // showing it when the runtime row hasn't loaded yet so a slow fetch- // can't transiently flicker the tab off and then on.- //- // The Integrations tab appears once the deployment has Lark OR Slack wired- // (configured). Unlike MCP we default to HIDING while the listing loads:- // deployments without either channel are the common case, so flashing the- // tab on then off would be the worse flicker.- //- // The Runtime Config tab is openclaw-only today (gateway mode lives there,- // issue #3260). Other providers' runtime_config is freeform JSONB that no- // backend currently reads, so surfacing the tab would let users save values- // their runtime ignores — same anti-footgun rationale as the MCP gate.- const visibleTabs = useMemo(() => {- const showMcp = runtime ? providerSupportsMcpConfig(runtime.provider) : true;- const showRuntimeConfig = runtime ? runtime.provider === "openclaw" : false;- // The Composio MCP tab is creator-only: it edits the agent owner's own- // toolkit allowlist, which the backend reads/writes for the owner alone- // (redacted + write-dropped for everyone else — MUL-3870 / MUL-3869).- // Hide the entry entirely for non-owners, and while auth is still loading.++ const integrationsConfigured =+ larkListing?.configured === true || slackListing?.configured === true;++ const visibleCapabilityTabs = useMemo(() => {+ const showMcp = runtime+ ? providerSupportsMcpConfig(runtime.provider)+ : true;const showComposioMcp =composioMCPAppsEnabled &&!!currentUserId &&!!agent.owner_id &&agent.owner_id === currentUserId;- return detailTabs.filter((tab) => {++ return CAPABILITY_TABS.filter((tab) => {if (tab.id === "mcp_config") return showMcp;if (tab.id === "composio_mcp") return showComposioMcp;if (tab.id === "integrations") return integrationsConfigured;- if (tab.id === "runtime_config") return showRuntimeConfig;return true;});- }, [runtime, integrationsConfigured, composioMCPAppsEnabled, currentUserId, agent.owner_id]);-- // If the active tab disappears (e.g. user just switched the agent's- // runtime to one that doesn't read mcp_config), fall back to Activity- // for this render so the pane is never empty. The user's stored- // activeTab is left alone — switching back to a supporting runtime- // brings their selection back.- const effectiveTab: DetailTab = visibleTabs.some((tab) => tab.id === activeTab)- ? activeTab- : "activity";-- const requestTabChange = (next: DetailTab) => {- if (next === activeTab) return;- if (activeDirty) {- setPendingTab(next);+ }, [+ agent.owner_id,+ composioMCPAppsEnabled,+ currentUserId,+ integrationsConfigured,+ runtime,+ ]);++ const visibleSettingsTabs = useMemo(+ () =>+ SETTINGS_TABS.filter(+ (tab) => tab.id !== "runtime_config" || runtime?.provider === "openclaw",+ ),+ [runtime?.provider],+ );++ const visibleViews = useMemo(+ () =>+ new Set<DetailTab>([+ "overview",+ "work",+ ...visibleCapabilityTabs.map((tab) => tab.id),+ ...visibleSettingsTabs.map((tab) => tab.id),+ ]),+ [visibleCapabilityTabs, visibleSettingsTabs],+ );++ const effectiveView = visibleViews.has(activeView) ? activeView : "overview";+ const activeSection = sectionForView(effectiveView);++ const commitView = useCallback(+ (next: DetailTab) => {+ setActiveView(next);+ const params = new URLSearchParams(navigation.searchParams);+ if (next === "overview") params.delete("view");+ else params.set("view", next);+ const query = params.toString();+ navigation.replace(`${navigation.pathname}${query ? `?${query}` : ""}`);+ },+ [navigation],+ );++ const requestView = useCallback(+ (next: DetailTab) => {+ if (next === effectiveView) return;+ if (activeDirty) {+ setPendingView(next);+ return;+ }+ commitView(next);+ },+ [activeDirty, commitView, effectiveView],+ );++ const requestSection = (section: DetailSection) => {+ if (section === "overview" || section === "work") {+ requestView(section);+ return;+ }+ if (section === "capabilities") {+ const current = CAPABILITY_IDS.has(effectiveView)+ ? effectiveView+ : visibleCapabilityTabs[0]?.id;+ if (current) requestView(current);return;}- setActiveTab(next);+ const current = SETTINGS_IDS.has(effectiveView)+ ? effectiveView+ : visibleSettingsTabs[0]?.id;+ if (current) requestView(current);};- const commitTabChange = () => {- if (pendingTab) {- setActiveTab(pendingTab);- // The new tab mounts fresh; its effect will report its own dirty state.- // We pre-clear so the guard can't trip from stale state on the way in.- setActiveDirty(false);- setPendingTab(null);- }+ const commitViewChange = () => {+ if (!pendingView) return;+ commitView(pendingView);+ setActiveDirty(false);+ setPendingView(null);};- // Consume a one-shot tab-focus request from a sibling. Routing through- // `requestTabChange` (rather than `setActiveTab`) keeps the unsaved-changes- // guard honored even when the request originates outside the tab strip. The- // effect body is a no-op while `navIntent` is null, so the unstable- // `requestTabChange`/`onNavIntentHandled` identities can't loop it.+ useEffect(() => {+ if (urlView === lastUrlViewRef.current) return;+ lastUrlViewRef.current = urlView;+ if (urlView === null) {+ setActiveView("overview");+ return;+ }+ if (isDetailTab(urlView) && visibleViews.has(urlView)) {+ setActiveView(urlView);+ }+ }, [urlView, visibleViews]);+useEffect(() => {if (navIntent == null) return;- requestTabChange(navIntent);+ if (visibleViews.has(navIntent)) requestView(navIntent);onNavIntentHandled?.();- }, [navIntent, requestTabChange, onNavIntentHandled]);+ }, [navIntent, onNavIntentHandled, requestView, visibleViews]);++ const secondaryTabs =+ activeSection === "capabilities"+ ? visibleCapabilityTabs+ : activeSection === "settings"+ ? visibleSettingsTabs+ : [];+ const activeSecondaryTab = secondaryTabs.find(+ (tab) => tab.id === effectiveView,+ );return (- // On mobile the parent stacks the inspector and overview and scrolls the- // page itself, so this pane has no inherited height. `min-h-[60vh]` keeps- // the tab content area usably tall when content is short; `md:` restores- // the grid-driven full-height behavior on tablet and up.- <div className="flex min-h-[60vh] flex-col overflow-hidden rounded-lg border bg-background md:h-full md:min-h-0">- <div className="flex shrink-0 items-center gap-0 overflow-x-auto border-b px-2 md:px-4">- {visibleTabs.map((tab) => (- <button- key={tab.id}- type="button"- onClick={() => requestTabChange(tab.id)}- className={`flex shrink-0 items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2.5 text-xs font-medium transition-colors ${- effectiveTab === tab.id- ? "border-foreground text-foreground"- : "border-transparent text-muted-foreground hover:text-foreground"- }`}- >- <tab.icon className="h-3.5 w-3.5" />- {t(($) => $.tabs[TAB_LABEL_KEY[tab.id]])}- </button>- ))}+ <div className="flex min-h-0 flex-1 flex-col bg-background">+ <div+ className="shrink-0 overflow-x-auto border-b px-4 sm:px-6"+ role="tablist"+ aria-label={t(($) => $.tabs.page_navigation_aria)}+ >+ <div className="mx-auto flex max-w-[1440px] items-center gap-6">+ {TOP_TABS.map((tab) => (+ <button+ key={tab.id}+ type="button"+ role="tab"+ aria-selected={activeSection === tab.id}+ onClick={() => requestSection(tab.id)}+ className={cn(+ "relative shrink-0 py-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",+ activeSection === tab.id+ ? "text-foreground after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground"+ : "text-muted-foreground hover:text-foreground",+ )}+ >+ {t(($) => $.tabs[tab.labelKey])}+ </button>+ ))}+ </div></div>- <div className="flex-1 min-h-0 overflow-y-auto">- {effectiveTab === "activity" && <ActivityTab agent={agent} />}- {effectiveTab === "tasks" && (- <div className="flex h-full min-h-[520px] flex-col">- <ActorIssuesPanel actorType="agent" actorId={agent.id} />+ <div className="min-h-0 flex-1 overflow-y-auto">+ {effectiveView === "overview" && (+ <div className="mx-auto max-w-[1440px] p-4 sm:p-6">+ <div className="grid gap-6 xl:grid-cols-[minmax(0,1fr)_320px]">+ <ActivityTab agent={agent} showPerformance={false} />+ <AgentOverviewSummary+ agent={agent}+ runtime={runtime}+ owner={owner}+ />+ </div></div>)}- {effectiveTab === "instructions" && (- <TabContent>- <InstructionsTab- agent={agent}- onSave={(instructions) => onUpdate(agent.id, { instructions })}- onDirtyChange={setActiveDirty}- />- </TabContent>- )}- {effectiveTab === "skills" && (- <TabContent>- <SkillsTab agent={agent} />- </TabContent>- )}- {effectiveTab === "env" && (- <TabContent>- <EnvTab- agent={agent}- onDirtyChange={setActiveDirty}- />- </TabContent>- )}- {effectiveTab === "custom_args" && (- <TabContent>- <CustomArgsTab- agent={agent}- runtimeDevice={runtime ?? undefined}- onSave={(updates) => onUpdate(agent.id, updates)}- onDirtyChange={setActiveDirty}- />- </TabContent>- )}- {effectiveTab === "mcp_config" && (- <TabContent>- <McpConfigTab- agent={agent}- onSave={(updates) => onUpdate(agent.id, updates)}- onDirtyChange={setActiveDirty}- />- </TabContent>- )}- {effectiveTab === "composio_mcp" && (- <TabContent>- <AgentMcpTab agent={agent} />- </TabContent>- )}- {effectiveTab === "integrations" && (- <TabContent>- <IntegrationsTab agent={agent} />- </TabContent>++ {effectiveView === "work" && (+ <div className="flex min-h-[620px] flex-col">+ <ActorIssuesPanel actorType="agent" actorId={agent.id} />+ </div>)}- {effectiveTab === "runtime_config" && (- <TabContent>- <RuntimeConfigTab- agent={agent}- onSave={(updates) => onUpdate(agent.id, updates)}- onDirtyChange={setActiveDirty}- />- </TabContent>++ {secondaryTabs.length > 0 && activeSecondaryTab && (+ <div className="flex min-h-full flex-col md:flex-row">+ <aside className="shrink-0 overflow-x-auto border-b border-surface-border bg-app-shell/70 p-2 md:w-52 md:overflow-x-visible md:border-b-0 md:border-r md:p-4">+ <div+ className="flex w-max min-w-full items-center gap-1 md:w-full md:flex-col md:items-stretch"+ role="tablist"+ aria-orientation="vertical"+ aria-label={t(($) => $.tabs.section_navigation_aria)}+ >+ {secondaryTabs.map((tab) => {+ const active = effectiveView === tab.id;+ return (+ <button+ key={tab.id}+ type="button"+ role="tab"+ aria-selected={active}+ onClick={() => requestView(tab.id)}+ className={cn(+ "flex h-8 shrink-0 items-center rounded-md px-2.5 text-left text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring md:w-full",+ active+ ? "bg-surface-selected font-medium text-surface-selected-foreground hover:bg-surface-selected"+ : "text-muted-foreground hover:bg-surface-hover hover:text-foreground",+ )}+ >+ {t(($) => $.tabs[tab.labelKey])}+ </button>+ );+ })}+ </div>+ </aside>++ <section className="min-w-0 flex-1">+ <div className="mx-auto w-full max-w-3xl p-4 sm:p-6 md:p-8">+ <header>+ <h2 className="text-base font-medium text-balance">+ {t(($) => $.tabs[activeSecondaryTab.labelKey])}+ </h2>+ </header>++ <div className="mt-6">+ {effectiveView === "instructions" && (+ <InstructionsTab+ agent={agent}+ onSave={(instructions) =>+ onUpdate(agent.id, { instructions })+ }+ onDirtyChange={setActiveDirty}+ />+ )}+ {effectiveView === "skills" && <SkillsTab agent={agent} />}+ {effectiveView === "mcp_config" && (+ <McpConfigTab+ agent={agent}+ onSave={(updates) => onUpdate(agent.id, updates)}+ onDirtyChange={setActiveDirty}+ />+ )}+ {effectiveView === "composio_mcp" && (+ <AgentMcpTab agent={agent} />+ )}+ {effectiveView === "integrations" && (+ <IntegrationsTab agent={agent} />+ )}+ {effectiveView === "general" && (+ <AgentDetailInspector+ agent={agent}+ runtime={runtime}+ runtimes={runtimes}+ members={members}+ currentUserId={currentUserId ?? null}+ canEdit={canEdit}+ onUpdate={onUpdate}+ />+ )}+ {effectiveView === "access" && (+ <AgentAccessSettings+ agent={agent}+ members={members}+ currentUserId={currentUserId ?? null}+ onDirtyChange={setActiveDirty}+ onUpdate={onUpdate}+ />+ )}+ {effectiveView === "env" && (+ <EnvTab agent={agent} onDirtyChange={setActiveDirty} />+ )}+ {effectiveView === "custom_args" && (+ <CustomArgsTab+ agent={agent}+ runtimeDevice={runtime ?? undefined}+ onSave={(updates) => onUpdate(agent.id, updates)}+ onDirtyChange={setActiveDirty}+ />+ )}+ {effectiveView === "runtime_config" && (+ <RuntimeConfigTab+ agent={agent}+ onSave={(updates) => onUpdate(agent.id, updates)}+ onDirtyChange={setActiveDirty}+ />+ )}+ </div>+ </div>+ </section>+ </div>)}</div>- {pendingTab !== null && (+ {pendingView !== null && (<AlertDialogopen- onOpenChange={(v) => {- if (!v) setPendingTab(null);+ onOpenChange={(open) => {+ if (!open) setPendingView(null);}}><AlertDialogContent><AlertDialogHeader>- <AlertDialogTitle>{t(($) => $.tabs.discard_dialog_title)}</AlertDialogTitle>+ <AlertDialogTitle>+ {t(($) => $.tabs.discard_dialog_title)}+ </AlertDialogTitle><AlertDialogDescription>{t(($) => $.tabs.discard_dialog_description)}</AlertDialogDescription></AlertDialogHeader><AlertDialogFooter>- <AlertDialogCancel>{t(($) => $.tabs.discard_keep)}</AlertDialogCancel>+ <AlertDialogCancel>+ {t(($) => $.tabs.discard_keep)}+ </AlertDialogCancel><AlertDialogActionvariant="destructive"- onClick={commitTabChange}+ onClick={commitViewChange}>{t(($) => $.tabs.discard_confirm)}</AlertDialogAction>@@ -363,15 +488,3 @@ export function AgentOverviewPane({</div>);}--// Padded, full-width container shared by every config tab. `h-full flex-// flex-col` lets a tab opt into "fill the viewport" by giving its root-// element `flex-1 min-h-0` (Instructions does this so the editor expands-// instead of pushing the Save row off-screen). Tabs that don't opt in-// behave as natural-height blocks; long content (e.g. Settings, long Skills-// list) still scrolls via the parent's overflow-y-auto.-function TabContent({ children }: { children: React.ReactNode }) {- return (- <div className="flex h-full flex-col p-4 md:p-6">{children}</div>- );-}diff --git a/packages/views/agents/components/agent-overview-summary.tsx b/packages/views/agents/components/agent-overview-summary.tsxnew file mode 100644index 0000000000..2635bf8ede--- /dev/null+++ b/packages/views/agents/components/agent-overview-summary.tsx@@ -0,0 +1,130 @@+"use client";++import { Bot, Server } from "lucide-react";+import type {+ Agent,+ AgentRuntime,+ MemberWithUser,+} from "@multica/core/types";+import { ActorAvatar } from "../../common/actor-avatar";+import { useT } from "../../i18n";+import { VisibilityBadge } from "./visibility-badge";+import { AgentPerformanceSummary } from "./tabs/activity-tab";++interface AgentOverviewSummaryProps {+ agent: Agent;+ runtime: AgentRuntime | null;+ owner: MemberWithUser | null;+}++/**+ * Read-only context for the workbench Overview. Editing lives under Settings;+ * keeping this surface non-interactive lets users scan identity, execution,+ * and capability context without mistaking every value for a control.+ */+export function AgentOverviewSummary({+ agent,+ runtime,+ owner,+}: AgentOverviewSummaryProps) {+ const { t } = useT("agents");+ const runtimeOnline = runtime?.status === "online";++ return (+ <aside className="self-start rounded-xl border border-surface-border bg-surface p-5 shadow-[var(--surface-shadow)] xl:sticky xl:top-6">+ <section>+ <h2 className="text-sm font-medium">+ {t(($) => $.overview.agent_context)}+ </h2>+ <dl className="mt-4 space-y-3 text-xs">+ {owner && (+ <SummaryRow label={t(($) => $.inspector.prop_owner)}>+ <span className="flex min-w-0 items-center gap-1.5">+ <ActorAvatar+ actorType="member"+ actorId={owner.user_id}+ size="xs"+ />+ <span className="truncate text-foreground">{owner.name}</span>+ </span>+ </SummaryRow>+ )}+ <SummaryRow label={t(($) => $.overview.access)}>+ <VisibilityBadge value={agent.visibility} />+ </SummaryRow>+ <SummaryRow label={t(($) => $.inspector.prop_runtime)}>+ <span className="flex min-w-0 items-center gap-1.5 text-foreground">+ <span+ className={`h-1.5 w-1.5 shrink-0 rounded-full ${+ runtimeOnline ? "bg-success" : "bg-muted-foreground/40"+ }`}+ aria-hidden="true"+ />+ <Server className="h-3 w-3 shrink-0 text-muted-foreground" aria-hidden="true" />+ <span className="truncate">+ {runtime?.name ?? t(($) => $.pickers.runtime_none)}+ </span>+ </span>+ </SummaryRow>+ <SummaryRow label={t(($) => $.inspector.prop_model)}>+ <span className="flex min-w-0 items-center gap-1.5 text-foreground">+ <Bot className="h-3 w-3 shrink-0 text-muted-foreground" aria-hidden="true" />+ <span className="truncate">+ {agent.model || t(($) => $.pickers.model_default)}+ </span>+ </span>+ </SummaryRow>+ <SummaryRow label={t(($) => $.inspector.prop_concurrency)}>+ <span className="font-mono tabular-nums text-foreground">+ {agent.max_concurrent_tasks}+ </span>+ </SummaryRow>+ </dl>+ </section>++ <section className="mt-5 border-t pt-5">+ <div className="flex items-center justify-between gap-3">+ <h2 className="text-sm font-medium">+ {t(($) => $.inspector.section_skills)}+ </h2>+ <span className="font-mono text-xs tabular-nums text-muted-foreground">+ {agent.skills.length}+ </span>+ </div>+ {agent.skills.length > 0 ? (+ <div className="mt-3 flex flex-wrap gap-1.5">+ {agent.skills.map((skill) => (+ <span+ key={skill.id}+ className="max-w-full truncate rounded-md border border-surface-border bg-surface-hover px-2 py-1 text-xs text-muted-foreground"+ >+ {skill.name}+ </span>+ ))}+ </div>+ ) : (+ <p className="mt-3 text-xs text-muted-foreground">+ {t(($) => $.tab_body.skills.empty_title)}+ </p>+ )}+ </section>++ <AgentPerformanceSummary agent={agent} />+ </aside>+ );+}++function SummaryRow({+ label,+ children,+}: {+ label: string;+ children: React.ReactNode;+}) {+ return (+ <div className="grid grid-cols-[88px_minmax(0,1fr)] items-center gap-3">+ <dt className="text-muted-foreground">{label}</dt>+ <dd className="min-w-0">{children}</dd>+ </div>+ );+}diff --git a/packages/views/agents/components/agents-page.tsx b/packages/views/agents/components/agents-page.tsxindex 6b083329aa..73ad5c89b1 100644--- a/packages/views/agents/components/agents-page.tsx+++ b/packages/views/agents/components/agents-page.tsx@@ -74,7 +74,11 @@ import {} from "@multica/ui/components/ui/tooltip";import { useNavigation, useRowLink } from "../../navigation";import { ActorAvatar } from "../../common/actor-avatar";-import { PageHeader } from "../../layout/page-header";+import {+ CollectionPageHeader,+ CollectionPageHeaderAction,+ CollectionPageState,+} from "../../layout/collection-page";import { availabilityConfig } from "../presence";import { CreateAgentDialog } from "./create-agent-dialog";import { AgentRowActions } from "./agent-row-actions";@@ -202,41 +206,23 @@ function PageHeaderBar({}) {const { t } = useT("agents");return (- <PageHeader className="justify-between px-5">- <div className="flex items-center gap-2">- <Bot className="h-4 w-4 text-muted-foreground" />- <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>- {totalCount > 0 && (- <span className="font-mono text-xs tabular-nums text-muted-foreground/70">- {totalCount}- </span>- )}- <p className="ml-2 hidden text-xs text-muted-foreground md:block">- {t(($) => $.page.tagline)}{" "}- <a- href="https://multica.ai/docs/agents"- target="_blank"- rel="noopener noreferrer"- className="underline decoration-muted-foreground/30 underline-offset-4 transition-colors hover:text-foreground"- >- {t(($) => $.page.learn_more)}- </a>- </p>- </div>- {/* Quiet chrome button (outline, icon-only below md) — primary is- reserved for the empty state's CTA. */}- <Button- type="button"- size="sm"- variant="outline"- className="h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5"- aria-label={t(($) => $.page.new_agent)}- onClick={onCreate}- >- <Plus className="h-3.5 w-3.5" />- <span className="hidden md:inline">{t(($) => $.page.new_agent)}</span>- </Button>- </PageHeader>+ <CollectionPageHeader+ icon={Bot}+ title={t(($) => $.page.title)}+ count={totalCount}+ description={t(($) => $.page.tagline)}+ learnMore={{+ href: "https://multica.ai/docs/agents",+ label: t(($) => $.page.learn_more),+ }}+ actions={+ <CollectionPageHeaderAction+ icon={Plus}+ label={t(($) => $.page.new_agent)}+ onClick={onCreate}+ />+ }+ />);}@@ -253,22 +239,22 @@ function ListError({return (<div className="flex flex-1 min-h-0 flex-col"><PageHeaderBar totalCount={0} onCreate={onCreate} />- <div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center">- <AlertCircle className="h-8 w-8 text-destructive" />- <div>- <p className="text-sm font-medium">- {t(($) => $.page.list_load_failed)}- </p>- <p className="mt-1 text-xs text-muted-foreground">- {listError instanceof Error- ? listError.message- : t(($) => $.page.list_load_failed_default)}- </p>- </div>- <Button type="button" variant="outline" size="sm" onClick={onRetry}>- {t(($) => $.page.try_again)}- </Button>- </div>+ <CollectionPageState+ role="alert"+ tone="destructive"+ icon={AlertCircle}+ title={t(($) => $.page.list_load_failed)}+ description={+ listError instanceof Error+ ? listError.message+ : t(($) => $.page.list_load_failed_default)+ }+ actions={+ <Button type="button" variant="outline" size="sm" onClick={onRetry}>+ {t(($) => $.page.try_again)}+ </Button>+ }+ /></div>);}@@ -276,21 +262,17 @@ function ListError({function EmptyState({ onCreate }: { onCreate: () => void }) {const { t } = useT("agents");return (- <div className="flex flex-1 flex-col items-center justify-center px-6 py-16 text-center">- <div className="flex h-12 w-12 items-center justify-center rounded-full bg-muted">- <Bot className="h-6 w-6 text-muted-foreground" />- </div>- <h2 className="mt-4 text-base font-semibold">- {t(($) => $.empty.title)}- </h2>- <p className="mt-1 max-w-md text-sm text-muted-foreground">- {t(($) => $.empty.description)}- </p>- <Button type="button" onClick={onCreate} size="sm" className="mt-5">- <Plus className="h-3 w-3" />- {t(($) => $.page.new_agent)}- </Button>- </div>+ <CollectionPageState+ icon={Bot}+ title={t(($) => $.empty.title)}+ description={t(($) => $.empty.description)}+ actions={+ <Button type="button" onClick={onCreate} size="sm">+ <Plus aria-hidden="true" className="size-3" />+ {t(($) => $.page.new_agent)}+ </Button>+ }+ />);}diff --git a/packages/views/agents/components/inspector/access-picker.test.tsx b/packages/views/agents/components/inspector/access-picker.test.tsxindex 12fc38aa68..428f350d80 100644--- a/packages/views/agents/components/inspector/access-picker.test.tsx+++ b/packages/views/agents/components/inspector/access-picker.test.tsx@@ -76,19 +76,49 @@ describe("AccessPicker owner-only editing (MUL-3963)", () => {).toBeInTheDocument();});- it("renders an interactive trigger for the owner", () => {+ it("renders explicit access choices for the owner", () => {renderPicker({ canEdit: true });- expect(screen.getByRole("button")).toBeInTheDocument();- // Private is the default summary.- expect(screen.getAllByText("Only me").length).toBeGreaterThan(0);+ expect(+ screen.getByRole("radio", { name: /^Private/i }),+ ).toBeChecked();+ expect(+ screen.getByRole("radio", { name: /^Shared/i }),+ ).not.toBeChecked();});- it("owner can pick a specific member, emitting a public_to member target", () => {+ it("defaults a newly shared agent to workspace access", () => {const { onChange } = renderPicker({ canEdit: true });- fireEvent.click(screen.getByRole("button"));- // Checkbox order in the open popover: [0] workspace, [1] Alice, [2] Bob.- const boxes = screen.getAllByRole("checkbox");- fireEvent.click(boxes[1]!);+ fireEvent.click(screen.getByRole("radio", { name: /^Shared/i }));+ expect(onChange).not.toHaveBeenCalled();+ expect(+ screen.getByRole("checkbox", { name: /Public to workspace/i }),+ ).toBeChecked();+ fireEvent.click(screen.getByRole("button", { name: "Save" }));+ expect(onChange).toHaveBeenCalledWith({+ permission_mode: "public_to",+ invocation_targets: [{ target_type: "workspace" }],+ });+ });++ it("reports an unsaved draft until the owner returns to the persisted mode", () => {+ const onDirtyChange = vi.fn();+ renderPicker({ canEdit: true, onDirtyChange });++ fireEvent.click(screen.getByRole("radio", { name: /^Shared/i }));+ expect(onDirtyChange).toHaveBeenLastCalledWith(true);++ fireEvent.click(screen.getByRole("radio", { name: /^Private/i }));+ expect(onDirtyChange).toHaveBeenLastCalledWith(false);+ });++ it("owner can pick a specific member, emitting a public_to member target", () => {+ const { onChange } = renderPicker({+ canEdit: true,+ permissionMode: "public_to",+ invocationTargets: [],+ });+ fireEvent.click(screen.getByRole("checkbox", { name: /Alice/i }));+ fireEvent.click(screen.getByRole("button", { name: "Save" }));expect(onChange).toHaveBeenCalledWith({permission_mode: "public_to",invocation_targets: [{ target_type: "member", target_id: "u1" }],@@ -104,10 +134,10 @@ describe("AccessPicker owner-only editing (MUL-3963)", () => {invocationTargets: [{ target_type: "member", target_id: "u1" }],visibility: "private",});- fireEvent.click(screen.getByRole("button"));- const boxes = screen.getAllByRole("checkbox");- // [0] is the "Everyone in workspace" toggle.- fireEvent.click(boxes[0]!);+ fireEvent.click(+ screen.getByRole("checkbox", { name: /Public to workspace/i }),+ );+ fireEvent.click(screen.getByRole("button", { name: "Save" }));expect(onChange).toHaveBeenCalledWith({permission_mode: "public_to",invocation_targets: [@@ -129,8 +159,9 @@ describe("AccessPicker owner-only editing (MUL-3963)", () => {invocationTargets: undefined as unknown as AgentInvocationTarget[],}),).not.toThrow();- // Private is the fallback summary when there are no grants.- expect(screen.getAllByText("Only me").length).toBeGreaterThan(0);+ expect(+ screen.getByRole("radio", { name: /^Private/i }),+ ).toBeChecked();});it("read-only mode: undefined invocationTargets does not crash for non-owners", () => {diff --git a/packages/views/agents/components/inspector/access-picker.tsx b/packages/views/agents/components/inspector/access-picker.tsxindex 6ea16abdac..6145e490f8 100644--- a/packages/views/agents/components/inspector/access-picker.tsx+++ b/packages/views/agents/components/inspector/access-picker.tsx@@ -1,7 +1,7 @@"use client";-import { useState } from "react";-import { Globe, Lock, Users, UsersRound } from "lucide-react";+import { useEffect, useMemo, useState } from "react";+import { Globe, Loader2, Lock, Users } from "lucide-react";import type {AgentInvocationTarget,AgentInvocationTargetInput,@@ -9,332 +9,347 @@ import type {AgentVisibility,MemberWithUser,} from "@multica/core/types";+import { Button } from "@multica/ui/components/ui/button";import { Checkbox } from "@multica/ui/components/ui/checkbox";-import {- Tooltip,- TooltipTrigger,- TooltipContent,-} from "@multica/ui/components/ui/tooltip";-import {- PickerItem,- PropertyPicker,-} from "../../../issues/components/pickers";import { ActorAvatar } from "../../../common/actor-avatar";import { useT } from "../../../i18n";-import { CHIP_CLASS } from "./chip";--/**- * AccessPicker — the owner-facing control for MUL-3963 agent invocation- * permissions. It reads/writes `permission_mode` + `invocation_targets`- * (the authoritative gate) rather than the legacy derived `visibility` field.- *- * Access is EITHER Private (only me) OR Public with a STACKABLE, MIXED- * allow-list: the owner can combine "Everyone in workspace" + any number of- * specific members + (future) teams on the same agent. `canInvokeAgent` on- * the backend admits an actor matching ANY target (OR), so the picker emits- * the full union of every selected target and the whole set is replaced on- * save.- *- * OWNER-ONLY (MUL-3963): access is the one agent property a workspace admin- * may NOT change — only the agent owner decides who can run their agent, and- * the backend rejects a non-owner permission change with 403. So `canEdit`- * here must be passed as "is the viewer the agent owner", NOT the general- * manage permission. When `canEdit` is false the control is a static,- * non-interactive read-only display (current value + a lock affordance +- * a tooltip explaining only the owner can change it), the same way GitHub /- * Notion present a permission setting a viewer can see but not edit. There is- * deliberately no clickable trigger in that state, so a non-owner can never- * open a picker that the backend would only bounce back.- */export type AccessChange = {permission_mode: AgentPermissionMode;invocation_targets: AgentInvocationTargetInput[];};-// The helpers below defensively coerce a missing (`undefined` / `null`) list-// to an empty array. `Agent.invocation_targets` is TYPED as a required array,-// and the modern backend always serialises `[]` when there are no grants,-// but older self-host servers / stale query caches / template create-// responses (see `MinimalAgentSchema` in api/schemas.ts) can still surface an-// undefined value at runtime. Without the fallback, opening an agent detail-// page against a legacy backend crashes the whole route with-// "Cannot read properties of undefined (reading 'some')" (GH #4915).function hasWorkspaceTarget(targets: AgentInvocationTarget[] | undefined | null,): boolean {- return (targets ?? []).some((t) => t.target_type === "workspace");-}--function selectedMemberIds(- targets: AgentInvocationTarget[] | undefined | null,-): string[] {- return (targets ?? [])- .filter((t) => t.target_type === "member" && t.target_id !== null)- .map((t) => t.target_id as string);+ return (targets ?? []).some((target) => target.target_type === "workspace");}-function selectedTeamIds(+function selectedTargetIds(targets: AgentInvocationTarget[] | undefined | null,+ type: "member" | "team",): string[] {return (targets ?? [])- .filter((t) => t.target_type === "team" && t.target_id !== null)- .map((t) => t.target_id as string);+ .filter(+ (target) => target.target_type === type && target.target_id !== null,+ )+ .map((target) => target.target_id as string);}+/**+ * Draft-first access editor. Visibility changes are security-sensitive, so+ * choosing Shared only reveals the scope controls; nothing is persisted until+ * the owner explicitly saves the complete selection.+ */export function AccessPicker({permissionMode,invocationTargets,visibility: _visibility,members,+ ownerId,canEdit = true,hasComposioAllowlist = false,+ onDirtyChange,onChange,}: {permissionMode: AgentPermissionMode;- /**- * The agent's invocation grants. Typed loose (may be `undefined`) because- * the schema is `optional()` and older self-host backends / template create- * responses can omit the field even though the modern shape is a- * required-array. The internal helpers `?? []` this before reading.- */invocationTargets: AgentInvocationTarget[] | undefined;- /**- * Legacy derived visibility. No longer rendered directly (the read-only and- * editable states both summarise permission_mode + targets), but kept in the- * props so existing call sites compile unchanged.- */visibility: AgentVisibility;members: MemberWithUser[];- /**- * True ONLY when the viewer is the agent owner (MUL-3963 access is- * owner-only). When false, render the static read-only state.- */+ ownerId?: string | null;canEdit?: boolean;- /**- * True when the agent already has a non-empty Composio toolkit allowlist.- * Surfaces a one-time hint when the owner shares a previously-private agent,- * since sharing widens who can drive those apps through the agent.- */hasComposioAllowlist?: boolean;+ onDirtyChange?: (dirty: boolean) => void;onChange: (next: AccessChange) => Promise<void> | void;}) {const { t } = useT("agents");- const [open, setOpen] = useState(false);- const [showComposioHint, setShowComposioHint] = useState(false);+ const { t: tc } = useT("common");+ const persistedPrivate = permissionMode === "private";+ const persistedWorkspace =+ !persistedPrivate && hasWorkspaceTarget(invocationTargets);+ const persistedMembers = useMemo(+ () => selectedTargetIds(invocationTargets, "member"),+ [invocationTargets],+ );+ const teamIds = useMemo(+ () => selectedTargetIds(invocationTargets, "team"),+ [invocationTargets],+ );- // Display summary of the current access, shared by the read-only and- // editable states so they never drift.- const isPrivate = permissionMode === "private";- const workspaceOn = !isPrivate && hasWorkspaceTarget(invocationTargets);- const memberIds = selectedMemberIds(invocationTargets);- // Team targets aren't editable in v1, but must be preserved across saves so- // a batch-replace never silently drops them.- const teamIds = selectedTeamIds(invocationTargets);- const memberCount = memberIds.length;+ const [draftPrivate, setDraftPrivate] = useState(persistedPrivate);+ const [draftWorkspace, setDraftWorkspace] = useState(persistedWorkspace);+ const [draftMembers, setDraftMembers] = useState(persistedMembers);+ const [saving, setSaving] = useState(false);- const SummaryIcon = isPrivate- ? Lock- : workspaceOn- ? Globe- : memberCount > 0- ? Users- : Globe;+ useEffect(() => {+ setDraftPrivate(persistedPrivate);+ setDraftWorkspace(persistedWorkspace);+ setDraftMembers(persistedMembers);+ }, [persistedMembers, persistedPrivate, persistedWorkspace]);- const summaryLabel = isPrivate- ? t(($) => $.access.trigger_private)- : workspaceOn- ? t(($) => $.access.trigger_workspace)- : memberCount > 0- ? t(($) => $.access.trigger_members_count, { count: memberCount })- : t(($) => $.access.trigger_members_empty);+ const editableMembers = ownerId+ ? members.filter((member) => member.user_id !== ownerId)+ : members;- // Read-only state for non-owners: current value + lock + owner-only tooltip.- // No interactive trigger is rendered, so the control can never be clicked- // into a change the backend would reject.- if (!canEdit) {- const readOnlyMsg = t(($) => $.access.owner_only_readonly);- return (- <Tooltip>- <TooltipTrigger- render={- <span- className="inline-flex items-center gap-1 text-xs text-muted-foreground"- aria-label={readOnlyMsg}- data-testid="access-readonly"- >- <SummaryIcon className="h-3 w-3 shrink-0" />- <span className="truncate">{summaryLabel}</span>- <Lock className="h-3 w-3 shrink-0 opacity-60" />- </span>- }- />- <TooltipContent>{readOnlyMsg}</TooltipContent>- </Tooltip>- );- }+ const sameMembers =+ draftMembers.length === persistedMembers.length &&+ draftMembers.every((id) => persistedMembers.includes(id));+ const dirty =+ draftPrivate !== persistedPrivate ||+ (!draftPrivate &&+ (draftWorkspace !== persistedWorkspace || !sameMembers));+ const hasSharedTarget =+ draftWorkspace || draftMembers.length > 0 || teamIds.length > 0;- // Build the union of every selected target and emit it. An empty union- // collapses to Private (owner-only), which is the intuitive "nothing shared"- // state rather than a public_to with no grants.- const emit = (next: {- workspace: boolean;- members: string[];- teams: string[];- }) => {- const targets: AgentInvocationTargetInput[] = [];- if (next.workspace) targets.push({ target_type: "workspace" });- for (const id of next.members)- targets.push({ target_type: "member", target_id: id });- for (const id of next.teams)- targets.push({ target_type: "team", target_id: id });- if (targets.length === 0) {- void onChange({ permission_mode: "private", invocation_targets: [] });- return;- }- void onChange({- permission_mode: "public_to",- invocation_targets: targets,- });- };+ useEffect(() => {+ onDirtyChange?.(dirty);+ return () => onDirtyChange?.(false);+ }, [dirty, onDirtyChange]);- const maybeFlagComposio = (goingPublic: boolean) => {- if (hasComposioAllowlist && isPrivate && goingPublic) {- setShowComposioHint(true);- }+ const chooseMode = (mode: "private" | "shared") => {+ const nextPrivate = mode === "private";+ setDraftPrivate(nextPrivate);+ if (!nextPrivate && !hasSharedTarget) setDraftWorkspace(true);};- const choosePrivate = () => {- setShowComposioHint(false);- void onChange({ permission_mode: "private", invocation_targets: [] });+ const toggleMember = (userId: string, checked: boolean) => {+ setDraftMembers((current) => {+ const next = new Set(current);+ if (checked) next.add(userId);+ else next.delete(userId);+ return Array.from(next);+ });};- const toggleWorkspace = (checked: boolean) => {- maybeFlagComposio(checked);- emit({ workspace: checked, members: memberIds, teams: teamIds });- };+ const save = async () => {+ if (!dirty || saving || (!draftPrivate && !hasSharedTarget)) return;+ const targets: AgentInvocationTargetInput[] = [];+ if (!draftPrivate && draftWorkspace) {+ targets.push({ target_type: "workspace" });+ }+ if (!draftPrivate) {+ for (const id of draftMembers) {+ targets.push({ target_type: "member", target_id: id });+ }+ for (const id of teamIds) {+ targets.push({ target_type: "team", target_id: id });+ }+ }- const toggleMember = (userId: string, checked: boolean) => {- maybeFlagComposio(checked);- const next = new Set(memberIds);- if (checked) next.add(userId);- else next.delete(userId);- emit({ workspace: workspaceOn, members: Array.from(next), teams: teamIds });+ setSaving(true);+ try {+ await onChange({+ permission_mode: draftPrivate ? "private" : "public_to",+ invocation_targets: draftPrivate ? [] : targets,+ });+ } finally {+ setSaving(false);+ }};- const tooltip = t(($) => $.access.tooltip);+ if (!canEdit) {+ const summaryLabel = persistedPrivate+ ? t(($) => $.access.trigger_private)+ : persistedWorkspace+ ? t(($) => $.access.trigger_workspace)+ : persistedMembers.length > 0+ ? t(($) => $.access.trigger_members_count, {+ count: persistedMembers.length,+ })+ : t(($) => $.access.trigger_members_empty);- return (- <PropertyPicker- open={open}- onOpenChange={(v) => {- setOpen(v);- if (v) setShowComposioHint(false);- }}- width="w-auto min-w-[15rem]"- align="start"- tooltip={tooltip}- triggerRender={- <button type="button" className={CHIP_CLASS} aria-label={tooltip} />- }- trigger={- <>- <SummaryIcon className="h-3 w-3 shrink-0 text-muted-foreground" />- <span className="truncate">{summaryLabel}</span>- </>- }- >- {/* Private is the exclusive "not shared" choice: selecting it clears the- whole allow-list. */}- <PickerItem selected={isPrivate} onClick={choosePrivate}>- <Lock className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />- <div className="text-left">- <div className="font-medium">{t(($) => $.access.private_title)}</div>- <div className="text-xs text-muted-foreground">- {t(($) => $.access.private_desc)}- </div>+ return (+ <div+ className="flex items-start gap-3 px-4 py-4"+ aria-label={t(($) => $.access.owner_only_readonly)}+ data-testid="access-readonly"+ >+ <span className="mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground">+ <Lock className="size-4" aria-hidden="true" />+ </span>+ <div className="min-w-0">+ <p className="text-sm font-medium">{summaryLabel}</p>+ <p className="mt-0.5 text-xs leading-5 text-muted-foreground">+ {t(($) => $.access.owner_only_readonly)}+ </p></div>- </PickerItem>+ </div>+ );+ }- <div className="mt-1 border-t pt-1">- <div className="px-2 pb-1 pt-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground">- {t(($) => $.access.public_group)}- </div>+ return (+ <fieldset>+ <legend className="sr-only">{t(($) => $.access.tooltip)}</legend>- {/* Everyone in workspace — stackable with member/team targets. */}- <label className="flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent">- <Checkbox- checked={workspaceOn}- onCheckedChange={(v) => toggleWorkspace(v === true)}- aria-label={t(($) => $.access.workspace_title)}- />- <Globe className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />- <div className="min-w-0 flex-1 text-left">- <div className="font-medium">- {t(($) => $.access.workspace_title)}- </div>- <div className="truncate text-xs text-muted-foreground">- {t(($) => $.access.workspace_desc)}- </div>- </div>- </label>+ <div className="divide-y divide-surface-border">+ <AccessChoice+ name="agent-access-mode"+ value="private"+ icon={Lock}+ title={t(($) => $.access.private_title)}+ description={t(($) => $.access.private_desc)}+ selected={draftPrivate}+ onSelect={() => chooseMode("private")}+ />+ <AccessChoice+ name="agent-access-mode"+ value="shared"+ icon={Users}+ title={t(($) => $.access.shared_title)}+ description={t(($) => $.access.shared_desc)}+ selected={!draftPrivate}+ onSelect={() => chooseMode("shared")}+ /></div>- {/* Specific people — multi-select, stacks with the workspace toggle. */}- <div className="mt-1 border-t pt-1">- <div className="flex items-center gap-1.5 px-2 pb-1 pt-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground">- <Users className="h-3 w-3 shrink-0" />- {t(($) => $.access.members_group)}- </div>- {members.length === 0 ? (- <div className="px-2 py-2 text-xs text-muted-foreground">- {t(($) => $.access.members_empty)}+ {!draftPrivate ? (+ <div className="space-y-6 border-t border-surface-border bg-muted/20 px-4 py-5 sm:px-6">+ <div>+ <h4 className="text-sm font-medium">+ {t(($) => $.access.public_group)}+ </h4>+ <div className="mt-3 flex items-start gap-3 rounded-lg border bg-background p-3">+ <Checkbox+ id="agent-access-workspace"+ checked={draftWorkspace}+ onCheckedChange={(value) =>+ setDraftWorkspace(value === true)+ }+ className="mt-0.5"+ />+ <label+ htmlFor="agent-access-workspace"+ className="flex min-w-0 flex-1 cursor-pointer items-start gap-3"+ >+ <Globe+ className="mt-0.5 size-4 shrink-0 text-muted-foreground"+ aria-hidden="true"+ />+ <span className="min-w-0">+ <span className="block text-sm font-medium">+ {t(($) => $.access.workspace_title)}+ </span>+ <span className="mt-0.5 block text-xs leading-5 text-muted-foreground">+ {t(($) => $.access.workspace_desc)}+ </span>+ </span>+ </label>+ </div></div>- ) : (- <div className="max-h-48 overflow-y-auto">- {members.map((m) => {- const checked = memberIds.includes(m.user_id);- return (- <label- key={m.user_id}- className="flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent"- >- <Checkbox- checked={checked}- onCheckedChange={(v) => toggleMember(m.user_id, v === true)}- aria-label={m.name}- />- <ActorAvatar- actorType="member"- actorId={m.user_id}- size="sm"- />- <span className="min-w-0 flex-1 truncate">{m.name}</span>- </label>- );- })}++ <div>+ <h4 className="text-sm font-medium">+ {t(($) => $.access.members_group)}+ </h4>+ {editableMembers.length === 0 ? (+ <p className="mt-3 text-xs text-muted-foreground">+ {t(($) => $.access.members_empty)}+ </p>+ ) : (+ <div className="mt-3 max-h-64 divide-y divide-surface-border overflow-y-auto rounded-lg border bg-background overscroll-contain">+ {editableMembers.map((member) => {+ const id = `agent-access-member-${member.user_id}`;+ return (+ <div+ key={member.user_id}+ className="flex items-center gap-3 px-3 py-3 hover:bg-surface-hover"+ >+ <Checkbox+ id={id}+ checked={draftMembers.includes(member.user_id)}+ onCheckedChange={(value) =>+ toggleMember(member.user_id, value === true)+ }+ />+ <label+ htmlFor={id}+ className="flex min-w-0 flex-1 cursor-pointer items-center gap-3"+ >+ <ActorAvatar+ actorType="member"+ actorId={member.user_id}+ size="sm"+ />+ <span className="min-w-0 flex-1 truncate text-sm">+ {member.name}+ </span>+ </label>+ </div>+ );+ })}+ </div>+ )}</div>- )}- </div>- {/* Team — reserved for a future release; shown disabled so the roadmap- is visible without being actionable. The emit logic already carries- team targets through so nothing is lost once teams ship. */}- <div className="mt-1 border-t pt-1">- <div className="flex items-center gap-1.5 px-2 py-1.5 text-sm text-muted-foreground opacity-60">- <UsersRound className="h-3.5 w-3.5 shrink-0" />- <span className="font-medium">{t(($) => $.access.team_title)}</span>- <span className="rounded bg-muted px-1 py-0.5 text-[10px] font-medium">- {t(($) => $.access.team_coming_soon)}- </span>+ {!hasSharedTarget ? (+ <p className="text-xs text-destructive" role="alert">+ {t(($) => $.access.shared_target_required)}+ </p>+ ) : null}++ {hasComposioAllowlist && persistedPrivate ? (+ <p className="border-l-2 border-warning pl-3 text-xs leading-5 text-muted-foreground">+ {t(($) => $.access.composio_switch_hint)}+ </p>+ ) : null}</div>+ ) : null}++ <div className="flex justify-end border-t border-surface-border px-4 py-3.5">+ <Button+ type="button"+ onClick={() => void save()}+ disabled={!dirty || saving || (!draftPrivate && !hasSharedTarget)}+ >+ {saving ? (+ <Loader2+ className="size-4 animate-spin motion-reduce:animate-none"+ aria-hidden="true"+ />+ ) : null}+ {tc(($) => $.save)}+ </Button></div>+ </fieldset>+ );+}- {showComposioHint && (- <div className="mx-1 mt-1 rounded-md bg-amber-500/10 px-2 py-1.5 text-xs text-amber-700 dark:text-amber-400">- {t(($) => $.access.composio_switch_hint)}- </div>- )}- </PropertyPicker>+function AccessChoice({+ name,+ value,+ icon: Icon,+ title,+ description,+ selected,+ onSelect,+}: {+ name: string;+ value: string;+ icon: typeof Lock;+ title: string;+ description: string;+ selected: boolean;+ onSelect: () => void;+}) {+ return (+ <label className="flex min-h-16 cursor-pointer items-start gap-3 px-4 py-3.5 transition-colors hover:bg-surface-hover">+ <input+ type="radio"+ name={name}+ value={value}+ checked={selected}+ onChange={onSelect}+ className="mt-2 size-4 shrink-0 accent-foreground"+ />+ <span className="mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground">+ <Icon className="size-4" aria-hidden="true" />+ </span>+ <span className="min-w-0 flex-1">+ <span className="block text-sm font-medium">{title}</span>+ <span className="mt-0.5 block text-xs leading-5 text-muted-foreground">+ {description}+ </span>+ </span>+ </label>);}diff --git a/packages/views/agents/components/inspector/model-picker.tsx b/packages/views/agents/components/inspector/model-picker.tsxindex dabb8b41ef..76f1046f67 100644--- a/packages/views/agents/components/inspector/model-picker.tsx+++ b/packages/views/agents/components/inspector/model-picker.tsx@@ -2,9 +2,10 @@import { useMemo, useState } from "react";import { useQuery } from "@tanstack/react-query";-import { Loader2, Plus } from "lucide-react";+import { ChevronDown, Cpu, Loader2, Plus } from "lucide-react";import { runtimeModelsOptions } from "@multica/core/runtimes";import { Input } from "@multica/ui/components/ui/input";+import { Label } from "@multica/ui/components/ui/label";import {PickerItem,PropertyPicker,@@ -30,6 +31,8 @@ export function ModelPicker({runtimeOnline,value,canEdit = true,+ variant = "chip",+ showLabel = true,onChange,}: {runtimeId: string | null;@@ -37,6 +40,8 @@ export function ModelPicker({value: string;/** When false, render a static read-only display and skip the popover. */canEdit?: boolean;+ variant?: "chip" | "field";+ showLabel?: boolean;onChange: (next: string) => Promise<void> | void;}) {const { t } = useT("agents");@@ -80,6 +85,23 @@ export function ModelPicker({};if (!supported && !modelsQuery.isLoading) {+ if (variant === "field") {+ const control = (+ <div className="flex min-h-10 items-center gap-2 rounded-lg border border-dashed border-input bg-input/50 px-3 text-sm text-muted-foreground">+ <Cpu className="h-4 w-4 shrink-0" aria-hidden="true" />+ <span className="truncate italic">+ {t(($) => $.pickers.model_managed_by_runtime)}+ </span>+ </div>+ );+ if (!showLabel) return control;+ return (+ <div className="flex min-w-0 flex-col">+ <Label>{t(($) => $.inspector.prop_model)}</Label>+ <div className="mt-1.5">{control}</div>+ </div>+ );+ }return (<span className="truncate italic text-muted-foreground">{t(($) => $.pickers.model_managed_by_runtime)}@@ -88,6 +110,21 @@ export function ModelPicker({}if (!canEdit) {+ if (variant === "field") {+ const control = (+ <div className="flex min-h-10 items-center gap-2 rounded-lg border border-input bg-input/50 px-3 text-sm text-muted-foreground">+ <Cpu className="h-4 w-4 shrink-0" aria-hidden="true" />+ <span className="min-w-0 truncate font-mono">{triggerLabel}</span>+ </div>+ );+ if (!showLabel) return control;+ return (+ <div className="flex min-w-0 flex-col">+ <Label>{t(($) => $.inspector.prop_model)}</Label>+ <div className="mt-1.5">{control}</div>+ </div>+ );+ }return (<spanclassName="min-w-0 truncate px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground"@@ -98,29 +135,62 @@ export function ModelPicker({);}- return (+ const picker = (<PropertyPickeropen={open}onOpenChange={setOpen}- width="w-auto min-w-[16rem] max-w-md"+ width={+ variant === "field"+ ? "w-[var(--anchor-width)] min-w-[16rem] max-w-md"+ : "w-auto min-w-[16rem] max-w-md"+ }align="start"tooltip={triggerTitle}triggerRender={<buttontype="button"- className={CHIP_CLASS}+ className={+ variant === "field"+ ? `${showLabel ? "mt-1.5 " : ""}flex min-h-10 w-full min-w-0 items-center gap-2 rounded-lg border border-input bg-transparent px-3 text-left text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`+ : CHIP_CLASS+ }aria-label={triggerTitle}/>}trigger={- <span className="min-w-0 truncate font-mono text-[11px]">- {triggerLabel}- </span>+ <>+ {variant === "field" ? (+ <Cpu+ className="h-4 w-4 shrink-0 text-muted-foreground"+ aria-hidden="true"+ />+ ) : null}+ <span+ className={+ variant === "field"+ ? "min-w-0 flex-1 truncate font-mono"+ : "min-w-0 truncate font-mono text-[11px]"+ }+ >+ {triggerLabel}+ </span>+ {variant === "field" ? (+ <ChevronDown+ className={`h-4 w-4 shrink-0 text-muted-foreground transition-transform ${+ open ? "rotate-180" : ""+ }`}+ aria-hidden="true"+ />+ ) : null}+ </>}header={<div className="p-1.5"><InputautoFocus+ name="agent-model-search"+ autoComplete="off"+ aria-label={t(($) => $.pickers.model_search_placeholder)}placeholder={t(($) => $.pickers.model_search_placeholder)}value={search}onChange={(e) => setSearch(e.target.value)}@@ -131,7 +201,10 @@ export function ModelPicker({>{modelsQuery.isLoading && (<div className="flex items-center gap-2 p-3 text-xs text-muted-foreground">- <Loader2 className="h-3 w-3 animate-spin" />+ <Loader2+ className="h-3 w-3 animate-spin motion-reduce:animate-none"+ aria-hidden="true"+ />{t(($) => $.pickers.model_discovering)}</div>)}@@ -196,4 +269,16 @@ export function ModelPicker({)}</PropertyPicker>);++ if (variant === "field") {+ if (!showLabel) return picker;+ return (+ <div className="flex min-w-0 flex-col">+ <Label>{t(($) => $.inspector.prop_model)}</Label>+ {picker}+ </div>+ );+ }++ return picker;}diff --git a/packages/views/agents/components/inspector/runtime-picker.tsx b/packages/views/agents/components/inspector/runtime-picker.tsxindex 8cdd800c73..5dd2f2f3db 100644--- a/packages/views/agents/components/inspector/runtime-picker.tsx+++ b/packages/views/agents/components/inspector/runtime-picker.tsx@@ -1,7 +1,7 @@"use client";import { useMemo, useState } from "react";-import { Cloud, Lock, Monitor } from "lucide-react";+import { ChevronDown, Cloud, Lock, Monitor } from "lucide-react";import type { AgentRuntime, MemberWithUser } from "@multica/core/types";import { runtimeDisplayName } from "@multica/core/runtimes";import { ActorAvatar } from "../../../common/actor-avatar";@@ -10,6 +10,7 @@ import {PropertyPicker,} from "../../../issues/components/pickers";import { ProviderLogo } from "../../../runtimes/components/provider-logo";+import { Label } from "@multica/ui/components/ui/label";import { CHIP_CLASS } from "./chip";import { useT } from "../../../i18n";@@ -27,6 +28,8 @@ export function RuntimePicker({members,currentUserId,canEdit = true,+ variant = "chip",+ showLabel = true,onChange,}: {value: string;@@ -35,6 +38,8 @@ export function RuntimePicker({currentUserId: string | null;/** When false, render a static read-only display and skip the popover. */canEdit?: boolean;+ variant?: "chip" | "field";+ showLabel?: boolean;onChange: (runtimeId: string) => Promise<void> | void;}) {const { t } = useT("agents");@@ -72,6 +77,32 @@ export function RuntimePicker({if (!canEdit) {const isOnline = selected?.status === "online";+ const valueLabel = selected+ ? runtimeDisplayName(selected)+ : t(($) => $.pickers.runtime_none);+ if (variant === "field") {+ const control = (+ <div className="flex min-h-10 items-center gap-2 rounded-lg border border-input bg-input/50 px-3 text-sm text-muted-foreground">+ <Icon className="h-4 w-4 shrink-0" aria-hidden="true" />+ <span className="min-w-0 flex-1 truncate">{valueLabel}</span>+ {selected ? (+ <span+ className={`h-2 w-2 shrink-0 rounded-full ${+ isOnline ? "bg-success" : "bg-muted-foreground/40"+ }`}+ aria-hidden="true"+ />+ ) : null}+ </div>+ );+ if (!showLabel) return control;+ return (+ <div className="flex min-w-0 flex-col">+ <Label>{t(($) => $.inspector.prop_runtime)}</Label>+ <div className="mt-1.5">{control}</div>+ </div>+ );+ }return (<span className="inline-flex min-w-0 items-center gap-1.5 px-1.5 py-0.5 text-xs text-muted-foreground"><Icon className="h-3 w-3 shrink-0" />@@ -114,24 +145,47 @@ export function RuntimePicker({if (id !== value) await onChange(id);};- return (+ const picker = (<PropertyPickeropen={open}onOpenChange={setOpen}- width="w-auto min-w-[18rem] max-w-md"+ width={+ variant === "field"+ ? "w-[var(--anchor-width)] min-w-[18rem] max-w-md"+ : "w-auto min-w-[18rem] max-w-md"+ }align="start"tooltip={triggerTitle}triggerRender={<buttontype="button"- className={CHIP_CLASS}+ className={+ variant === "field"+ ? `${showLabel ? "mt-1.5 " : ""}flex min-h-10 w-full min-w-0 items-center gap-2 rounded-lg border border-input bg-transparent px-3 text-left text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`+ : CHIP_CLASS+ }aria-label={triggerTitle}/>}trigger={<>- <Icon className="h-3 w-3 shrink-0 text-muted-foreground" />- <span className="min-w-0 truncate font-mono">{triggerLabel}</span>+ <Icon+ className={+ variant === "field"+ ? "h-4 w-4 shrink-0 text-muted-foreground"+ : "h-3 w-3 shrink-0 text-muted-foreground"+ }+ aria-hidden="true"+ />+ <span+ className={+ variant === "field"+ ? "min-w-0 flex-1 truncate"+ : "min-w-0 truncate font-mono"+ }+ >+ {triggerLabel}+ </span>{selected && (<spanclassName={`ml-auto h-1.5 w-1.5 shrink-0 rounded-full ${@@ -139,6 +193,14 @@ export function RuntimePicker({}`}/>)}+ {variant === "field" ? (+ <ChevronDown+ className={`h-4 w-4 shrink-0 text-muted-foreground transition-transform ${+ open ? "rotate-180" : ""+ }`}+ aria-hidden="true"+ />+ ) : null}</>}header={@@ -244,6 +306,18 @@ export function RuntimePicker({)}</PropertyPicker>);++ if (variant === "field") {+ if (!showLabel) return picker;+ return (+ <div className="flex min-w-0 flex-col">+ <Label>{t(($) => $.inspector.prop_runtime)}</Label>+ {picker}+ </div>+ );+ }++ return picker;}function FilterButton({diff --git a/packages/views/agents/components/inspector/thinking-picker.tsx b/packages/views/agents/components/inspector/thinking-picker.tsxindex 157fa92016..2304461752 100644--- a/packages/views/agents/components/inspector/thinking-picker.tsx+++ b/packages/views/agents/components/inspector/thinking-picker.tsx@@ -1,7 +1,9 @@"use client";import { useState } from "react";+import { Brain, ChevronDown } from "lucide-react";import type { RuntimeModelThinkingLevel } from "@multica/core/types";+import { Label } from "@multica/ui/components/ui/label";import {PickerItem,PropertyPicker,@@ -27,6 +29,8 @@ export function ThinkingPicker({value,levels,canEdit = true,+ variant = "chip",+ showLabel = true,onChange,}: {/** Persisted thinking_level — "" means "follow local CLI config". */@@ -38,6 +42,8 @@ export function ThinkingPicker({levels: RuntimeModelThinkingLevel[];/** When false, render a static read-only display and skip the popover. */canEdit?: boolean;+ variant?: "chip" | "field";+ showLabel?: boolean;onChange: (next: string) => Promise<void> | void;}) {const { t } = useT("agents");@@ -61,6 +67,21 @@ export function ThinkingPicker({};if (!canEdit) {+ if (variant === "field") {+ const control = (+ <div className="flex min-h-10 items-center gap-2 rounded-lg border border-input bg-input/50 px-3 text-sm text-muted-foreground">+ <Brain className="h-4 w-4 shrink-0" aria-hidden="true" />+ <span className="min-w-0 truncate">{triggerLabel}</span>+ </div>+ );+ if (!showLabel) return control;+ return (+ <div className="flex min-w-0 flex-col">+ <Label>{t(($) => $.inspector.prop_thinking)}</Label>+ <div className="mt-1.5">{control}</div>+ </div>+ );+ }return (<spanclassName="min-w-0 truncate px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground"@@ -71,24 +92,54 @@ export function ThinkingPicker({);}- return (+ const picker = (<PropertyPickeropen={open}onOpenChange={setOpen}- width="w-auto min-w-[14rem] max-w-md"+ width={+ variant === "field"+ ? "w-[var(--anchor-width)] min-w-[14rem] max-w-md"+ : "w-auto min-w-[14rem] max-w-md"+ }align="start"tooltip={triggerTitle}triggerRender={<buttontype="button"- className={CHIP_CLASS}+ className={+ variant === "field"+ ? `${showLabel ? "mt-1.5 " : ""}flex min-h-10 w-full min-w-0 items-center gap-2 rounded-lg border border-input bg-transparent px-3 text-left text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`+ : CHIP_CLASS+ }aria-label={triggerTitle}/>}trigger={- <span className="min-w-0 truncate font-mono text-[11px]">- {triggerLabel}- </span>+ <>+ {variant === "field" ? (+ <Brain+ className="h-4 w-4 shrink-0 text-muted-foreground"+ aria-hidden="true"+ />+ ) : null}+ <span+ className={+ variant === "field"+ ? "min-w-0 flex-1 truncate"+ : "min-w-0 truncate font-mono text-[11px]"+ }+ >+ {triggerLabel}+ </span>+ {variant === "field" ? (+ <ChevronDown+ className={`h-4 w-4 shrink-0 text-muted-foreground transition-transform ${+ open ? "rotate-180" : ""+ }`}+ aria-hidden="true"+ />+ ) : null}+ </>}>{levels.map((l) => (@@ -131,4 +182,16 @@ export function ThinkingPicker({)}</PropertyPicker>);++ if (variant === "field") {+ if (!showLabel) return picker;+ return (+ <div className="flex min-w-0 flex-col">+ <Label>{t(($) => $.inspector.prop_thinking)}</Label>+ {picker}+ </div>+ );+ }++ return picker;}diff --git a/packages/views/agents/components/inspector/thinking-prop-row.tsx b/packages/views/agents/components/inspector/thinking-prop-row.tsxindex 8a8df8806a..931173f63f 100644--- a/packages/views/agents/components/inspector/thinking-prop-row.tsx+++ b/packages/views/agents/components/inspector/thinking-prop-row.tsx@@ -1,9 +1,11 @@"use client";import { useQuery } from "@tanstack/react-query";+import type { ReactNode } from "react";import type { RuntimeModel } from "@multica/core/types";import { runtimeModelsOptions } from "@multica/core/runtimes";import { PropRow } from "../../../common/prop-row";+import { SettingsRow } from "../../../settings/components/settings-layout";import { useT } from "../../../i18n";import { ThinkingPicker } from "./thinking-picker";@@ -66,6 +68,49 @@ export function ThinkingPropRow({);}+/** Full-width counterpart used by the General settings form. */+export function ThinkingSettingField({+ label,+ runtimeId,+ runtimeOnline,+ provider,+ model,+ value,+ canEdit,+ onChange,+}: {+ label: ReactNode;+ runtimeId: string | null;+ runtimeOnline: boolean;+ provider: string;+ model: string;+ value: string;+ canEdit: boolean;+ onChange: (next: string) => Promise<void> | void;+}) {+ const modelsQuery = useQuery(+ runtimeModelsOptions(runtimeOnline ? runtimeId : null),+ );+ const models = modelsQuery.data?.models ?? [];+ const entry = pickModelEntry(models, model, provider);+ const levels = entry?.thinking?.supported_levels ?? [];++ if (levels.length === 0 && !value) return null;++ return (+ <SettingsRow label={label} controlClassName="sm:w-80">+ <ThinkingPicker+ variant="field"+ showLabel={false}+ value={value}+ levels={levels}+ canEdit={canEdit}+ onChange={onChange}+ />+ </SettingsRow>+ );+}+function pickModelEntry(models: RuntimeModel[],model: string,diff --git a/packages/views/agents/components/tabs/activity-tab.tsx b/packages/views/agents/components/tabs/activity-tab.tsxindex a82fb0656f..f6ae1c1916 100644--- a/packages/views/agents/components/tabs/activity-tab.tsx+++ b/packages/views/agents/components/tabs/activity-tab.tsx@@ -46,11 +46,12 @@ const THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1000;// scannable, then "Show more" reveals 20 at a time. Tasks are already// fully cached client-side (one listAgentTasks for the whole agent), so// "more" is a pure state flip — zero extra fetches.-const RECENT_INITIAL = 5;+const RECENT_INITIAL = 10;const RECENT_PAGE = 20;interface ActivityTabProps {agent: Agent;+ showPerformance?: boolean;}/**@@ -66,7 +67,7 @@ interface ActivityTabProps {* the workspace 7d activity buckets for the trend), so opening this tab* adds no extra fetches once the page is hydrated.*/-export function ActivityTab({ agent }: ActivityTabProps) {+export function ActivityTab({ agent, showPerformance = true }: ActivityTabProps) {const wsId = useWorkspaceId();const { data: snapshot = [] } = useQuery(agentTaskSnapshotOptions(wsId));@@ -83,14 +84,27 @@ export function ActivityTab({ agent }: ActivityTabProps) {const isWorkflowTask = (t: AgentTask) => !t.chat_session_id;const activeTasks = useMemo(() => {- return snapshot.filter(- (t) =>- t.agent_id === agent.id &&- isWorkflowTask(t) &&- (t.status === "running" ||- t.status === "queued" ||- t.status === "dispatched"),- );+ const statusRank: Partial<Record<AgentTask["status"], number>> = {+ running: 0,+ dispatched: 1,+ waiting_local_directory: 2,+ queued: 3,+ };+ return snapshot+ .filter(+ (t) =>+ t.agent_id === agent.id &&+ isWorkflowTask(t) &&+ (t.status === "running" ||+ t.status === "queued" ||+ t.status === "dispatched" ||+ t.status === "waiting_local_directory"),+ )+ .sort(+ (a, b) =>+ (statusRank[a.status] ?? 99) - (statusRank[b.status] ?? 99) ||+ new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),+ );}, [snapshot, agent.id]);// Most recent terminal tasks. Includes cancelled — users searching@@ -151,9 +165,11 @@ export function ActivityTab({ agent }: ActivityTabProps) {}, [issueQueries, issueIds]);return (- <div className="flex flex-col gap-4 p-6">+ <div className="flex min-w-0 flex-col gap-6"><NowSection tasks={activeTasks} issueMap={issueMap} agent={agent} />- <Last30dSection activity={activity} avgDurationMs={avgDurationMs} />+ {showPerformance && (+ <Last30dSection activity={activity} avgDurationMs={avgDurationMs} />+ )}<RecentWorkSectiontasks={recentTasks}totalCount={recentTasksAll.length}@@ -168,6 +184,96 @@ export function ActivityTab({ agent }: ActivityTabProps) {);}+/** Compact performance context for the Overview sidebar. Kept separate from+ * the work list so metrics never outrank current tasks or failures. */+export function AgentPerformanceSummary({ agent }: { agent: Agent }) {+ const { t } = useT("agents");+ const wsId = useWorkspaceId();+ const { data: agentTasks = [] } = useQuery(+ agentTasksOptions(wsId, agent.id),+ );+ const { byAgent: activityMap } = useWorkspaceActivityMap(wsId);+ const activity = activityMap.get(agent.id);+ const summary = summarizeActivityWindow(activity, 30);+ const avgDurationMs = useMemo(+ () => deriveAvgDurationLast30d(agentTasks, Date.now()),+ [agentTasks],+ );+ const successPct =+ summary.totalRuns > 0+ ? Math.round(+ ((summary.totalRuns - summary.totalFailed) / summary.totalRuns) *+ 100,+ )+ : 100;++ return (+ <section className="mt-5 border-t pt-5">+ <h2 className="text-sm font-medium">+ {t(($) => $.tab_body.activity.section_last_30d)}+ </h2>+ {summary.totalRuns === 0 ? (+ <p className="mt-3 text-xs text-muted-foreground">+ {t(($) => $.tab_body.activity.empty_30d)}+ </p>+ ) : (+ <>+ <div className="mt-4 grid grid-cols-2 gap-x-4 gap-y-3">+ <Metric+ value={String(summary.totalRuns)}+ label={t(($) => $.tab_body.activity.runs, {+ count: summary.totalRuns,+ })}+ />+ <Metric+ value={`${successPct}%`}+ label={t(($) => $.tab_body.activity.success_label)}+ />+ <Metric+ value={avgDurationMs > 0 ? formatDurationMs(avgDurationMs) : "—"}+ label={t(($) => $.tab_body.activity.avg_duration_label)}+ />+ <Metric+ value={String(summary.totalFailed)}+ label={t(($) => $.tab_body.activity.failed_label)}+ destructive={summary.totalFailed > 0}+ />+ </div>+ <Sparkline+ buckets={summary.buckets}+ width={250}+ height={36}+ className="mt-4 h-9 w-full"+ />+ </>+ )}+ </section>+ );+}++function Metric({+ value,+ label,+ destructive = false,+}: {+ value: string;+ label: string;+ destructive?: boolean;+}) {+ return (+ <div className="min-w-0">+ <div+ className={`text-lg font-semibold tabular-nums ${+ destructive ? "text-destructive" : "text-foreground"+ }`}+ >+ {value}+ </div>+ <div className="truncate text-[11px] text-muted-foreground">{label}</div>+ </div>+ );+}+function NowSection({tasks,issueMap,@@ -326,7 +432,13 @@ function TaskList({agent: Agent;}) {return (- <div className="space-y-1.5">+ <div+ className={+ timeMode === "completed"+ ? "overflow-hidden rounded-lg border divide-y"+ : "space-y-2"+ }+ >{tasks.map((task) => (<TaskRowkey={task.id}@@ -442,16 +554,20 @@ function TaskRow({if (dur > 0) durationText = formatDurationMs(dur);}- const rowClass = `group flex items-center gap-3 rounded-md border px-3 py-2.5 ${- isRunning ? "border-brand/40 bg-brand/5" : ""- }`;+ const rowClass =+ timeMode === "completed"+ ? "group flex items-center gap-3 px-3 py-3 transition-colors hover:bg-muted/30"+ : `group flex items-center gap-3 rounded-md border px-3 py-3 ${+ isRunning ? "border-brand/40 bg-brand/5" : ""+ }`;return (<div className={rowClass}><IconclassName={`h-4 w-4 shrink-0 ${cfg.color} ${- isRunning ? "animate-spin" : ""+ isRunning ? "animate-spin motion-reduce:animate-none" : ""}`}+ aria-hidden="true"/><div className="min-w-0 flex-1"><div className="flex items-center gap-1.5">@@ -500,6 +616,10 @@ function TaskRow({)}</div><div className="mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground">+ <span className={cfg.color}>+ {taskStatusLabel(task.status, t)}+ </span>+ <Sep /><span>{timeText}</span>{durationText && (<>@@ -528,7 +648,7 @@ function TaskRow({aria-label={t(($) => $.tab_body.activity.open_issue_aria)}className="flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors">- <ArrowUpRight className="h-3.5 w-3.5" />+ <ArrowUpRight className="h-3.5 w-3.5" aria-hidden="true" /></TooltipTrigger><TooltipContent>{t(($) => $.tab_body.activity.open_issue_tooltip)}</TooltipContent></Tooltip>@@ -554,7 +674,7 @@ function TaskRow({}className="flex items-center justify-center rounded p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:cursor-not-allowed disabled:opacity-50">- <X className="h-3.5 w-3.5" />+ <X className="h-3.5 w-3.5" aria-hidden="true" /></TooltipTrigger><TooltipContent>{cancelling ? t(($) => $.tab_body.activity.cancelling_tooltip) : t(($) => $.tab_body.activity.cancel_task_tooltip)}@@ -576,11 +696,11 @@ function Section({children: ReactNode;}) {return (- <section className="flex flex-col gap-3 rounded-lg border bg-background p-5">+ <section className="flex flex-col gap-3 border-b pb-6 last:border-b-0 last:pb-0"><div className="flex items-baseline gap-2">- <h3 className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">+ <h2 className="text-sm font-semibold text-foreground">{title}- </h3>+ </h2><span className="text-[11px] text-muted-foreground/70">{subtitle}</span></div>{children}@@ -602,6 +722,25 @@ function Sep() {type AgentsT = ReturnType<typeof useT<"agents">>["t"];type TimeAgoFn = (dateStr: string) => string;+function taskStatusLabel(status: AgentTask["status"], t: AgentsT): string {+ switch (status) {+ case "queued":+ return t(($) => $.tab_body.activity.status.queued);+ case "dispatched":+ return t(($) => $.tab_body.activity.status.dispatched);+ case "waiting_local_directory":+ return t(($) => $.tab_body.activity.status.waiting_local_directory);+ case "running":+ return t(($) => $.tab_body.activity.status.running);+ case "completed":+ return t(($) => $.tab_body.activity.status.completed);+ case "failed":+ return t(($) => $.tab_body.activity.status.failed);+ case "cancelled":+ return t(($) => $.tab_body.activity.status.cancelled);+ }+}+function activeTaskTimeText(task: AgentTask, t: AgentsT, timeAgo: TimeAgoFn): string {if (task.status === "running" && task.started_at) {return t(($) => $.tab_body.activity.started_prefix, { when: timeAgo(task.started_at) });diff --git a/packages/views/agents/components/tabs/custom-args-tab.test.tsx b/packages/views/agents/components/tabs/custom-args-tab.test.tsxnew file mode 100644index 0000000000..654dbd1cd2--- /dev/null+++ b/packages/views/agents/components/tabs/custom-args-tab.test.tsx@@ -0,0 +1,124 @@+// @vitest-environment jsdom++import { beforeEach, describe, expect, it, vi } from "vitest";+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import type { Agent, RuntimeDevice } from "@multica/core/types";+import { I18nProvider } from "@multica/core/i18n/react";+import enCommon from "../../../locales/en/common.json";+import enAgents from "../../../locales/en/agents.json";++const TEST_RESOURCES = { en: { common: enCommon, agents: enAgents } };++vi.mock("sonner", () => ({+ toast: {+ error: vi.fn(),+ success: vi.fn(),+ },+}));++import { CustomArgsTab } from "./custom-args-tab";++const baseAgent: Agent = {+ id: "agent-1",+ workspace_id: "ws-1",+ runtime_id: "runtime-1",+ name: "Agent",+ description: "",+ instructions: "",+ avatar_url: null,+ runtime_mode: "local",+ runtime_config: {},+ custom_args: ["--profile", "research"],+ visibility: "workspace",+ permission_mode: "public_to",+ invocation_targets: [{ target_type: "workspace", target_id: null }],+ status: "idle",+ max_concurrent_tasks: 1,+ model: "",+ owner_id: "user-1",+ skills: [],+ created_at: "2026-05-28T00:00:00Z",+ updated_at: "2026-05-28T00:00:00Z",+ archived_at: null,+ archived_by: null,+};++const runtimeDevice = {+ launch_header: "codex app-server",+} as RuntimeDevice;++function renderTab(+ overrides: Partial<Agent> = {},+ onSave = vi.fn().mockResolvedValue(undefined),+) {+ const result = render(+ <I18nProvider locale="en" resources={TEST_RESOURCES}>+ <CustomArgsTab+ agent={{ ...baseAgent, ...overrides }}+ runtimeDevice={runtimeDevice}+ onSave={onSave}+ />+ </I18nProvider>,+ );++ return { ...result, onSave };+}++describe("CustomArgsTab", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ });++ it("renders configured arguments as a list, not persistent inputs", () => {+ renderTab();++ expect(screen.getByText("--profile")).toBeInTheDocument();+ expect(screen.getByText("research")).toBeInTheDocument();+ expect(screen.queryByRole("textbox")).not.toBeInTheDocument();+ expect(screen.getByText("codex app-server --profile research")).toBeInTheDocument();+ });++ it("uses one editor to add one argument token", async () => {+ const user = userEvent.setup();+ renderTab({ custom_args: [] });++ await user.click(screen.getByRole("button", { name: /add argument/i }));+ const input = screen.getByRole("textbox", { name: /new argument/i });+ await user.type(input, "value with spaces");+ await user.click(screen.getByRole("button", { name: /^add$/i }));++ expect(screen.queryByRole("textbox")).not.toBeInTheDocument();+ expect(screen.getByText("value with spaces")).toBeInTheDocument();+ });++ it("edits a list item in place with the same single editor", async () => {+ const user = userEvent.setup();+ renderTab();++ await user.click(screen.getByRole("button", { name: /edit argument 1/i }));+ const input = screen.getByRole("textbox", { name: /argument 1/i });+ await user.clear(input);+ await user.type(input, "--model");+ await user.click(screen.getByRole("button", { name: /update/i }));++ expect(screen.queryByRole("textbox")).not.toBeInTheDocument();+ expect(screen.getByText("--model")).toBeInTheDocument();+ expect(screen.queryByText("--profile")).not.toBeInTheDocument();+ });++ it("preserves spaces inside one token when saving", async () => {+ const user = userEvent.setup();+ const { onSave } = renderTab({ custom_args: [] });++ await user.click(screen.getByRole("button", { name: /add argument/i }));+ await user.type(+ screen.getByRole("textbox", { name: /new argument/i }),+ "value with spaces",+ );+ await user.click(screen.getByRole("button", { name: /^add$/i }));+ await user.click(screen.getByRole("button", { name: /^save$/i }));++ expect(onSave).toHaveBeenCalledWith({ custom_args: ["value with spaces"] });+ });+});diff --git a/packages/views/agents/components/tabs/custom-args-tab.tsx b/packages/views/agents/components/tabs/custom-args-tab.tsxindex 13bd714e04..7e1dbdbd52 100644--- a/packages/views/agents/components/tabs/custom-args-tab.tsx+++ b/packages/views/agents/components/tabs/custom-args-tab.tsx@@ -1,30 +1,45 @@"use client";-import { useEffect, useState } from "react";-import { Loader2, Plus, Save, Trash2 } from "lucide-react";+import { useEffect, useRef, useState } from "react";+import {+ Loader2,+ Pencil,+ Plus,+ Save,+ Terminal,+ Trash2,+} from "lucide-react";import type { Agent, RuntimeDevice } from "@multica/core/types";import { createSafeId } from "@multica/core/utils";import { Button } from "@multica/ui/components/ui/button";import { Input } from "@multica/ui/components/ui/input";import { toast } from "sonner";import { useT } from "../../../i18n";+import {+ SettingsCard,+ SettingsSection,+} from "../../../settings/components/settings-layout";interface ArgEntry {id: string;value: string;}+type EditorState =+ | { kind: "add" }+ | { kind: "edit"; entryId: string }+ | null;+function argsToEntries(args: string[]): ArgEntry[] {return args.map((value) => ({ id: createSafeId(), value }));}-// Each row may contain a single arg ("--model") or several space-separated-// tokens ("--model claude-sonnet-4"). We split on whitespace so users can-// paste multi-token flags into one row without having to break them apart-// manually. The placeholder + helper text explain this so users aren't-// surprised when "--flag value" lands as two args at the back-end.function entriesToArgs(entries: ArgEntry[]): string[] {- return entries.flatMap((e) => e.value.trim().split(/\s+/)).filter(Boolean);+ return entries.map((entry) => entry.value.trim()).filter(Boolean);+}++function formatArgForPreview(value: string): string {+ return /\s/.test(value) ? JSON.stringify(value) : value;}export function CustomArgsTab({@@ -42,7 +57,10 @@ export function CustomArgsTab({const [entries, setEntries] = useState<ArgEntry[]>(argsToEntries(agent.custom_args ?? []),);+ const [editor, setEditor] = useState<EditorState>(null);+ const [editorValue, setEditorValue] = useState("");const [saving, setSaving] = useState(false);+ const editorInputRef = useRef<HTMLInputElement>(null);const currentArgs = entriesToArgs(entries);const originalArgs = agent.custom_args ?? [];@@ -52,18 +70,44 @@ export function CustomArgsTab({onDirtyChange?.(dirty);}, [dirty, onDirtyChange]);- const addEntry = () => {- setEntries([...entries, { id: createSafeId(), value: "" }]);+ useEffect(() => {+ if (editor) editorInputRef.current?.focus();+ }, [editor]);++ const startAdding = () => {+ setEditor({ kind: "add" });+ setEditorValue("");+ };++ const startEditing = (entry: ArgEntry) => {+ setEditor({ kind: "edit", entryId: entry.id });+ setEditorValue(entry.value);+ };++ const closeEditor = () => {+ setEditor(null);+ setEditorValue("");};- const removeEntry = (index: number) => {- setEntries(entries.filter((_, i) => i !== index));+ const commitEditor = () => {+ const value = editorValue.trim();+ if (!editor || !value) return;++ if (editor.kind === "add") {+ setEntries((current) => [...current, { id: createSafeId(), value }]);+ } else {+ setEntries((current) =>+ current.map((entry) =>+ entry.id === editor.entryId ? { ...entry, value } : entry,+ ),+ );+ }+ closeEditor();};- const updateEntry = (index: number, value: string) => {- setEntries(- entries.map((entry, i) => (i === index ? { ...entry, value } : entry)),- );+ const removeEntry = (entryId: string) => {+ setEntries((current) => current.filter((entry) => entry.id !== entryId));+ if (editor?.kind === "edit" && editor.entryId === entryId) closeEditor();};const handleSave = async () => {@@ -82,69 +126,178 @@ export function CustomArgsTab({}};+ const renderEditor = (index?: number) => (+ <form+ className="rounded-lg border border-input bg-background p-2.5 shadow-xs"+ onSubmit={(event) => {+ event.preventDefault();+ commitEditor();+ }}+ onKeyDown={(event) => {+ if (event.key === "Escape") closeEditor();+ }}+ >+ <Input+ ref={editorInputRef}+ name={editor?.kind === "add" ? "agent-custom-arg-new" : `agent-custom-arg-${index}`}+ autoComplete="off"+ spellCheck={false}+ value={editorValue}+ onChange={(event) => setEditorValue(event.target.value)}+ placeholder={t(($) => $.tab_body.custom_args.input_placeholder)}+ aria-label={+ editor?.kind === "add"+ ? t(($) => $.tab_body.custom_args.new_argument_aria)+ : t(($) => $.tab_body.custom_args.input_aria, { index })+ }+ className="font-mono text-xs"+ />+ <div className="mt-2 flex justify-end gap-2">+ <Button type="button" variant="ghost" size="sm" onClick={closeEditor}>+ {t(($) => $.tab_body.custom_args.cancel_action)}+ </Button>+ <Button type="submit" size="sm" disabled={!editorValue.trim()}>+ {editor?.kind === "add"+ ? t(($) => $.tab_body.custom_args.add_action)+ : t(($) => $.tab_body.custom_args.update_action)}+ </Button>+ </div>+ </form>+ );+const launchHeader = runtimeDevice?.launch_header;+ const launchCommand = launchHeader+ ? [launchHeader, ...currentArgs.map(formatArgForPreview)].join(" ")+ : null;return (- <div className="space-y-4">- <div className="flex items-start justify-between gap-3">- <div className="space-y-1">- <p className="text-xs text-muted-foreground">- {t(($) => $.tab_body.custom_args.intro)}- </p>- {launchHeader && (- <p className="text-xs text-muted-foreground">- {t(($) => $.tab_body.custom_args.launch_mode_prefix)}- <code className="rounded bg-muted px-1 py-0.5 font-mono text-[11px]">- {launchHeader} {t(($) => $.tab_body.custom_args.launch_mode_args_placeholder)}+ <div className="space-y-6">+ <p className="max-w-2xl text-pretty text-sm leading-6 text-muted-foreground">+ {t(($) => $.tab_body.custom_args.intro)}+ </p>++ <SettingsSection+ title={t(($) => $.tab_body.custom_args.arguments_label)}+ description={t(($) => $.tab_body.custom_args.arguments_description)}+ action={+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={startAdding}+ disabled={editor !== null}+ >+ <Plus className="size-3.5" aria-hidden="true" />+ {t(($) => $.tab_body.custom_args.add_argument_action)}+ </Button>+ }+ >+ <SettingsCard>+ <div className="space-y-2 p-3">+ {entries.length === 0 && editor?.kind !== "add" ? (+ <div className="flex min-h-28 flex-col items-center justify-center px-4 py-6 text-center">+ <span className="flex size-9 items-center justify-center rounded-lg bg-muted text-muted-foreground">+ <Terminal className="size-4" aria-hidden="true" />+ </span>+ <p className="mt-3 text-sm font-medium">+ {t(($) => $.tab_body.custom_args.empty_title)}+ </p>+ <p className="mt-1 max-w-sm text-xs leading-5 text-muted-foreground">+ {t(($) => $.tab_body.custom_args.empty_hint)}+ </p>+ </div>+ ) : null}++ <div role="list" className="space-y-2">+ {entries.map((entry, index) => (+ <div key={entry.id} role="listitem">+ {editor?.kind === "edit" && editor.entryId === entry.id ? (+ renderEditor(index + 1)+ ) : (+ <div className="group flex min-w-0 items-center gap-3 rounded-lg bg-muted/45 px-3 py-2.5 transition-colors hover:bg-muted/70">+ <span className="w-5 shrink-0 text-center text-[11px] font-medium tabular-nums text-muted-foreground">+ {index + 1}+ </span>+ <code+ className="min-w-0 flex-1 break-all font-mono text-xs leading-5"+ translate="no"+ >+ {entry.value}+ </code>+ <div className="flex shrink-0 items-center gap-0.5">+ <Button+ type="button"+ variant="ghost"+ size="icon-sm"+ onClick={() => startEditing(entry)}+ disabled={editor !== null}+ aria-label={t(($) => $.tab_body.custom_args.edit_aria, {+ index: index + 1,+ })}+ >+ <Pencil className="size-3.5" aria-hidden="true" />+ </Button>+ <Button+ type="button"+ variant="ghost"+ size="icon-sm"+ onClick={() => removeEntry(entry.id)}+ disabled={editor !== null}+ className="text-muted-foreground hover:text-destructive"+ aria-label={t(($) => $.tab_body.custom_args.remove_aria, {+ index: index + 1,+ })}+ >+ <Trash2 className="size-3.5" aria-hidden="true" />+ </Button>+ </div>+ </div>+ )}+ </div>+ ))}+ </div>++ {editor?.kind === "add" ? renderEditor() : null}+ </div>+ </SettingsCard>+ </SettingsSection>++ {launchCommand ? (+ <SettingsSection title={t(($) => $.tab_body.custom_args.command_preview_label)}>+ <SettingsCard>+ <div className="flex min-w-0 items-start gap-3 p-4">+ <span className="flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground">+ <Terminal className="size-3.5" aria-hidden="true" />+ </span>+ <code+ className="min-w-0 break-all pt-1.5 font-mono text-xs leading-5"+ translate="no"+ >+ {launchCommand}</code>- </p>- )}- </div>+ </div>+ </SettingsCard>+ </SettingsSection>+ ) : null}++ <div className="flex items-center justify-end gap-3 pt-1">+ {dirty ? (+ <span role="status" className="text-xs text-muted-foreground">+ {t(($) => $.tab_body.common.unsaved_changes)}+ </span>+ ) : null}<Button- type="button"- variant="outline"+ onClick={handleSave}+ disabled={!dirty || saving || editor !== null}size="sm"- onClick={addEntry}- className="shrink-0">- <Plus className="h-3 w-3" />- {t(($) => $.tab_body.common.add)}- </Button>- </div>-- {entries.length > 0 && (- <div className="space-y-2">- {entries.map((entry, index) => (- <div key={entry.id} className="flex items-center gap-2">- <Input- value={entry.value}- onChange={(e) => updateEntry(index, e.target.value)}- placeholder={t(($) => $.tab_body.custom_args.input_placeholder)}- className="flex-1 font-mono text-xs"- />- <Button- variant="ghost"- size="icon-sm"- onClick={() => removeEntry(index)}- className="text-muted-foreground hover:text-destructive"- aria-label={t(($) => $.tab_body.custom_args.remove_aria)}- >- <Trash2 className="h-3.5 w-3.5" />- </Button>- </div>- ))}- </div>- )}-- <div className="flex items-center justify-end gap-3">- {dirty && (- <span className="text-xs text-muted-foreground">{t(($) => $.tab_body.common.unsaved_changes)}</span>- )}- <Button onClick={handleSave} disabled={!dirty || saving} size="sm">{saving ? (- <Loader2 className="h-3.5 w-3.5 animate-spin" />+ <Loader2+ className="size-3.5 animate-spin motion-reduce:animate-none"+ aria-hidden="true"+ />) : (- <Save className="h-3.5 w-3.5" />+ <Save className="size-3.5" aria-hidden="true" />)}{t(($) => $.tab_body.common.save)}</Button>diff --git a/packages/views/agents/components/tabs/instructions-tab.tsx b/packages/views/agents/components/tabs/instructions-tab.tsxindex 4b5cbf2a1f..326b12c5a8 100644--- a/packages/views/agents/components/tabs/instructions-tab.tsx+++ b/packages/views/agents/components/tabs/instructions-tab.tsx@@ -4,7 +4,7 @@ import { useEffect, useState } from "react";import { Loader2, Save } from "lucide-react";import type { Agent } from "@multica/core/types";import { Button } from "@multica/ui/components/ui/button";-import { ContentEditor } from "../../../editor/content-editor";+import { Textarea } from "@multica/ui/components/ui/textarea";import { useT } from "../../../i18n";export function InstructionsTab({@@ -43,37 +43,27 @@ export function InstructionsTab({};return (- // Fill the parent TabContent (h-full flex-col): helper + footer take- // their natural height, the editor wrapper fills the rest. Without this- // the Save row scrolls off-screen as the user writes longer prompts.- <div className="flex h-full flex-col gap-4">- <p className="text-xs text-muted-foreground">+ <div className="space-y-5">+ <p className="max-w-2xl text-pretty text-sm leading-6 text-muted-foreground">{t(($) => $.tab_body.instructions.intro)}</p>- <div- // flex-1 min-h-0 so the wrapper claims the leftover height in the- // column. overflow-y-auto so very long prompts scroll inside the- // editor instead of pushing the Save row down.- className="flex-1 min-h-0 overflow-y-auto rounded-md border bg-background px-4 py-3 transition-colors focus-within:border-input"- >- <ContentEditor- // Keyed by agent id so navigating between agents fully remounts the- // editor — Tiptap's `defaultValue` is read once, so without the key- // the second agent's instructions wouldn't load.- key={agent.id}- defaultValue={value}- onUpdate={setValue}+ <div className="space-y-2">+ <label+ htmlFor={`agent-system-prompt-${agent.id}`}+ className="text-sm font-medium"+ >+ {t(($) => $.tab_body.instructions.system_prompt_label)}+ </label>+ <Textarea+ id={`agent-system-prompt-${agent.id}`}+ name="agent-system-prompt"+ autoComplete="off"+ value={value}+ onChange={(event) => setValue(event.target.value)}placeholder={t(($) => $.tab_body.instructions.placeholder)}- debounceMs={150}- // Mention has no business meaning in agent system prompts — typing- // `@` would just confuse users with a member/agent picker.- disableMentions- // min-h-full lets the editor fill the wrapper even when the user- // has typed nothing yet, so the click target matches the visual- // box. Combined with the wrapper's overflow-y-auto, long content- // grows past the wrapper height and scrolls within it.- className="min-h-full"+ rows={18}+ className="min-h-96 resize-y leading-6"/></div>@@ -87,9 +77,12 @@ export function InstructionsTab({disabled={!isDirty || saving}>{saving ? (- <Loader2 className="h-3.5 w-3.5 animate-spin" />+ <Loader2+ className="h-3.5 w-3.5 animate-spin motion-reduce:animate-none"+ aria-hidden="true"+ />) : (- <Save className="h-3.5 w-3.5" />+ <Save className="h-3.5 w-3.5" aria-hidden="true" />)}{t(($) => $.tab_body.common.save)}</Button>diff --git a/packages/views/agents/components/tabs/mcp-config-tab.tsx b/packages/views/agents/components/tabs/mcp-config-tab.tsxindex d257b8b3c5..5443e78553 100644--- a/packages/views/agents/components/tabs/mcp-config-tab.tsx+++ b/packages/views/agents/components/tabs/mcp-config-tab.tsx@@ -87,7 +87,10 @@ export function McpConfigTab({return (<div className="space-y-3"><p className="flex items-center gap-2 text-sm font-medium">- <Lock className="h-3.5 w-3.5 text-muted-foreground" />+ <Lock+ className="h-3.5 w-3.5 text-muted-foreground"+ aria-hidden="true"+ />{t(($) => $.tab_body.mcp_config.redacted_title)}</p><p className="text-xs text-muted-foreground">@@ -130,9 +133,9 @@ export function McpConfigTab({: "";return (- <div className="flex h-full flex-col space-y-3">+ <div className="space-y-5"><div className="flex items-start justify-between gap-3">- <p className="text-xs text-muted-foreground">+ <p className="max-w-2xl break-words text-pretty text-sm leading-6 text-muted-foreground">{t(($) => $.tab_body.mcp_config.intro)}</p>{trimmed !== "" && (@@ -143,21 +146,33 @@ export function McpConfigTab({onClick={handleClear}className="shrink-0">- <Eraser className="h-3 w-3" />+ <Eraser className="h-3 w-3" aria-hidden="true" />{t(($) => $.tab_body.mcp_config.clear_action)}</Button>)}</div>- <Textarea- value={text}- onChange={(e) => setText(e.target.value)}- placeholder={t(($) => $.tab_body.mcp_config.placeholder)}- aria-invalid={showInvalid || undefined}- aria-label={t(($) => $.tab_body.mcp_config.editor_aria)}- spellCheck={false}- className="min-h-[240px] flex-1 font-mono text-xs"- />+ <div className="space-y-2">+ <label+ htmlFor={`agent-mcp-config-${agent.id}`}+ className="text-sm font-medium"+ >+ {t(($) => $.tab_body.mcp_config.config_label)}+ </label>+ <Textarea+ id={`agent-mcp-config-${agent.id}`}+ name="agent-mcp-config"+ autoComplete="off"+ value={text}+ onChange={(e) => setText(e.target.value)}+ placeholder={t(($) => $.tab_body.mcp_config.placeholder)}+ aria-invalid={showInvalid || undefined}+ aria-label={t(($) => $.tab_body.mcp_config.editor_aria)}+ spellCheck={false}+ rows={14}+ className="min-h-80 resize-y font-mono text-xs"+ />+ </div>{showInvalid && (<p className="text-xs text-destructive">{invalidMessage}</p>@@ -175,9 +190,12 @@ export function McpConfigTab({size="sm">{saving ? (- <Loader2 className="h-3.5 w-3.5 animate-spin" />+ <Loader2+ className="h-3.5 w-3.5 animate-spin motion-reduce:animate-none"+ aria-hidden="true"+ />) : (- <Save className="h-3.5 w-3.5" />+ <Save className="h-3.5 w-3.5" aria-hidden="true" />)}{t(($) => $.tab_body.common.save)}</Button>diff --git a/packages/views/autopilots/components/autopilots-page.tsx b/packages/views/autopilots/components/autopilots-page.tsxindex 18df5d33c1..2862b7fdfc 100644--- a/packages/views/autopilots/components/autopilots-page.tsx+++ b/packages/views/autopilots/components/autopilots-page.tsx@@ -46,7 +46,11 @@ import {import { Skeleton } from "@multica/ui/components/ui/skeleton";import { useRowLink } from "../../navigation";import { ActorAvatar } from "../../common/actor-avatar";-import { PageHeader } from "../../layout/page-header";+import {+ CollectionPageHeader,+ CollectionPageHeaderAction,+ CollectionPageState,+} from "../../layout/collection-page";import { AutopilotDialog } from "./autopilot-dialog";import { AutopilotListToolbar, actorFilterValue } from "./autopilot-list-toolbar";import {@@ -763,47 +767,38 @@ export function AutopilotsPage() {// not viewport-centered).<div className="relative flex flex-1 min-h-0 flex-col">{/* Header */}- <PageHeader className="justify-between px-5">- <div className="flex items-center gap-2">- <Zap className="h-4 w-4 text-muted-foreground" />- <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>- {totalCount > 0 && (- <span className="font-mono text-xs tabular-nums text-muted-foreground/70">- {totalCount}- </span>- )}- </div>- {/* Quiet chrome button (outline, icon-only below md) — primary is- reserved for the empty state's CTAs. */}- <Button- size="sm"- variant="outline"- className="h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5"- aria-label={t(($) => $.page.new_autopilot)}- onClick={() => openCreate()}- >- <Plus className="h-3.5 w-3.5" />- <span className="hidden md:inline">- {t(($) => $.page.new_autopilot)}- </span>- </Button>- </PageHeader>+ <CollectionPageHeader+ icon={Zap}+ title={t(($) => $.page.title)}+ count={totalCount}+ actions={+ <CollectionPageHeaderAction+ icon={Plus}+ label={t(($) => $.page.new_autopilot)}+ onClick={() => openCreate()}+ />+ }+ />{listError ? (- <div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center">- <AlertCircle className="h-8 w-8 text-destructive" />- <p className="text-sm text-muted-foreground">- {listError instanceof Error ? listError.message : String(listError)}- </p>- <Button- type="button"- variant="outline"- size="sm"- onClick={() => refetchList()}- >- {t(($) => $.page.retry)}- </Button>- </div>+ <CollectionPageState+ role="alert"+ tone="destructive"+ icon={AlertCircle}+ title={+ listError instanceof Error ? listError.message : String(listError)+ }+ actions={+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => refetchList()}+ >+ {t(($) => $.page.retry)}+ </Button>+ }+ />) : isLoading ? (<div className="flex-1 overflow-y-auto @container"><LoadingSkeleton />diff --git a/packages/views/layout/collection-page.test.tsx b/packages/views/layout/collection-page.test.tsxnew file mode 100644index 0000000000..b94d001628--- /dev/null+++ b/packages/views/layout/collection-page.test.tsx@@ -0,0 +1,64 @@+import { render, screen } from "@testing-library/react";+import { Plus, Users } from "lucide-react";+import { describe, expect, it, vi } from "vitest";+import {+ CollectionPageHeader,+ CollectionPageHeaderAction,+ CollectionPageState,+} from "./collection-page";++describe("CollectionPageHeader", () => {+ it("renders a semantic title, count, supporting link, and labelled action", () => {+ render(+ <CollectionPageHeader+ icon={Users}+ title="Teams"+ count={4}+ description="Manage collaborators."+ learnMore={{ href: "https://example.com/docs", label: "Learn more" }}+ actions={+ <CollectionPageHeaderAction+ icon={Plus}+ label="New team"+ onClick={vi.fn()}+ />+ }+ />,+ );++ expect(screen.getByRole("banner")).toBeInTheDocument();+ expect(+ screen.getByRole("heading", { name: "Teams", level: 1 }),+ ).toBeInTheDocument();+ expect(screen.getByText("4")).toBeInTheDocument();+ expect(screen.getByRole("link", { name: "Learn more" })).toHaveAttribute(+ "href",+ "https://example.com/docs",+ );+ expect(screen.getByRole("button", { name: "New team" })).toBeInTheDocument();+ });++ it("does not render a zero count", () => {+ render(<CollectionPageHeader icon={Users} title="Teams" count={0} />);+ expect(screen.queryByText("0")).not.toBeInTheDocument();+ });+});++describe("CollectionPageState", () => {+ it("renders an alert with semantic title and description", () => {+ render(+ <CollectionPageState+ role="alert"+ icon={Users}+ title="Could not load teams"+ description="Try again."+ />,+ );++ expect(screen.getByRole("alert")).toBeInTheDocument();+ expect(+ screen.getByRole("heading", { name: "Could not load teams", level: 2 }),+ ).toBeInTheDocument();+ expect(screen.getByText("Try again.").tagName).toBe("P");+ });+});diff --git a/packages/views/layout/collection-page.tsx b/packages/views/layout/collection-page.tsxnew file mode 100644index 0000000000..b0221d80b1--- /dev/null+++ b/packages/views/layout/collection-page.tsx@@ -0,0 +1,172 @@+"use client";++import type { ComponentProps, ReactNode } from "react";+import type { LucideIcon } from "lucide-react";+import { Button } from "@multica/ui/components/ui/button";+import {+ Empty,+ EmptyContent,+ EmptyDescription,+ EmptyHeader,+ EmptyMedia,+ EmptyTitle,+} from "@multica/ui/components/ui/empty";+import { cn } from "@multica/ui/lib/utils";+import { PageHeader } from "./page-header";++interface CollectionPageHeaderProps {+ icon: LucideIcon;+ title: ReactNode;+ count?: number;+ description?: ReactNode;+ learnMore?: {+ href: string;+ label: ReactNode;+ };+ actions?: ReactNode;+ className?: string;+}++/**+ * Shared dashboard collection header: entity icon, title, optional count and+ * supporting copy on the left; page-level actions on the right.+ */+export function CollectionPageHeader({+ icon: Icon,+ title,+ count,+ description,+ learnMore,+ actions,+ className,+}: CollectionPageHeaderProps) {+ return (+ <PageHeader className={cn("justify-between gap-3 px-5", className)}>+ <div className="flex min-w-0 items-center gap-2">+ <Icon+ aria-hidden="true"+ className="size-4 shrink-0 text-muted-foreground"+ />+ <h1 className="truncate text-sm font-medium">{title}</h1>+ {typeof count === "number" && count > 0 ? (+ <span className="shrink-0 font-mono text-xs tabular-nums text-muted-foreground/70">+ {count}+ </span>+ ) : null}+ {description ? (+ <p className="ml-2 hidden min-w-0 truncate text-xs text-muted-foreground md:block">+ {description}+ {learnMore ? (+ <>+ {" "}+ <a+ href={learnMore.href}+ target="_blank"+ rel="noopener noreferrer"+ className="underline decoration-muted-foreground/30 underline-offset-4 transition-colors hover:text-foreground"+ >+ {learnMore.label}+ </a>+ </>+ ) : null}+ </p>+ ) : null}+ </div>+ {actions ? (+ <div className="flex shrink-0 items-center justify-end gap-2">+ {actions}+ </div>+ ) : null}+ </PageHeader>+ );+}++interface CollectionPageHeaderActionProps+ extends Omit<ComponentProps<typeof Button>, "children"> {+ icon: LucideIcon;+ label: string;+}++/** Responsive collection action: icon-only below md, labelled above md. */+export function CollectionPageHeaderAction({+ icon: Icon,+ label,+ className,+ type = "button",+ size = "sm",+ variant = "outline",+ ...props+}: CollectionPageHeaderActionProps) {+ const accessibleLabel = props["aria-label"] ?? label;++ return (+ <Button+ type={type}+ size={size}+ variant={variant}+ className={cn("h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5", className)}+ aria-label={accessibleLabel}+ {...props}+ >+ <Icon aria-hidden="true" className="size-3.5" />+ <span className="hidden md:inline">{label}</span>+ </Button>+ );+}++type PageStateTone = "muted" | "destructive" | "warning";++interface CollectionPageStateProps {+ icon: LucideIcon;+ title: ReactNode;+ description?: ReactNode;+ actions?: ReactNode;+ tone?: PageStateTone;+ role?: "alert" | "status";+ className?: string;+}++const stateToneClass: Record<PageStateTone, string> = {+ muted: "text-muted-foreground",+ destructive: "text-destructive",+ warning: "text-warning",+};++/** Shared centered state for collection empty, error and not-found views. */+export function CollectionPageState({+ icon: Icon,+ title,+ description,+ actions,+ tone = "muted",+ role,+ className,+}: CollectionPageStateProps) {+ return (+ <Empty+ role={role}+ className={cn("rounded-none border-0 px-6 py-16", className)}+ >+ <EmptyHeader>+ <EmptyMedia+ variant="icon"+ className={cn(+ "size-12 rounded-full [&_svg]:size-6",+ stateToneClass[tone],+ )}+ >+ <Icon aria-hidden="true" />+ </EmptyMedia>+ <EmptyTitle>{title}</EmptyTitle>+ {description ? (+ <EmptyDescription className="max-w-md">{description}</EmptyDescription>+ ) : null}+ </EmptyHeader>+ {actions ? (+ <EmptyContent className="mt-1 flex-row justify-center">+ {actions}+ </EmptyContent>+ ) : null}+ </Empty>+ );+}diff --git a/packages/views/layout/index.ts b/packages/views/layout/index.tsindex eb29227164..57c5a490c3 100644--- a/packages/views/layout/index.ts+++ b/packages/views/layout/index.ts@@ -1,4 +1,9 @@export { AppSidebar } from "./app-sidebar";+export {+ CollectionPageHeader,+ CollectionPageHeaderAction,+ CollectionPageState,+} from "./collection-page";export { DashboardGuard } from "./dashboard-guard";export { DashboardLayout } from "./dashboard-layout";export { useDashboardGuard } from "./use-dashboard-guard";diff --git a/packages/views/layout/page-header.tsx b/packages/views/layout/page-header.tsxindex 2e4b2c8b1f..bce5a003fd 100644--- a/packages/views/layout/page-header.tsx+++ b/packages/views/layout/page-header.tsx@@ -16,9 +16,9 @@ interface PageHeaderProps {export function PageHeader({ children, className }: PageHeaderProps) {return (- <div className={cn("flex h-12 shrink-0 items-center border-b px-4", className)}>+ <header className={cn("flex h-12 shrink-0 items-center border-b px-4", className)}><MobileSidebarTrigger />{children}- </div>+ </header>);}diff --git a/packages/views/locales/en/agents.json b/packages/views/locales/en/agents.jsonindex 0e4d75dcee..7f9d6b098d 100644--- a/packages/views/locales/en/agents.json+++ b/packages/views/locales/en/agents.json@@ -143,11 +143,21 @@"agent_archived_toast": "Agent archived","archive_failed_toast": "Failed to archive agent","agent_restored_toast": "Agent restored",- "restore_failed_toast": "Failed to restore agent"+ "restore_failed_toast": "Failed to restore agent",+ "assign_work": "Assign work",+ "more_actions_aria": "Agent actions",+ "updated": "Updated {{when}}"},"inspector": {+ "section_profile": "Profile",+ "section_profile_hint": "Manage how this agent appears across the workspace.",+ "section_execution": "Execution",+ "section_execution_hint": "Choose the runtime, model, reasoning level, and parallel task limit.",+ "section_access": "Access",+ "section_access_hint": "Control who can run this agent and use its connected capabilities.","section_properties": "Properties","section_details": "Details",+ "section_details_hint": "Read-only ownership and lifecycle information.","section_skills": "Skills","section_integrations": "Integrations","prop_runtime": "Runtime",@@ -159,6 +169,10 @@"prop_created": "Created","prop_updated": "Updated","no_description_placeholder": "No description",+ "avatar_label": "Avatar",+ "avatar_hint": "Shown in assignments, activity, and chat.",+ "name_label": "Name",+ "description_label": "Description","change_avatar_aria": "Change avatar","avatar_updated_toast": "Avatar updated","avatar_upload_failed_toast": "Failed to upload avatar",@@ -170,6 +184,13 @@"save": "Save","cancel": "Cancel"},+ "overview": {+ "agent_context": "Agent",+ "access": "Access",+ "attention_title": "Tasks need attention",+ "attention_queued_one": "{{count}} task is queued while the runtime is unavailable.",+ "attention_queued_other": "{{count}} tasks are queued while the runtime is unavailable."+ },"skill_attach": {"trigger_aria": "Attach a workspace skill","trigger_label": "Attach"@@ -211,6 +232,14 @@"clear_full": "Clear selection (use provider default)"},"tabs": {+ "overview": "Overview",+ "work": "Work",+ "capabilities": "Capabilities",+ "settings": "Settings",+ "general": "General",+ "access": "Access",+ "page_navigation_aria": "Agent page",+ "section_navigation_aria": "Agent section","activity": "Activity","tasks": "Tasks","instructions": "Instructions",@@ -299,7 +328,8 @@"unsaved_changes": "Unsaved changes"},"instructions": {- "intro": "Define this agent's identity and working style. Injected into the agent's context for every task. Markdown is supported.",+ "intro": "Set the system prompt used for every task. Markdown is supported.",+ "system_prompt_label": "System prompt","placeholder": "Define this agent's role, expertise, and working style.\n\n# Example\nYou are a frontend engineer specializing in React and TypeScript.\n\n## Working Style\n- Write small, focused PRs — one commit per logical change\n- Prefer composition over inheritance\n- Always add unit tests for new components\n\n## Constraints\n- Do not modify shared/ types without explicit approval\n- Follow the existing component patterns in features/"},"env": {@@ -326,16 +356,27 @@"empty_editable": "No environment variables configured. Add one to inject it into the agent at launch."},"custom_args": {- "intro": "Additional CLI arguments appended to the agent command at launch. Multi-token flags can share one row — they'll be split on whitespace before being passed to the CLI.",- "launch_mode_prefix": "Launch mode: ",- "launch_mode_args_placeholder": "<your args>",- "input_placeholder": "--flag value",- "remove_aria": "Remove argument",+ "intro": "Add CLI arguments passed when this agent starts.",+ "arguments_label": "Arguments",+ "arguments_description": "Each item is passed as one token. The list order is preserved.",+ "add_argument_action": "Add argument",+ "add_action": "Add",+ "update_action": "Update",+ "cancel_action": "Cancel",+ "command_preview_label": "Command preview",+ "input_placeholder": "--profile",+ "input_aria": "Argument {{index}}",+ "new_argument_aria": "New argument",+ "empty_title": "No arguments yet",+ "empty_hint": "Add the first token to build the launch command.",+ "edit_aria": "Edit argument {{index}}",+ "remove_aria": "Remove argument {{index}}","saved_toast": "Custom arguments saved","save_failed_toast": "Failed to save custom arguments"},"mcp_config": {- "intro": "MCP server configuration forwarded to the runtime CLI (Claude via --mcp-config, Codex via $CODEX_HOME/config.toml, Hermes/Kimi/Kiro via ACP mcpServers, OpenCode via OPENCODE_CONFIG_CONTENT, OpenClaw via the per-task config wrapper). Stored verbatim and may contain secrets — only the agent owner and workspace admins can read it. Leave empty to fall back to the CLI's own default. For OpenClaw HTTP/SSE entries use OpenClaw's own field name (e.g. \"transport\": \"streamable-http\") instead of Claude's \"type\".",+ "intro": "Configure the MCP servers available to this agent. Leave this empty to use the runtime defaults.",+ "config_label": "Server configuration (JSON)","placeholder": "{\n \"mcpServers\": {\n \"fetch\": {\n \"command\": \"uvx\",\n \"args\": [\"mcp-server-fetch\"]\n }\n }\n}","editor_aria": "MCP config JSON editor","clear_action": "Clear",@@ -406,6 +447,15 @@"members_note": "Only workspace owners and admins can connect an agent to an external chat platform. You can view connected bots in Settings → Integrations."},"activity": {+ "status": {+ "queued": "Queued",+ "dispatched": "Dispatched",+ "waiting_local_directory": "Waiting for directory",+ "running": "Running",+ "completed": "Succeeded",+ "failed": "Failed",+ "cancelled": "Cancelled"+ },"section_now": "Now","section_last_30d": "Last 30 days","section_recent": "Recent work",@@ -414,8 +464,8 @@"subtitle_active_other": "{{count}} active tasks","subtitle_performance": "Performance","subtitle_no_recent": "Nothing finished yet",- "subtitle_recent_progress": "{{shown}} of {{total}}",- "subtitle_recent_latest": "{{count}} latest",+ "subtitle_recent_progress": "{{shown}} of {{total}} runs",+ "subtitle_recent_latest": "{{count}} latest runs","empty_now": "This agent isn't running anything right now.","empty_30d": "No completions in the last 30 days.","empty_recent": "This agent hasn't completed anything yet.",@@ -423,8 +473,11 @@"runs_one": "run","runs_other": "runs","success_pct": "{{percent}}% success",+ "success_label": "succeeded","avg_duration": "avg {{value}}",+ "avg_duration_label": "average duration","failed_count": "{{count}} failed",+ "failed_label": "failed","source_issue": "Issue","source_chat": "Chat","source_autopilot": "Autopilot",@@ -464,6 +517,7 @@}},"access": {+ "section_title": "Who can run this agent","tooltip": "Access · who may run this agent","trigger_private": "Only me","trigger_workspace": "Workspace",@@ -472,6 +526,9 @@"trigger_team": "Team","private_title": "Private","private_desc": "Only you can run this agent",+ "shared_title": "Shared",+ "shared_desc": "Choose the workspace or specific people who can run this agent",+ "shared_target_required": "Select the workspace or at least one person before saving.","workspace_title": "Public to workspace","workspace_desc": "Anyone in this workspace can run this agent","members_title": "Public to specific people",diff --git a/packages/views/locales/ja/agents.json b/packages/views/locales/ja/agents.jsonindex 1cc8c18e3a..3d9fecfb8c 100644--- a/packages/views/locales/ja/agents.json+++ b/packages/views/locales/ja/agents.json@@ -127,11 +127,21 @@"agent_archived_toast": "エージェントをアーカイブしました","archive_failed_toast": "エージェントをアーカイブできませんでした","agent_restored_toast": "エージェントを復元しました",- "restore_failed_toast": "エージェントを復元できませんでした"+ "restore_failed_toast": "エージェントを復元できませんでした",+ "assign_work": "作業を割り当てる",+ "more_actions_aria": "エージェントの操作",+ "updated": "{{when}}に更新"},"inspector": {+ "section_profile": "プロフィール",+ "section_profile_hint": "ワークスペース内でのエージェントの表示を管理します。",+ "section_execution": "実行設定",+ "section_execution_hint": "ランタイム、モデル、思考レベル、同時タスク数を設定します。",+ "section_access": "アクセス",+ "section_access_hint": "このエージェントと接続済み機能を利用できる相手を管理します。","section_properties": "プロパティ","section_details": "詳細",+ "section_details_hint": "所有者とライフサイクルに関する読み取り専用情報です。","section_skills": "スキル","section_integrations": "連携","prop_runtime": "ランタイム",@@ -143,6 +153,10 @@"prop_created": "作成日","prop_updated": "更新日","no_description_placeholder": "説明なし",+ "avatar_label": "アバター",+ "avatar_hint": "割り当て、アクティビティ、チャットに表示されます。",+ "name_label": "名前",+ "description_label": "説明","change_avatar_aria": "アバターを変更","avatar_updated_toast": "アバターを更新しました","avatar_upload_failed_toast": "アバターをアップロードできませんでした",@@ -154,6 +168,12 @@"save": "保存","cancel": "キャンセル"},+ "overview": {+ "agent_context": "エージェント",+ "access": "アクセス",+ "attention_title": "対応が必要な task",+ "attention_queued_other": "ランタイムが利用できないため、{{count}}件の task が待機中です。"+ },"skill_attach": {"trigger_aria": "ワークスペースのスキルを追加","trigger_label": "追加"@@ -195,6 +215,14 @@"clear_full": "選択をクリア(プロバイダーのデフォルトを使用)"},"tabs": {+ "overview": "概要",+ "work": "作業",+ "capabilities": "機能",+ "settings": "設定",+ "general": "一般",+ "access": "アクセス",+ "page_navigation_aria": "エージェントページ",+ "section_navigation_aria": "エージェントセクション","activity": "アクティビティ","tasks": "タスク","instructions": "指示",@@ -282,7 +310,8 @@"unsaved_changes": "保存していない変更"},"instructions": {- "intro": "このエージェントのアイデンティティと作業スタイルを定義します。すべてのタスクでエージェントのコンテキストに注入されます。Markdown に対応しています。",+ "intro": "すべてのタスクで使用する System Prompt を設定します。Markdown に対応しています。",+ "system_prompt_label": "System Prompt","placeholder": "このエージェントの役割、専門分野、作業スタイルを定義してください。\n\n# 例\nあなたは React と TypeScript を専門とするフロントエンドエンジニアです。\n\n## 作業スタイル\n- 小さく焦点を絞った PR を作成する — 論理的な変更ごとに1コミット\n- 継承よりコンポジションを優先する\n- 新しいコンポーネントには必ずユニットテストを追加する\n\n## 制約\n- 明示的な承認なしに shared/ の型を変更しない\n- features/ の既存のコンポーネントパターンに従う"},"env": {@@ -308,16 +337,27 @@"empty_editable": "設定された環境変数はありません。起動時にエージェントへ注入する変数を追加してください。"},"custom_args": {- "intro": "起動時にエージェントコマンドの末尾に追加される CLI 引数です。複数トークンのフラグは1行にまとめられ、CLI に渡される前に空白で分割されます。",- "launch_mode_prefix": "起動モード: ",- "launch_mode_args_placeholder": "<引数>",- "input_placeholder": "--flag value",- "remove_aria": "引数を削除",+ "intro": "エージェントの起動時に渡す CLI 引数を追加します。",+ "arguments_label": "引数",+ "arguments_description": "各項目は 1 つのトークンとして渡され、リストの順序が保持されます。",+ "add_argument_action": "引数を追加",+ "add_action": "追加",+ "update_action": "更新",+ "cancel_action": "キャンセル",+ "command_preview_label": "コマンドプレビュー",+ "input_placeholder": "--profile",+ "input_aria": "引数 {{index}}",+ "new_argument_aria": "新しい引数",+ "empty_title": "引数はまだありません",+ "empty_hint": "最初のトークンを追加して、起動コマンドを作成します。",+ "edit_aria": "引数 {{index}} を編集",+ "remove_aria": "引数 {{index}} を削除","saved_toast": "カスタム引数を保存しました","save_failed_toast": "カスタム引数を保存できませんでした"},"mcp_config": {- "intro": "ランタイム CLI に転送される MCP server configuration です(Claude は --mcp-config、Codex は $CODEX_HOME/config.toml、Hermes/Kimi/Kiro は ACP mcpServers、OpenClaw はタスクごとの config wrapper 経由)。そのまま保存され、secret が含まれる場合があるため、エージェントのオーナーとワークスペースの admin のみが読み取れます。空のままにすると CLI 自身のデフォルトが使用されます。OpenClaw の HTTP/SSE エントリには、Claude の \"type\" の代わりに OpenClaw 独自のフィールド名(例: \"transport\": \"streamable-http\")を使用してください。",+ "intro": "このエージェントが使用できる MCP Server を設定します。空欄の場合はランタイムのデフォルトを使用します。",+ "config_label": "Server 設定(JSON)","placeholder": "{\n \"mcpServers\": {\n \"fetch\": {\n \"command\": \"uvx\",\n \"args\": [\"mcp-server-fetch\"]\n }\n }\n}","editor_aria": "MCP config JSON editor","clear_action": "クリア",@@ -387,6 +427,15 @@"members_note": "エージェントを外部チャットプラットフォームに接続できるのはワークスペースのオーナーと管理者のみです。接続済みの Bot は「設定 → 連携」で確認できます。"},"activity": {+ "status": {+ "queued": "待機中",+ "dispatched": "送信済み",+ "waiting_local_directory": "ディレクトリ待機中",+ "running": "実行中",+ "completed": "成功",+ "failed": "失敗",+ "cancelled": "キャンセル済み"+ },"section_now": "現在","section_last_30d": "過去30日","section_recent": "最近の作業",@@ -394,16 +443,19 @@"subtitle_active_other": "アクティブなタスク {{count}} 件","subtitle_performance": "パフォーマンス","subtitle_no_recent": "まだ完了した作業はありません",- "subtitle_recent_progress": "{{total}} 件中 {{shown}} 件",- "subtitle_recent_latest": "最新 {{count}} 件",+ "subtitle_recent_progress": "{{total}} 回の実行中 {{shown}} 回",+ "subtitle_recent_latest": "最新 {{count}} 回の実行","empty_now": "このエージェントは現在何も実行していません。","empty_30d": "過去30日間に完了した作業はありません。","empty_recent": "このエージェントはまだ何も完了していません。","show_more": "もっと見る →","runs_other": "回実行","success_pct": "成功率 {{percent}}%",+ "success_label": "成功","avg_duration": "平均 {{value}}",+ "avg_duration_label": "平均時間","failed_count": "{{count}} 回失敗",+ "failed_label": "失敗","source_issue": "イシュー","source_chat": "チャット","source_autopilot": "オートパイロット",@@ -443,6 +495,7 @@}},"access": {+ "section_title": "このエージェントを実行できるユーザー","tooltip": "アクセス · 誰がこのエージェントを実行できるか","trigger_private": "自分のみ","trigger_workspace": "ワークスペース",@@ -451,6 +504,9 @@"trigger_team": "チーム","private_title": "プライベート","private_desc": "あなただけがこのエージェントを実行できます",+ "shared_title": "共有",+ "shared_desc": "このエージェントを実行できるワークスペースまたはメンバーを選択します",+ "shared_target_required": "保存する前に、ワークスペースまたは1人以上のメンバーを選択してください。","workspace_title": "ワークスペースに公開","workspace_desc": "このワークスペースの全員がこのエージェントを実行できます","members_title": "特定のメンバーに公開",diff --git a/packages/views/locales/ko/agents.json b/packages/views/locales/ko/agents.jsonindex 835c475d47..460e8ab0a8 100644--- a/packages/views/locales/ko/agents.json+++ b/packages/views/locales/ko/agents.json@@ -135,11 +135,21 @@"agent_archived_toast": "에이전트를 보관했습니다","archive_failed_toast": "에이전트를 보관하지 못했습니다","agent_restored_toast": "에이전트를 복원했습니다",- "restore_failed_toast": "에이전트를 복원하지 못했습니다"+ "restore_failed_toast": "에이전트를 복원하지 못했습니다",+ "assign_work": "작업 할당",+ "more_actions_aria": "에이전트 작업",+ "updated": "{{when}} 업데이트됨"},"inspector": {+ "section_profile": "프로필",+ "section_profile_hint": "워크스페이스에서 이 에이전트가 표시되는 방식을 관리합니다.",+ "section_execution": "실행 설정",+ "section_execution_hint": "런타임, 모델, 추론 수준과 병렬 작업 한도를 설정합니다.",+ "section_access": "접근 권한",+ "section_access_hint": "이 에이전트와 연결된 기능을 사용할 수 있는 대상을 관리합니다.","section_properties": "속성","section_details": "세부 정보",+ "section_details_hint": "소유권과 수명 주기에 대한 읽기 전용 정보입니다.","section_skills": "스킬","section_integrations": "연동","prop_runtime": "런타임",@@ -151,6 +161,10 @@"prop_created": "생성일","prop_updated": "수정일","no_description_placeholder": "설명 없음",+ "avatar_label": "아바타",+ "avatar_hint": "할당, 활동 및 채팅에 표시됩니다.",+ "name_label": "이름",+ "description_label": "설명","change_avatar_aria": "아바타 변경","avatar_updated_toast": "아바타를 업데이트했습니다","avatar_upload_failed_toast": "아바타를 업로드하지 못했습니다",@@ -162,6 +176,12 @@"save": "저장","cancel": "취소"},+ "overview": {+ "agent_context": "에이전트",+ "access": "접근 권한",+ "attention_title": "확인이 필요한 task",+ "attention_queued_other": "런타임을 사용할 수 없어 {{count}}개의 task가 대기 중입니다."+ },"skill_attach": {"trigger_aria": "워크스페이스 스킬 연결","trigger_label": "연결"@@ -203,6 +223,14 @@"clear_full": "선택 지우기(제공자 기본값 사용)"},"tabs": {+ "overview": "개요",+ "work": "작업",+ "capabilities": "기능",+ "settings": "설정",+ "general": "일반",+ "access": "접근 권한",+ "page_navigation_aria": "에이전트 페이지",+ "section_navigation_aria": "에이전트 섹션","activity": "활동","tasks": "작업","instructions": "지침",@@ -290,7 +318,8 @@"unsaved_changes": "저장하지 않은 변경사항"},"instructions": {- "intro": "이 에이전트의 정체성과 작업 방식을 정의하세요. 모든 작업에서 에이전트 컨텍스트에 포함됩니다. Markdown을 지원합니다.",+ "intro": "모든 작업에 사용할 System Prompt를 설정하세요. Markdown을 지원합니다.",+ "system_prompt_label": "System Prompt","placeholder": "이 에이전트의 역할, 전문성, 작업 방식을 정의하세요.\n\n# 예시\n당신은 React와 TypeScript에 특화된 프런트엔드 엔지니어입니다.\n\n## 작업 방식\n- 작고 집중된 PR을 작성합니다. 논리적 변경 단위마다 커밋 하나를 사용합니다\n- 상속보다 조합을 선호합니다\n- 새 컴포넌트에는 항상 단위 테스트를 추가합니다\n\n## 제약\n- 명시적인 승인 없이 shared/ 타입을 수정하지 않습니다\n- features/의 기존 컴포넌트 패턴을 따릅니다"},"env": {@@ -316,16 +345,27 @@"empty_editable": "설정된 환경 변수가 없습니다. 시작 시 에이전트에 주입할 변수를 추가하세요."},"custom_args": {- "intro": "에이전트 명령을 시작할 때 뒤에 붙는 추가 CLI 인자입니다. 여러 토큰으로 된 플래그는 한 행에 둘 수 있으며, CLI에 전달되기 전에 공백 기준으로 나뉩니다.",- "launch_mode_prefix": "시작 모드: ",- "launch_mode_args_placeholder": "<인자>",- "input_placeholder": "--flag value",- "remove_aria": "인자 제거",+ "intro": "에이전트를 시작할 때 전달할 CLI 인자를 추가하세요.",+ "arguments_label": "인자",+ "arguments_description": "각 항목은 하나의 토큰으로 전달되며 목록 순서가 유지됩니다.",+ "add_argument_action": "인자 추가",+ "add_action": "추가",+ "update_action": "업데이트",+ "cancel_action": "취소",+ "command_preview_label": "명령어 미리보기",+ "input_placeholder": "--profile",+ "input_aria": "인자 {{index}}",+ "new_argument_aria": "새 인자",+ "empty_title": "아직 인자가 없습니다",+ "empty_hint": "첫 번째 토큰을 추가하여 시작 명령어를 만드세요.",+ "edit_aria": "인자 {{index}} 편집",+ "remove_aria": "인자 {{index}} 제거","saved_toast": "사용자 지정 인자를 저장했습니다","save_failed_toast": "사용자 지정 인자를 저장하지 못했습니다"},"mcp_config": {- "intro": "런타임 CLI로 전달되는 MCP server configuration입니다(Claude는 --mcp-config, Codex는 $CODEX_HOME/config.toml, Hermes/Kimi/Kiro는 ACP mcpServers, OpenCode는 OPENCODE_CONFIG_CONTENT, OpenClaw는 task별 config wrapper). 그대로 저장되며 secret이 포함될 수 있으므로 에이전트 소유자와 워크스페이스 관리자만 읽을 수 있습니다. 비워두면 CLI 자체 기본값을 사용합니다. OpenClaw HTTP/SSE 항목은 Claude의 \"type\" 대신 OpenClaw의 필드명(예: \"transport\": \"streamable-http\")을 사용하세요.",+ "intro": "이 에이전트가 사용할 MCP Server를 설정하세요. 비워 두면 런타임 기본값을 사용합니다.",+ "config_label": "Server 설정(JSON)","placeholder": "{\n \"mcpServers\": {\n \"fetch\": {\n \"command\": \"uvx\",\n \"args\": [\"mcp-server-fetch\"]\n }\n }\n}","editor_aria": "MCP config JSON editor","clear_action": "지우기",@@ -395,6 +435,15 @@"members_note": "에이전트를 외부 채팅 플랫폼에 연결할 수 있는 사람은 워크스페이스 소유자와 관리자뿐입니다. 연결된 봇은 설정 → 연동에서 확인할 수 있습니다."},"activity": {+ "status": {+ "queued": "대기 중",+ "dispatched": "전달됨",+ "waiting_local_directory": "디렉터리 대기 중",+ "running": "실행 중",+ "completed": "성공",+ "failed": "실패",+ "cancelled": "취소됨"+ },"section_now": "현재","section_last_30d": "최근 30일","section_recent": "최근 작업",@@ -402,16 +451,19 @@"subtitle_active_other": "활성 작업 {{count}}개","subtitle_performance": "성과","subtitle_no_recent": "아직 완료된 작업 없음",- "subtitle_recent_progress": "{{total}}개 중 {{shown}}개",- "subtitle_recent_latest": "최근 {{count}}개",+ "subtitle_recent_progress": "{{total}}회 실행 중 {{shown}}회",+ "subtitle_recent_latest": "최근 {{count}}회 실행","empty_now": "이 에이전트는 지금 실행 중인 작업이 없습니다.","empty_30d": "최근 30일 동안 완료된 작업이 없습니다.","empty_recent": "이 에이전트는 아직 완료한 작업이 없습니다.","show_more": "더 보기 →","runs_other": "회 실행","success_pct": "성공률 {{percent}}%",+ "success_label": "성공","avg_duration": "평균 {{value}}",+ "avg_duration_label": "평균 소요 시간","failed_count": "{{count}}회 실패",+ "failed_label": "실패","source_issue": "이슈","source_chat": "채팅","source_autopilot": "오토파일럿",@@ -451,6 +503,7 @@}},"access": {+ "section_title": "이 에이전트를 실행할 수 있는 사용자","tooltip": "접근 권한 · 누가 이 에이전트를 실행할 수 있는지","trigger_private": "나만","trigger_workspace": "워크스페이스",@@ -459,6 +512,9 @@"trigger_team": "팀","private_title": "비공개","private_desc": "나만 이 에이전트를 실행할 수 있습니다",+ "shared_title": "공유",+ "shared_desc": "이 에이전트를 실행할 워크스페이스 또는 특정 사용자를 선택합니다",+ "shared_target_required": "저장하기 전에 워크스페이스 또는 한 명 이상의 사용자를 선택하세요.","workspace_title": "워크스페이스에 공개","workspace_desc": "이 워크스페이스의 모든 사람이 이 에이전트를 실행할 수 있습니다","members_title": "특정 사용자에게 공개",diff --git a/packages/views/locales/zh-Hans/agents.json b/packages/views/locales/zh-Hans/agents.jsonindex 7cb192d630..8e9990c3bc 100644--- a/packages/views/locales/zh-Hans/agents.json+++ b/packages/views/locales/zh-Hans/agents.json@@ -135,11 +135,21 @@"agent_archived_toast": "已归档智能体","archive_failed_toast": "归档智能体失败","agent_restored_toast": "已恢复智能体",- "restore_failed_toast": "恢复智能体失败"+ "restore_failed_toast": "恢复智能体失败",+ "assign_work": "分配工作",+ "more_actions_aria": "智能体操作",+ "updated": "{{when}}更新"},"inspector": {+ "section_profile": "资料",+ "section_profile_hint": "管理该智能体在工作区内的展示方式。",+ "section_execution": "执行配置",+ "section_execution_hint": "选择运行时、模型、思考强度和并行任务上限。",+ "section_access": "访问权限",+ "section_access_hint": "控制谁可以运行该智能体并使用它已连接的能力。","section_properties": "属性","section_details": "详情",+ "section_details_hint": "只读的所有权和生命周期信息。","section_skills": "Skills","section_integrations": "外部集成","prop_runtime": "运行时",@@ -151,6 +161,10 @@"prop_created": "创建时间","prop_updated": "更新时间","no_description_placeholder": "暂无描述",+ "avatar_label": "头像",+ "avatar_hint": "显示在任务分配、动态和聊天中。",+ "name_label": "名称",+ "description_label": "描述","change_avatar_aria": "更换头像","avatar_updated_toast": "已更新头像","avatar_upload_failed_toast": "头像上传失败",@@ -162,6 +176,12 @@"save": "保存","cancel": "取消"},+ "overview": {+ "agent_context": "智能体",+ "access": "访问权限",+ "attention_title": "Task 需要处理",+ "attention_queued_other": "运行时不可用,当前有 {{count}} 个 task 正在排队。"+ },"skill_attach": {"trigger_aria": "附加工作区 skill","trigger_label": "附加"@@ -203,6 +223,14 @@"clear_full": "清除选择(使用提供方默认)"},"tabs": {+ "overview": "概览",+ "work": "工作",+ "capabilities": "能力",+ "settings": "设置",+ "general": "通用",+ "access": "访问权限",+ "page_navigation_aria": "智能体页面",+ "section_navigation_aria": "智能体分区","activity": "动态","tasks": "Tasks","instructions": "指令",@@ -290,7 +318,8 @@"unsaved_changes": "未保存的修改"},"instructions": {- "intro": "定义这个智能体的身份和工作风格。会注入到每个 task 的上下文。支持 Markdown。",+ "intro": "设置每个任务都会使用的 System Prompt,支持 Markdown。",+ "system_prompt_label": "System Prompt","placeholder": "定义这个智能体的角色、专长和工作风格。\n\n# 示例\n你是一名专注 React 和 TypeScript 的前端工程师。\n\n## 工作风格\n- 写小而聚焦的 PR —— 每个逻辑变更一个 commit\n- 优先组合而不是继承\n- 新组件总是配单元测试\n\n## 约束\n- 未经明确批准不要修改 shared/ 下的 type\n- 遵循 features/ 中现有的组件模式"},"env": {@@ -316,16 +345,27 @@"empty_editable": "尚未配置环境变量。新增一条即可在智能体启动时注入。"},"custom_args": {- "intro": "在智能体命令启动时追加的额外 CLI 参数。多 token 的参数可以共用一行 —— 在传给 CLI 前会按空白拆分。",- "launch_mode_prefix": "启动方式: ",- "launch_mode_args_placeholder": "<你的参数>",- "input_placeholder": "--flag 值",- "remove_aria": "移除参数",+ "intro": "添加智能体启动时传入的 CLI 参数。",+ "arguments_label": "参数",+ "arguments_description": "每一项会作为一个完整 token 传入,并保留列表顺序。",+ "add_argument_action": "添加参数",+ "add_action": "添加",+ "update_action": "更新",+ "cancel_action": "取消",+ "command_preview_label": "命令预览",+ "input_placeholder": "--profile",+ "input_aria": "参数 {{index}}",+ "new_argument_aria": "新参数",+ "empty_title": "还没有参数",+ "empty_hint": "添加第一个 token,开始构建启动命令。",+ "edit_aria": "编辑参数 {{index}}",+ "remove_aria": "移除参数 {{index}}","saved_toast": "已保存自定义参数","save_failed_toast": "保存自定义参数失败"},"mcp_config": {- "intro": "转发给运行时 CLI 的 MCP 服务器配置(Claude 通过 --mcp-config,Codex 通过 $CODEX_HOME/config.toml,Hermes/Kimi/Kiro 通过 ACP mcpServers,OpenCode 通过 OPENCODE_CONFIG_CONTENT,OpenClaw 通过每个任务的配置 wrapper)。原样保存,可能包含密钥 —— 只有智能体所有者和工作区管理员可以读取。留空则回退到 CLI 自身的默认设置。OpenClaw 的 HTTP/SSE 条目需要使用 OpenClaw 自己的字段名(例如 \"transport\": \"streamable-http\"),而不是 Claude 的 \"type\"。",+ "intro": "配置这个智能体可以使用的 MCP Server。留空时使用运行时的默认配置。",+ "config_label": "Server 配置(JSON)","placeholder": "{\n \"mcpServers\": {\n \"fetch\": {\n \"command\": \"uvx\",\n \"args\": [\"mcp-server-fetch\"]\n }\n }\n}","editor_aria": "MCP 配置 JSON 编辑器","clear_action": "清空",@@ -395,6 +435,15 @@"members_note": "只有工作区的所有者和管理员才能把智能体连接到外部聊天平台。你可以在「设置 → 集成」中查看已连接的 Bot。"},"activity": {+ "status": {+ "queued": "排队中",+ "dispatched": "已分发",+ "waiting_local_directory": "等待目录",+ "running": "进行中",+ "completed": "成功",+ "failed": "失败",+ "cancelled": "已取消"+ },"section_now": "当前","section_last_30d": "近 30 天","section_recent": "最近工作",@@ -402,16 +451,19 @@"subtitle_active_other": "{{count}} 个进行中的 task","subtitle_performance": "表现","subtitle_no_recent": "还没有完成的 task",- "subtitle_recent_progress": "{{shown}} / {{total}}",- "subtitle_recent_latest": "最近 {{count}} 条",+ "subtitle_recent_progress": "显示 {{shown}} / {{total}} 次运行",+ "subtitle_recent_latest": "最近 {{count}} 次运行","empty_now": "这个智能体当前没有在跑任何 task。","empty_30d": "近 30 天没有任何完成记录。","empty_recent": "这个智能体还没有完成过任何 task。","show_more": "查看更多 →","runs_other": "次运行","success_pct": "{{percent}}% 成功",+ "success_label": "成功","avg_duration": "平均 {{value}}",+ "avg_duration_label": "平均耗时","failed_count": "{{count}} 次失败",+ "failed_label": "失败","source_issue": "Issue","source_chat": "聊天","source_autopilot": "自动化",@@ -451,6 +503,7 @@}},"access": {+ "section_title": "谁可以运行该智能体","tooltip": "访问权限 · 谁可以运行该智能体","trigger_private": "仅自己","trigger_workspace": "工作区",@@ -459,6 +512,9 @@"trigger_team": "团队","private_title": "私有","private_desc": "只有你可以运行该智能体",+ "shared_title": "共享",+ "shared_desc": "向整个工作区或指定成员开放该智能体",+ "shared_target_required": "保存前,请选择整个工作区或至少一名成员。","workspace_title": "公开给工作区","workspace_desc": "工作区内任何人都可以运行该智能体","members_title": "公开给指定成员",@@ -468,7 +524,7 @@"team_coming_soon": "即将推出","members_group": "成员","public_group": "公开访问",- "owner_only_readonly": "只有该 Agent 的所有者可以更改谁能调用它。",+ "owner_only_readonly": "只有该智能体的所有者可以更改谁能调用它。","members_empty": "没有可选择的工作区成员","composio_switch_hint": "提示 —— 该智能体已启用 Composio 应用。共享后,所有获得访问权限的人都可以通过该智能体使用这些应用。"},diff --git a/packages/views/projects/components/projects-page.tsx b/packages/views/projects/components/projects-page.tsxindex dbdfcb73e8..2e5ecd283e 100644--- a/packages/views/projects/components/projects-page.tsx+++ b/packages/views/projects/components/projects-page.tsx@@ -94,7 +94,11 @@ import type {ProjectStatus,UpdateProjectRequest,} from "@multica/core/types";-import { PageHeader } from "../../layout/page-header";+import {+ CollectionPageHeader,+ CollectionPageHeaderAction,+ CollectionPageState,+} from "../../layout/collection-page";import { ProjectIcon } from "./project-icon";import { useT } from "../../i18n";import { matchesPinyin } from "../../editor/extensions/pinyin-match";@@ -913,36 +917,29 @@ export function ProjectsPage() {return (// relative: positioning anchor for the page-centered batch toolbar.<div className="relative flex flex-1 min-h-0 flex-col">- <PageHeader className="justify-between px-5">- <div className="flex items-center gap-2">- <FolderKanban className="h-4 w-4 text-muted-foreground" />- <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>- {projects.length > 0 && (- <span className="font-mono text-xs tabular-nums text-muted-foreground/70">- {projects.length}- </span>- )}- </div>- <Button- size="sm"- variant="outline"- className="h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5"- aria-label={t(($) => $.page.new_project)}- onClick={openCreateProject}- >- <Plus className="h-3.5 w-3.5" />- <span className="hidden md:inline">{t(($) => $.page.new_project)}</span>- </Button>- </PageHeader>+ <CollectionPageHeader+ icon={FolderKanban}+ title={t(($) => $.page.title)}+ count={projects.length}+ actions={+ <CollectionPageHeaderAction+ icon={Plus}+ label={t(($) => $.page.new_project)}+ onClick={openCreateProject}+ />+ }+ />{showEmpty ? (- <div className="flex flex-1 flex-col items-center justify-center py-24 text-muted-foreground">- <FolderKanban className="mb-3 h-10 w-10 opacity-30" />- <p className="text-sm">{t(($) => $.page.empty)}</p>- <Button size="sm" variant="outline" className="mt-3" onClick={openCreateProject}>- {t(($) => $.page.create_first)}- </Button>- </div>+ <CollectionPageState+ icon={FolderKanban}+ title={t(($) => $.page.empty)}+ actions={+ <Button size="sm" variant="outline" onClick={openCreateProject}>+ {t(($) => $.page.create_first)}+ </Button>+ }+ />) : (<>{/* Toolbar */}@@ -953,6 +950,7 @@ export function ProjectsPage() {<Inputvalue={search}onChange={(e) => setSearch(e.target.value)}+ aria-label={t(($) => $.page.search_placeholder)}placeholder={t(($) => $.page.search_placeholder)}className="h-8 w-56 pl-8 text-sm"/>diff --git a/packages/views/runtimes/components/runtimes-page.tsx b/packages/views/runtimes/components/runtimes-page.tsxindex acff03dfed..4ba3a94dac 100644--- a/packages/views/runtimes/components/runtimes-page.tsx+++ b/packages/views/runtimes/components/runtimes-page.tsx@@ -29,6 +29,11 @@ import {import { Skeleton } from "@multica/ui/components/ui/skeleton";import { useIsMobile } from "@multica/ui/hooks/use-mobile";import { cn } from "@multica/ui/lib/utils";+import {+ CollectionPageHeader,+ CollectionPageHeaderAction,+ CollectionPageState,+} from "../../layout/collection-page";import { PageHeader } from "../../layout/page-header";import { ConnectRemoteDialog } from "./connect-remote-dialog";import { CloudRuntimeDialog } from "./cloud-runtime-dialog";@@ -408,66 +413,34 @@ function PageHeaderBar({}) {const { t } = useT("runtimes");return (- <PageHeader className="justify-between px-5">- <div className="flex items-center gap-2">- <Server className="h-4 w-4 text-muted-foreground" />- <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>- {totalCount > 0 && (- <span className="font-mono text-xs tabular-nums text-muted-foreground/70">- {totalCount}- </span>- )}- </div>- {/* Quiet chrome buttons (outline, icon-only below md) — primary is- reserved for the empty state's CTA. All three share the same- dimensions, padding, and responsive icon-only behavior so the- header reads as a single, consistent action group. */}- <div className="flex shrink-0 flex-wrap items-center justify-end gap-2">- {canManageProfiles && (- <Button- type="button"- size="sm"- variant="outline"- className="h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5"- aria-label={t(($) => $.profiles.cta)}- onClick={onAddRuntime}- >- <Plus className="h-3.5 w-3.5" />- <span className="hidden md:inline">- {t(($) => $.profiles.cta)}- </span>- </Button>- )}- {cloudRuntimeEnabled && (- <Button- type="button"- size="sm"- variant="outline"- className="h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5"- aria-label={t(($) => $.cloud_runtime.action)}- onClick={onOpenCloudRuntime}- >- <Cloud className="h-3.5 w-3.5" />- <span className="hidden md:inline">- {t(($) => $.cloud_runtime.action)}- </span>- </Button>- )}- <Button- type="button"- size="sm"- variant="outline"- className="h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5"- aria-label={t(($) => $.page.connect_remote)}- onClick={onConnectRemote}- >- <Plus className="h-3.5 w-3.5" />- <span className="hidden md:inline">- {t(($) => $.page.connect_remote)}- </span>- </Button>- </div>- </PageHeader>+ <CollectionPageHeader+ icon={Server}+ title={t(($) => $.page.title)}+ count={totalCount}+ actions={+ <>+ {canManageProfiles && (+ <CollectionPageHeaderAction+ icon={Plus}+ label={t(($) => $.profiles.cta)}+ onClick={onAddRuntime}+ />+ )}+ {cloudRuntimeEnabled && (+ <CollectionPageHeaderAction+ icon={Cloud}+ label={t(($) => $.cloud_runtime.action)}+ onClick={onOpenCloudRuntime}+ />+ )}+ <CollectionPageHeaderAction+ icon={Plus}+ label={t(($) => $.page.connect_remote)}+ onClick={onConnectRemote}+ />+ </>+ }+ />);}@@ -526,6 +499,7 @@ function MachineSidebar({<Inputvalue={search}onChange={(event) => setSearch(event.target.value)}+ aria-label={t(($) => $.machine.search_placeholder)}placeholder={t(($) => $.machine.search_placeholder)}className="h-9 pl-8 text-sm"/>@@ -858,24 +832,17 @@ function MachineDetail({function EmptyState({ onConnectRemote }: { onConnectRemote: () => void }) {const { t } = useT("runtimes");return (- <div className="flex flex-1 flex-col items-center justify-center px-6 py-16 text-center">- <div className="flex h-12 w-12 items-center justify-center rounded-full bg-muted">- <Server className="h-6 w-6 text-muted-foreground" />- </div>- <h2 className="mt-4 text-base font-semibold">{t(($) => $.page.empty.title)}</h2>- <p className="mt-1 max-w-md text-sm text-muted-foreground">- {t(($) => $.page.empty.hint)}- </p>- <Button- type="button"- size="sm"- onClick={onConnectRemote}- className="mt-5"- >- <Plus className="h-3 w-3" />- {t(($) => $.page.connect_remote)}- </Button>- </div>+ <CollectionPageState+ icon={Server}+ title={t(($) => $.page.empty.title)}+ description={t(($) => $.page.empty.hint)}+ actions={+ <Button type="button" size="sm" onClick={onConnectRemote}>+ <Plus aria-hidden="true" className="size-3" />+ {t(($) => $.page.connect_remote)}+ </Button>+ }+ />);}diff --git a/packages/views/skills/components/skill-list-toolbar.tsx b/packages/views/skills/components/skill-list-toolbar.tsxindex 0a927fd520..184055d11c 100644--- a/packages/views/skills/components/skill-list-toolbar.tsx+++ b/packages/views/skills/components/skill-list-toolbar.tsx@@ -188,6 +188,7 @@ export function SkillListToolbar({<Inputvalue={search}onChange={(e) => onSearchChange(e.target.value)}+ aria-label={t(($) => $.page.search_placeholder)}placeholder={t(($) => $.page.search_placeholder)}className="h-8 w-64 pl-8 text-sm"/>diff --git a/packages/views/skills/components/skills-page.tsx b/packages/views/skills/components/skills-page.tsxindex 86baba8338..4e40e69ca7 100644--- a/packages/views/skills/components/skills-page.tsx+++ b/packages/views/skills/components/skills-page.tsx@@ -51,7 +51,11 @@ import {} from "@multica/ui/components/ui/tooltip";import { ActorAvatar } from "@multica/ui/components/common/actor-avatar";import { useNavigation, useRowLink } from "../../navigation";-import { PageHeader } from "../../layout/page-header";+import {+ CollectionPageHeader,+ CollectionPageHeaderAction,+ CollectionPageState,+} from "../../layout/collection-page";import { canEditSkill } from "../hooks/use-can-edit-skill";import { readOrigin, type OriginInfo } from "../lib/origin";import { CreateSkillDialog } from "./create-skill-dialog";@@ -168,41 +172,23 @@ function PageHeaderBar({}) {const { t } = useT("skills");return (- <PageHeader className="justify-between px-5">- <div className="flex items-center gap-2">- <BookOpen className="h-4 w-4 text-muted-foreground" />- <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>- {totalCount > 0 && (- <span className="font-mono text-xs tabular-nums text-muted-foreground/70">- {totalCount}- </span>- )}- <p className="ml-2 hidden text-xs text-muted-foreground md:block">- {t(($) => $.page.tagline)}{" "}- <a- href="https://multica.ai/docs/skills"- target="_blank"- rel="noopener noreferrer"- className="underline decoration-muted-foreground/30 underline-offset-4 transition-colors hover:text-foreground"- >- {t(($) => $.page.learn_more)}- </a>- </p>- </div>- {/* Quiet chrome button (outline, icon-only below md) — primary is- reserved for the empty state's single CTA. */}- <Button- type="button"- size="sm"- variant="outline"- className="h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5"- aria-label={t(($) => $.page.new_skill)}- onClick={onCreate}- >- <Plus className="h-3.5 w-3.5" />- <span className="hidden md:inline">{t(($) => $.page.new_skill)}</span>- </Button>- </PageHeader>+ <CollectionPageHeader+ icon={BookOpen}+ title={t(($) => $.page.title)}+ count={totalCount}+ description={t(($) => $.page.tagline)}+ learnMore={{+ href: "https://multica.ai/docs/skills",+ label: t(($) => $.page.learn_more),+ }}+ actions={+ <CollectionPageHeaderAction+ icon={Plus}+ label={t(($) => $.page.new_skill)}+ onClick={onCreate}+ />+ }+ />);}@@ -397,19 +383,17 @@ function CreatorCell({ creator }: { creator: MemberWithUser | null }) {function EmptyState({ onCreate }: { onCreate: () => void }) {const { t } = useT("skills");return (- <div className="flex flex-1 flex-col items-center justify-center px-6 py-16 text-center">- <div className="flex h-12 w-12 items-center justify-center rounded-full bg-muted">- <BookOpen className="h-6 w-6 text-muted-foreground" />- </div>- <h2 className="mt-4 text-base font-semibold">{t(($) => $.page.empty.title)}</h2>- <p className="mt-1 max-w-md text-sm text-muted-foreground">- {t(($) => $.page.empty.description)}- </p>- <Button type="button" onClick={onCreate} size="sm" className="mt-5">- <Plus className="h-3 w-3" />- {t(($) => $.page.new_skill)}- </Button>- </div>+ <CollectionPageState+ icon={BookOpen}+ title={t(($) => $.page.empty.title)}+ description={t(($) => $.page.empty.description)}+ actions={+ <Button type="button" onClick={onCreate} size="sm">+ <Plus aria-hidden="true" className="size-3" />+ {t(($) => $.page.new_skill)}+ </Button>+ }+ />);}@@ -764,27 +748,27 @@ export default function SkillsPage() {return (<div className="flex flex-1 min-h-0 flex-col"><PageHeaderBar totalCount={0} onCreate={() => setCreateOpen(true)} />- <div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center">- <AlertCircle className="h-8 w-8 text-destructive" />- <div>- <p className="text-sm font-medium">- {t(($) => $.page.list_error.title)}- </p>- <p className="mt-1 text-xs text-muted-foreground">- {listError instanceof Error- ? listError.message- : t(($) => $.page.list_error.fallback)}- </p>- </div>- <Button- type="button"- variant="outline"- size="sm"- onClick={() => refetchList()}- >- {t(($) => $.page.list_error.retry)}- </Button>- </div>+ <CollectionPageState+ role="alert"+ tone="destructive"+ icon={AlertCircle}+ title={t(($) => $.page.list_error.title)}+ description={+ listError instanceof Error+ ? listError.message+ : t(($) => $.page.list_error.fallback)+ }+ actions={+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => refetchList()}+ >+ {t(($) => $.page.list_error.retry)}+ </Button>+ }+ /></div>);}diff --git a/packages/views/squads/components/squads-page.tsx b/packages/views/squads/components/squads-page.tsxindex 9ee0a3257d..15050d57ce 100644--- a/packages/views/squads/components/squads-page.tsx+++ b/packages/views/squads/components/squads-page.tsx@@ -82,7 +82,11 @@ import { ActorAvatar as ActorAvatarBase } from "@multica/ui/components/common/acimport { ActorAvatar } from "../../common/actor-avatar";import { FILTER_ITEM_CLASS, HoverCheck } from "../../common/hover-check";import { useRowLink } from "../../navigation";-import { PageHeader } from "../../layout/page-header";+import {+ CollectionPageHeader,+ CollectionPageHeaderAction,+ CollectionPageState,+} from "../../layout/collection-page";import { useT } from "../../i18n";// Column template — the simplest member of the ListGrid family (squads are@@ -887,46 +891,35 @@ export function SquadsPage() {return (<div className="flex flex-1 min-h-0 flex-col">- <PageHeader className="justify-between px-5">- <div className="flex items-center gap-2">- <Users className="h-4 w-4 text-muted-foreground" />- <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>- {squads.length > 0 && (- <span className="font-mono text-xs tabular-nums text-muted-foreground/70">- {squads.length}- </span>- )}- </div>- {/* Quiet chrome button (outline, icon-only below md) — primary is- reserved for the empty state. */}- <Button- size="sm"- variant="outline"- className="h-8 w-8 gap-1 px-0 md:w-auto md:px-2.5"- aria-label={t(($) => $.page.new_button)}- onClick={() => useModalStore.getState().open("create-squad")}- >- <Plus className="h-3.5 w-3.5" />- <span className="hidden md:inline">{t(($) => $.page.new_button)}</span>- </Button>- </PageHeader>+ <CollectionPageHeader+ icon={Users}+ title={t(($) => $.page.title)}+ count={squads.length}+ actions={+ <CollectionPageHeaderAction+ icon={Plus}+ label={t(($) => $.page.new_button)}+ onClick={() => useModalStore.getState().open("create-squad")}+ />+ }+ />{isLoading ? (<LoadingSkeleton />) : squads.length === 0 ? (- <div className="flex flex-1 flex-col items-center justify-center gap-3 py-16 text-center">- <Users className="size-10 text-muted-foreground/50" />- <p className="text-sm text-muted-foreground">- {t(($) => $.page.empty_no_squads)}- </p>- <Button- size="sm"- onClick={() => useModalStore.getState().open("create-squad")}- >- <Plus className="size-3.5" />- {t(($) => $.page.new_button)}- </Button>- </div>+ <CollectionPageState+ icon={Users}+ title={t(($) => $.page.empty_no_squads)}+ actions={+ <Button+ size="sm"+ onClick={() => useModalStore.getState().open("create-squad")}+ >+ <Plus aria-hidden="true" className="size-3.5" />+ {t(($) => $.page.new_button)}+ </Button>+ }+ />) : (<><SquadListToolbar