From 8a6ba1551e9240d0561b12e36fe92e6dc4bf300b Mon Sep 17 00:00:00 2001 From: Lily Shen <115414357+lilyshen0722@users.noreply.github.com> Date: Wed, 11 Nov 2026 19:35:15 -0800 Subject: [PATCH 1/2] feat(pods): add an agent from the pod's Agents fold, with the pod already chosen (F370 #5) The only way to add an agent was rail, Agents, Bring your own, then picking the pod again. The pod's Agents fold now ends with an "Add an agent" row that opens Bring your own with this pod chosen (?pod=). It shows where people can be invited, so never in a DM or an agent room. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01MDs9DPXBiwPK6RMAX2e277 --- frontend/src/i18n/locales/en.json | 1 + frontend/src/i18n/locales/zh-CN.json | 1 + frontend/src/v2/__tests__/V2Inspector.test.tsx | 12 ++++++++++++ frontend/src/v2/chat/chat-inspector.css | 17 +++++++++++++++++ frontend/src/v2/components/V2Inspector.tsx | 14 ++++++++++++++ 5 files changed, 45 insertions(+) diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index f43a3f3697..0d941db630 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -1665,6 +1665,7 @@ "ariaLabel": "Pod inspector", "close": "Close inspector", "noAgents": "no agents yet", + "addAgent": "Add an agent", "needsYou": "Needs you", "nothingOpen": "Nothing open.", "nothingWorking_one": "Nothing. {{agents}} is working.", diff --git a/frontend/src/i18n/locales/zh-CN.json b/frontend/src/i18n/locales/zh-CN.json index 755a1025a5..dda812ad2e 100644 --- a/frontend/src/i18n/locales/zh-CN.json +++ b/frontend/src/i18n/locales/zh-CN.json @@ -1658,6 +1658,7 @@ "ariaLabel": "Pod 检视器", "close": "关闭检视器", "noAgents": "暂无智能体", + "addAgent": "添加智能体", "needsYou": "需要你处理", "nothingOpen": "没有待处理项。", "nothingWorking_other": "没有需要你处理的事项。{{agents}} 正在工作。", diff --git a/frontend/src/v2/__tests__/V2Inspector.test.tsx b/frontend/src/v2/__tests__/V2Inspector.test.tsx index 7afd928892..64198d9106 100644 --- a/frontend/src/v2/__tests__/V2Inspector.test.tsx +++ b/frontend/src/v2/__tests__/V2Inspector.test.tsx @@ -426,6 +426,18 @@ describe('V2Inspector', () => { expect(mockNavigate).toHaveBeenCalledWith('/v2/agents'); }); + // F370 #5: the pod's Agents fold adds an agent with this pod already chosen, + // and only where people can be invited (never in a DM or an agent room). + test('the Agents fold adds an agent to this pod, only where invites are', () => { + const view = renderInspector(); + fireEvent.click(screen.getByTestId('inspector-add-agent')); + expect(mockNavigate).toHaveBeenCalledWith('/v2/agents/byo?pod=pod-1'); + expect(screen.getByTestId('inspector-add-agent')).toHaveTextContent('Add an agent'); + view.unmount(); + renderInspector({ onOpenInvite: undefined }); + expect(screen.queryByTestId('inspector-add-agent')).toBeNull(); + }); + test('lists this pod\'s own queue rows even when the global slice misses them', async () => { mockGet.mockImplementation((url: string) => Promise.resolve(url.startsWith('/api/activity/decision-queue?podId=pod-1') ? { items: [{ id: 'pod-row', kind: 'decision', title: 'Pod-only decision', podId: 'pod-1' }] } diff --git a/frontend/src/v2/chat/chat-inspector.css b/frontend/src/v2/chat/chat-inspector.css index 2c2072ceb3..0bb3cf4cde 100644 --- a/frontend/src/v2/chat/chat-inspector.css +++ b/frontend/src/v2/chat/chat-inspector.css @@ -279,6 +279,23 @@ background: var(--v2-surface-hover); } +/* F370 #5: the add row lines up with the agent rows; its mark is an empty + avatar slot, quieter than a face. */ +.v2-root button.v2-workspace-inspector__add-agent { grid-template-columns: 28px minmax(0, 1fr); cursor: pointer; } +.v2-root button.v2-workspace-inspector__add-agent .v2-workspace-inspector__agent-name { color: var(--v2-text-secondary); } +.v2-root button.v2-workspace-inspector__add-agent:hover .v2-workspace-inspector__agent-name { color: var(--v2-text-primary); } +.v2-workspace-inspector__add-agent-mark { + display: inline-flex; + width: 28px; + height: 28px; + box-sizing: border-box; + align-items: center; + justify-content: center; + border: 1px dashed var(--v2-text-muted); + border-radius: 4px; + color: var(--v2-text-secondary); +} + .v2-workspace-inspector__avatar.v2-avatar { width: 28px; height: 28px; diff --git a/frontend/src/v2/components/V2Inspector.tsx b/frontend/src/v2/components/V2Inspector.tsx index c78865733d..6b9378ca89 100644 --- a/frontend/src/v2/components/V2Inspector.tsx +++ b/frontend/src/v2/components/V2Inspector.tsx @@ -472,6 +472,20 @@ const V2Inspector: React.FC = ({ detail, currentUserId, onPodC ); })} + {/* F370 #5: the pod is where a person notices an agent is missing, + so the add path starts here, with this pod already chosen. + Shown where invites are: never in a DM or an agent room. */} + {onOpenInvite && ( + + )} ), agents.length > 0 && (