From e314badf1898cb54433a82cc15ada55897315087 Mon Sep 17 00:00:00 2001 From: Jiayuan Date: Fri, 3 Apr 2026 15:39:27 +0800 Subject: [PATCH] fix(web): filter archived agents from all dropdown selectors Add `!a.archived_at` check to agent filters in create-issue modal, issues-header filter panel, issue-detail assignee dropdown, and issue-detail subscriber list. assignee-picker and mention-suggestion already filter correctly. --- apps/web/features/issues/components/issue-detail.tsx | 6 +++--- apps/web/features/issues/components/issues-header.tsx | 2 +- apps/web/features/modals/create-issue.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/features/issues/components/issue-detail.tsx b/apps/web/features/issues/components/issue-detail.tsx index 4343a2ba..163d3730 100644 --- a/apps/web/features/issues/components/issue-detail.tsx +++ b/apps/web/features/issues/components/issue-detail.tsx @@ -513,7 +513,7 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo {issue.assignee_type === "member" && issue.assignee_id === m.user_id && } ))} - {agents.filter((a) => canAssignAgent(a, user?.id, currentMemberRole)).map((a) => ( + {agents.filter((a) => !a.archived_at && canAssignAgent(a, user?.id, currentMemberRole)).map((a) => ( handleUpdateField({ assignee_type: "agent", assignee_id: a.id })} @@ -742,9 +742,9 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo })} )} - {agents.length > 0 && ( + {agents.filter((a) => !a.archived_at).length > 0 && ( - {agents.map((a) => { + {agents.filter((a) => !a.archived_at).map((a) => { const sub = subscribers.find((s) => s.user_type === "agent" && s.user_id === a.id); const isSubbed = !!sub; return ( diff --git a/apps/web/features/issues/components/issues-header.tsx b/apps/web/features/issues/components/issues-header.tsx index 20556fc8..cdd25813 100644 --- a/apps/web/features/issues/components/issues-header.tsx +++ b/apps/web/features/issues/components/issues-header.tsx @@ -162,7 +162,7 @@ function ActorSubContent({ m.name.toLowerCase().includes(query), ); const filteredAgents = agents.filter((a) => - a.name.toLowerCase().includes(query), + !a.archived_at && a.name.toLowerCase().includes(query), ); const isSelected = (type: "member" | "agent", id: string) => diff --git a/apps/web/features/modals/create-issue.tsx b/apps/web/features/modals/create-issue.tsx index bc11bb46..c2d13059 100644 --- a/apps/web/features/modals/create-issue.tsx +++ b/apps/web/features/modals/create-issue.tsx @@ -99,7 +99,7 @@ export function CreateIssueModal({ onClose, data }: { onClose: () => void; data? const assigneeQuery = assigneeFilter.toLowerCase(); const filteredMembers = members.filter((m) => m.name.toLowerCase().includes(assigneeQuery)); - const filteredAgents = agents.filter((a) => a.name.toLowerCase().includes(assigneeQuery)); + const filteredAgents = agents.filter((a) => !a.archived_at && a.name.toLowerCase().includes(assigneeQuery)); const assigneeLabel = assigneeType && assigneeId