Skip to content

Commit 8f866cf

Browse files
committed
Fix type issues
1 parent ae5030e commit 8f866cf

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

app/src/components/annotation/CategoricalAnnotationInput.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ import { AnnotationConfigCategorical } from "@phoenix/pages/settings/types";
2020
import { AnnotationInputPropsBase } from "./types";
2121

2222
type CategoricalAnnotationInputProps =
23-
AnnotationInputPropsBase<AnnotationConfigCategorical> & SelectProps;
23+
AnnotationInputPropsBase<AnnotationConfigCategorical> &
24+
Omit<
25+
SelectProps<{ label: string; score: number }, "single">,
26+
"validate" | "value" | "onChange"
27+
>;
2428

2529
export const CategoricalAnnotationInput = forwardRef<
2630
HTMLButtonElement,
@@ -35,7 +39,7 @@ export const CategoricalAnnotationInput = forwardRef<
3539
<Select
3640
id={annotationConfig.id}
3741
name={annotationConfig.name}
38-
defaultSelectedKey={annotation?.label ?? undefined}
42+
defaultValue={annotation?.label ?? undefined}
3943
size="S"
4044
{...props}
4145
css={css`

app/src/components/select/Select.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import { SizeProvider } from "@phoenix/contexts";
1111

1212
import { fieldBaseCSS } from "../field/styles";
1313

14-
export interface SelectProps<T extends object, M extends "single" | "multiple">
15-
extends AriaSelectProps<T, M>,
14+
export interface SelectProps<
15+
T extends object = object,
16+
M extends "single" | "multiple" = "single",
17+
> extends AriaSelectProps<T, M>,
1618
SizingProps,
1719
StylableProps {}
1820

app/src/components/settings/RoleSelect.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ type RoleSelectProps = {
4444
* Whether the field is invalid
4545
*/
4646
isInvalid?: boolean;
47-
} & Omit<SelectProps, "children" | "onSelectionChange" | "selectedKey">;
47+
} & Omit<
48+
SelectProps,
49+
"children" | "onSelectionChange" | "selectedKey" | "validate"
50+
>;
4851

4952
export function RoleSelect({
5053
onChange,

app/src/pages/embedding/MetricSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ export function MetricSelector({
164164
);
165165
const hasNumericDimensions = numericDimensions.length > 0;
166166
const onSelectionChange = useCallback(
167-
(key: Key | null) => {
168-
if (!key) {
167+
(key: Key | Key[] | null) => {
168+
if (!key || typeof key !== "string") {
169169
return;
170170
}
171171
const metricDefinition = parseMetricKey({

app/src/pages/playground/ModelProviderSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type ModelProviderSelectProps = {
2222
onChange: (provider: ModelProvider) => void;
2323
query: ModelProviderSelectFragment$key;
2424
provider?: ModelProvider;
25-
} & Omit<SelectProps, "children" | "onChange" | "value">;
25+
} & Omit<SelectProps, "children" | "onChange" | "value" | "validate">;
2626

2727
export function ModelProviderSelect({
2828
onChange,

0 commit comments

Comments
 (0)