Skip to content

ref(select): Preserve value and option inference - #129017

Merged
TkDodo merged 13 commits into
masterfrom
tkdodo/ref/select-value-option-generics
Oct 29, 2026
Merged

TkDodo merged 13 commits into
masterfrom
tkdodo/ref/select-value-option-generics

Conversation

@TkDodo

@TkDodo TkDodo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

better types for Select, we now use:

<TValue, TOption extends SelectValue<TValue>>

everywhere and this doesn’t exist anymore:

export type GeneralSelectValue = SelectValue<any>;

as it was silently making value: any in a bunch of places

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 28, 2026
@TkDodo
TkDodo added this pull request to stack #129018 October 28, 2026 15:55
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-5b1bjcbix.sentry.dev

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 95.85% 95.84% 🔴 -0.01%
Typed 142,314 142,321 🟢 +7
Untyped 6,169 6,170 🔴 +1
🔍 3 new type safety issues introduced

Type assertions (as) (3 new)

File Line Detail
static/app/components/core/form/field/selectField.tsx 107 as TOption — option as TOption
static/app/components/core/select/select.tsx 638 as TOption — {value: val, label: String(val)} as TOption
static/app/components/core/select/select.tsx 737 as OptionsType<TOption> — displayOptions as OptionsType<TOption>

This is informational only and does not block the PR.

…alue-option-generics

# Conflicts:
#	static/app/components/core/select/types.tsx
Base automatically changed from tkdodo/ref/select-api-cleanup to master October 29, 2026 09:11
Keep the merged components API and preserve value and option inference.
@TkDodo

TkDodo commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9f222d9. Configure here.

const StyledSelectControl = styled(Select)`
width: 100%;
`;
` as typeof Select;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably do this with a <Container> wrapping the Select instead but I want this PR to be type-level changes only (mostly)

@priscilawebdev priscilawebdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

@TkDodo
TkDodo marked this pull request as ready for review October 29, 2026 09:41
@TkDodo
TkDodo requested review from a team as code owners October 29, 2026 09:41
@TkDodo
TkDodo requested review from a team as code owners October 29, 2026 09:41
@TkDodo
TkDodo merged commit 1d64f63 into master Oct 29, 2026
84 checks passed
@TkDodo
TkDodo deleted the tkdodo/ref/select-value-option-generics branch October 29, 2026 09:41

This branch was successfully deployed

1 active deployment
Preview — 9f222d91 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants