From 59b0684ea16b0cd6447e8e9fea7a038f2318eafa Mon Sep 17 00:00:00 2001 From: kang Date: Wed, 3 Jun 2026 11:33:03 +0800 Subject: [PATCH] refactor(agents-console): enhance UI styling and remove unused delegation content Updated the styling of agent tree nodes for improved visual feedback on selection and hover states. Removed deprecated delegation management UI components to streamline the agents console. This refactor enhances user experience and maintains a cleaner codebase. --- src/modules/agents/agents-console.tsx | 89 ++++++--------------------- 1 file changed, 19 insertions(+), 70 deletions(-) diff --git a/src/modules/agents/agents-console.tsx b/src/modules/agents/agents-console.tsx index 42cfa5c..71abc51 100644 --- a/src/modules/agents/agents-console.tsx +++ b/src/modules/agents/agents-console.tsx @@ -148,8 +148,10 @@ function AgentTreeNodes({
  • {node.children && node.children.length > 0 ? ( @@ -157,7 +159,12 @@ function AgentTreeNodes({ type="button" aria-label="toggle children" onClick={() => onToggleExpand(node.id)} - className="ml-1 rounded-sm p-0.5 text-muted-foreground hover:bg-muted" + className={cn( + "ml-1 rounded-sm p-0.5 transition-colors", + selectedId === node.id + ? "text-primary-foreground/80 hover:bg-primary-foreground/20 hover:text-primary-foreground" + : "text-muted-foreground hover:bg-muted hover:text-foreground" + )} > onSelect(node)} className={cn( "flex min-w-0 flex-1 items-center gap-1 rounded-md py-1.5 text-left text-sm", - selectedId === node.id && "font-medium text-foreground", + selectedId === node.id ? "font-medium" : "text-foreground", )} > {node.name} - {node.code} + + {node.code} +
    {node.children && node.children.length > 0 && expandedIds.has(node.id) ? ( @@ -603,13 +615,6 @@ export function AgentsConsole(): React.ReactElement { ) : null} -
    - {t("modelGuide", { - defaultValue: - "代理层负责数据范围(Scope)与授权上限(Ceiling),账号权限请通过角色分配。", - })} -
    - {err ?

    {err}

    : null}
    @@ -704,9 +709,7 @@ export function AgentsConsole(): React.ReactElement { {canViewRoles ? {t("tabs.roles")} : null} {canViewUsers ? {t("tabs.users")} : null} - {canManageDelegation ? ( - {t("tabs.delegation")} - ) : null} + {canManageNode && !selected.is_root ? ( -
    - - ) : null} + )}