diff --git a/app/src/components/annotation/AnnotationTooltip.tsx b/app/src/components/annotation/AnnotationTooltip.tsx index f37ded41bc..c38d097914 100644 --- a/app/src/components/annotation/AnnotationTooltip.tsx +++ b/app/src/components/annotation/AnnotationTooltip.tsx @@ -45,12 +45,14 @@ export function AnnotationTooltip({ {annotation.label || "--"} - - - kind - - {annotation.annotatorKind} - + {annotation.annotatorKind ? ( + + + annotator kind + + {annotation.annotatorKind} + + ) : null} {annotation.explanation ? ( diff --git a/app/src/components/annotation/types.ts b/app/src/components/annotation/types.ts index 0d806e7729..ff3bbd4ec9 100644 --- a/app/src/components/annotation/types.ts +++ b/app/src/components/annotation/types.ts @@ -3,5 +3,5 @@ export interface Annotation { label?: string | null; score?: number | null; explanation?: string | null; - annotatorKind: string; + annotatorKind?: string; } diff --git a/app/src/pages/project/SpanColumnSelector.tsx b/app/src/pages/project/SpanColumnSelector.tsx index 1ac5d7ee08..147f26f035 100644 --- a/app/src/pages/project/SpanColumnSelector.tsx +++ b/app/src/pages/project/SpanColumnSelector.tsx @@ -7,7 +7,7 @@ import { Dropdown, Flex, Icon, Icons, View } from "@arizeai/components"; import { useTracingContext } from "@phoenix/contexts/TracingContext"; -import { SpanColumnSelector_evaluations$key } from "./__generated__/SpanColumnSelector_evaluations.graphql"; +import { SpanColumnSelector_annotations$key } from "./__generated__/SpanColumnSelector_annotations.graphql"; const UN_HIDABLE_COLUMN_IDS = ["spanKind", "name"]; @@ -19,7 +19,7 @@ type SpanColumnSelectorProps = { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any columns: Column[]; - query: SpanColumnSelector_evaluations$key; + query: SpanColumnSelector_annotations$key; }; export function SpanColumnSelector(props: SpanColumnSelectorProps) { @@ -145,33 +145,33 @@ function ColumnSelectorMenu(props: SpanColumnSelectorProps) { function EvaluationColumnSelector({ query, }: Pick) { - const data = useFragment( + const data = useFragment( graphql` - fragment SpanColumnSelector_evaluations on Project { - spanEvaluationNames + fragment SpanColumnSelector_annotations on Project { + spanAnnotationNames } `, query ); - const evaluationVisibility = useTracingContext( - (state) => state.evaluationVisibility + const annotationColumnVisibility = useTracingContext( + (state) => state.annotationColumnVisibility ); - const setEvaluationVisibility = useTracingContext( - (state) => state.setEvaluationVisibility + const setAnnotationColumnVisibility = useTracingContext( + (state) => state.setAnnotationColumnVisibility ); const allVisible = useMemo(() => { - return data.spanEvaluationNames.every((name) => { - const stateValue = evaluationVisibility[name]; + return data.spanAnnotationNames.every((name) => { + const stateValue = annotationColumnVisibility[name]; return stateValue || false; }); - }, [evaluationVisibility, data.spanEvaluationNames]); + }, [data.spanAnnotationNames, annotationColumnVisibility]); const onToggleEvaluations = useCallback(() => { - const newVisibilityState = data.spanEvaluationNames.reduce((acc, name) => { + const newVisibilityState = data.spanAnnotationNames.reduce((acc, name) => { return { ...acc, [name]: !allVisible }; }, {}); - setEvaluationVisibility(newVisibilityState); - }, [setEvaluationVisibility, allVisible, data.spanEvaluationNames]); + setAnnotationColumnVisibility(newVisibilityState); + }, [data.spanAnnotationNames, setAnnotationColumnVisibility, allVisible]); return (
- evaluations + feedback
    - {data.spanEvaluationNames.map((name) => { - const isVisible = evaluationVisibility[name]; + {data.spanAnnotationNames.map((name) => { + const isVisible = annotationColumnVisibility[name] ?? false; return (