Skip to content

Conversation

@TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Nov 19, 2025

since we're switching towards fully controlled usages now that we don't have defaultValue anymore, it makes sense to require this on type-level. Most violations were in stories and tests, and in those cases where the value is actually irrelevant e.g. because we do a navigation, we can still explicitly pass value={undefined}

since we're switching towards fully controlled usages now that we don't have `defaultValue` anymore, it makes sense to require this on type-level. Most violations were in stories and tests, and in those cases where the value is actually irrelevant e.g. because we do a navigation, we can still explicitly pass value={undefined}
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 19, 2025
Comment on lines -137 to -140
<VisibleFocusButton
<Button
size="xs"
borderless
style={{background: filters.length > 0 ? theme.purple100 : 'transparent'}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: this didn’t work with UI2 at all so I’ve just removed it an use a regular button now. looks fine to me:

Image

if (isError) {
return (
<Tooltip title={t('Error loading span categories')}>
<CompactSelect disabled options={[]} value={undefined} onChange={onChange} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: this should probably just be a Button but 🤷‍♂️

@TkDodo TkDodo marked this pull request as ready for review November 19, 2025 17:18
@TkDodo TkDodo requested review from a team as code owners November 19, 2025 17:18
);
}

const VisibleFocusButton = styled(Button)`
Copy link
Member

Choose a reason for hiding this comment

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

❤️

<CompactSelect
grid
value={undefined}
onChange={jest.fn}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: CompactSelect test mocks created incorrectly without function call

All onChange mock assignments use jest.fn (without parentheses) instead of jest.fn() (with parentheses). This passes the jest factory function reference rather than a mock function instance, preventing call tracking. The correct pattern onChange={jest.fn()} is used in composite.spec.tsx and throughout the codebase.

Fix in Cursor Fix in Web

@TkDodo TkDodo enabled auto-merge (squash) November 19, 2025 18:19
@TkDodo TkDodo merged commit 6fcea43 into master Nov 19, 2025
47 checks passed
@TkDodo TkDodo deleted the tkdodo/ref/compact-select-required-value-and-onChange branch November 19, 2025 18:29
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.

3 participants