@@ -1393,7 +1388,6 @@ function ConfigurationTab({
/* ---- Runs Tab ---- */
function RunListItem({ run, isSelected, agentId }: { run: HeartbeatRun; isSelected: boolean; agentId: string }) {
- const navigate = useNavigate();
const statusInfo = runStatusIcons[run.status] ?? { icon: Clock, color: "text-neutral-400" };
const StatusIcon = statusInfo.icon;
const metrics = runMetrics(run);
@@ -1402,12 +1396,12 @@ function RunListItem({ run, isSelected, agentId }: { run: HeartbeatRun; isSelect
: run.error ?? "";
return (
-
+
);
}
function RunsTab({ runs, companyId, agentId, selectedRunId, adapterType }: { runs: HeartbeatRun[]; companyId: string; agentId: string; selectedRunId: string | null; adapterType: string }) {
- const navigate = useNavigate();
const { isMobile } = useSidebar();
if (runs.length === 0) {
@@ -1464,13 +1457,13 @@ function RunsTab({ runs, companyId, agentId, selectedRunId, adapterType }: { run
if (selectedRun) {
return (
-
+
);
@@ -1513,7 +1506,6 @@ function RunsTab({ runs, companyId, agentId, selectedRunId, adapterType }: { run
function RunDetail({ run, adapterType }: { run: HeartbeatRun; adapterType: string }) {
const queryClient = useQueryClient();
- const navigate = useNavigate();
const metrics = runMetrics(run);
const [sessionOpen, setSessionOpen] = useState(false);
const [claudeLoginResult, setClaudeLoginResult] = useState
(null);
@@ -1758,17 +1750,17 @@ function RunDetail({ run, adapterType }: { run: HeartbeatRun; adapterType: strin
Issues Touched ({touchedIssues.length})
{touchedIssues.map((issue) => (
-
+
))}
diff --git a/ui/src/pages/Approvals.tsx b/ui/src/pages/Approvals.tsx
index bb8e856f..7fdd6ec3 100644
--- a/ui/src/pages/Approvals.tsx
+++ b/ui/src/pages/Approvals.tsx
@@ -117,7 +117,7 @@ export function Approvals() {
requesterAgent={approval.requestedByAgentId ? (agents ?? []).find((a) => a.id === approval.requestedByAgentId) ?? null : null}
onApprove={() => approveMutation.mutate(approval.id)}
onReject={() => rejectMutation.mutate(approval.id)}
- onOpen={() => navigate(`/approvals/${approval.id}`)}
+ detailLink={`/approvals/${approval.id}`}
isPending={approveMutation.isPending || rejectMutation.isPending}
/>
))}
diff --git a/ui/src/pages/Org.tsx b/ui/src/pages/Org.tsx
index b03e736d..2928e104 100644
--- a/ui/src/pages/Org.tsx
+++ b/ui/src/pages/Org.tsx
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
-import { useNavigate } from "react-router-dom";
+import { Link } from "react-router-dom";
import { useQuery } from "@tanstack/react-query";
import { agentsApi, type OrgNode } from "../api/agents";
import { useCompany } from "../context/CompanyContext";
@@ -13,16 +13,16 @@ import { cn } from "../lib/utils";
function OrgTree({
nodes,
depth = 0,
- onSelect,
+ hrefFn,
}: {
nodes: OrgNode[];
depth?: number;
- onSelect: (id: string) => void;
+ hrefFn: (id: string) => string;
}) {
return (
{nodes.map((node) => (
-
+
))}
);
@@ -31,26 +31,27 @@ function OrgTree({
function OrgTreeNode({
node,
depth,
- onSelect,
+ hrefFn,
}: {
node: OrgNode;
depth: number;
- onSelect: (id: string) => void;
+ hrefFn: (id: string) => string;
}) {
const [expanded, setExpanded] = useState(true);
const hasChildren = node.reports.length > 0;
return (
-
onSelect(node.id)}
>
{hasChildren ? (
+
{hasChildren && expanded && (
-
+
)}
);
@@ -90,7 +91,6 @@ function OrgTreeNode({
export function Org() {
const { selectedCompanyId } = useCompany();
const { setBreadcrumbs } = useBreadcrumbs();
- const navigate = useNavigate();
useEffect(() => {
setBreadcrumbs([{ label: "Org Chart" }]);
@@ -120,7 +120,7 @@ export function Org() {
{data && data.length > 0 && (
- navigate(`/agents/${id}`)} />
+ `/agents/${id}`} />
)}