diff --git a/ui/src/components/ReportsToPicker.tsx b/ui/src/components/ReportsToPicker.tsx index 6ce5a40b..0de901b4 100644 --- a/ui/src/components/ReportsToPicker.tsx +++ b/ui/src/components/ReportsToPicker.tsx @@ -33,6 +33,8 @@ export function ReportsToPicker({ (a) => a.status !== "terminated" && !exclude.has(a.id), ); const current = value ? agents.find((a) => a.id === value) : null; + const terminatedManager = current?.status === "terminated"; + const unknownManager = Boolean(value && !current); return ( @@ -41,14 +43,22 @@ export function ReportsToPicker({ type="button" className={cn( "inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs hover:bg-accent/50 transition-colors", + terminatedManager && "border-amber-600/45 bg-amber-500/5", disabled && "opacity-60 cursor-not-allowed", )} disabled={disabled} > - {current ? ( + {unknownManager ? ( + <> + + Unknown manager (stale ID) + + ) : current ? ( <> - {`Reports to ${current.name}${current.status === "terminated" ? " (terminated)" : ""}`} + + {`Reports to ${current.name}${terminatedManager ? " (terminated)" : ""}`} + ) : ( <> @@ -72,6 +82,19 @@ export function ReportsToPicker({ > No manager + {terminatedManager && ( +
+ + + Current: {current.name} (terminated) + +
+ )} + {unknownManager && ( +
+ Saved manager is missing from this company. Choose a new manager or clear. +
+ )} {rows.map((a) => (