Skip to content

[Bug] TypeScript build broken on main — missing fontSize in SelectContext providers (Combobox, Autocomplete) #27434

@RajdeepKushwaha5

Description

@RajdeepKushwaha5

Affected module

UI — openmetadata-ui-core-components

Describe the bug

Hey @anuj-kumary — your recent PR #27379 (feat(ui): add font-size support to SelectItem via SelectContext, commit 48ffbba4bb) added fontSize as a required property to the SelectContext type in select.tsx. It looks like combobox.tsx and autocomplete.tsx — which also provide SelectContext — were missed in the update:

  • combobox.tsxSelectContext.Provider value={{ size }} → missing fontSize
  • autocomplete.tsxselectContextValue = useMemo(() => ({ size: 'sm' as const }), []) → missing fontSize

This causes a TypeScript compilation error on every build:

error TS2741: Property 'fontSize' is missing in type '{ size: "sm" | "md" | "lg"; }'
but required in type '{ fontSize: "xs" | "sm" | "md" | "lg" | "xl"; size: "sm" | "md" | "lg"; }'.

Impact: This is currently blocking CI for all open PRs that trigger a UI build. Since the error is on main, rebasing doesn't help.

To Reproduce

  1. Checkout main (any commit after 48ffbba4bb)
  2. Run TypeScript compilation:
    cd openmetadata-ui-core-components/src/main/resources/ui
    npx tsc --noEmit
  3. Observe the TS2741 error in combobox.tsx and autocomplete.tsx

Alternatively, check the CI status on any currently open PR — the OpenMetadata UI - CI and related checks fail with this error.

Expected behavior

All SelectContext.Provider usages should include the required fontSize property. The TypeScript build should compile without errors.

Suggested fix

Add fontSize: 'md' (the same default used in select.tsx) to both providers:

combobox.tsx:

- <SelectContext.Provider value={{ size }}>
+ <SelectContext.Provider value={{ fontSize: 'md', size }}>

autocomplete.tsx:

- const selectContextValue = useMemo(() => ({ size: 'sm' as const }), []);
+ const selectContextValue = useMemo(
+   () => ({ fontSize: 'md' as const, size: 'sm' as const }),
+   []
+ );

I have a fix PR ready — will link it here shortly.

Version

Additional context

  • The fix is a 2-line change with zero risk — just adding the missing required property with the same default value already used in select.tsx

Metadata

Metadata

Labels

safe to testAdd this label to run secure Github workflows on PRs

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions