Repository navigation
[EuiFilterSelectItem] Migrate to function component - #9841
weronikaolejniczak merged 3 commits into
Conversation
|
👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually? |
|
Hi @weronikaolejniczak, thank you for confirming that #9489 was available for a community contribution. I’ve completed the implementation and marked this PR ready for review. The CLA and changelog checks are complete, and the focused tests pass on both React 17 and React 18. When convenient, could you please review it or help route it to the appropriate EUI reviewer? The community Buildkite workflow is currently awaiting approval from an Elastic organization member. Thank you! |
There was a problem hiding this comment.
Pull request overview
Migrates EuiFilterSelectItem from a class component to a hook-based function component, replacing withEuiTheme usage with useEuiTheme, and adds focused RTL coverage to validate preserved behavior for selection, tooltip, focus/scrolling, ref forwarding, disabled state, and truncation.
Changes:
- Refactored
EuiFilterSelectItemto a function component using hooks (useEffect,useRef) anduseEuiTheme. - Added RTL tests covering selection states, disabled behavior, focus/scrolling, tooltip anchoring rules, ref forwarding, and truncation.
- Added an upcoming changelog entry for the refactor.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/eui/src/components/filter_group/filter_select_item.tsx | Converts the component to hooks and swaps theme HOC usage for useEuiTheme. |
| packages/eui/src/components/filter_group/filter_select_item.test.tsx | Adds/updates RTL tests for key behavioral guarantees (focus/scroll, tooltip, selection states, refs, truncation). |
| packages/eui/changelogs/upcoming/9841.md | Documents the internal refactor in the upcoming changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
buildkite test this |
💚 Build Succeeded
|
💚 Build Succeeded
|
|
Hi @weronikaolejniczak, all three Buildkite builds have now passed, including the visual regression tests. When convenient, could you please continue the review and apply the skip-changelog label you mentioned earlier? Thank you! |
weronikaolejniczak
left a comment
There was a problem hiding this comment.
LGTM! 🟢 This is a great contribution, thank you @HuzaifaAbdulRehman 🙏🏻
I'll leave this unmerged for now. No need to rebase onto main unless there are conflicts. We try to keep our releases scoped.
Summary
EuiFilterSelectItemfrom a class component to a function component using hooks.withEuiThemewithuseEuiTheme.Fixes #9489.
API Changes
None. The existing public API and behavior are preserved.
Screenshots
Not applicable. This is an internal refactor with no intended visual changes.
Impact Assessment
Impact level: Low
Release Readiness
Documentation: Not applicable; there are no API or behavior changes.Figma: Not applicable; there are no visual changes.Migration guide: Not applicable; the public API is unchanged.Adoption plan: Not applicable; this refactors an existing component.QA instructions for reviewer
yarn test-unit src/components/filter_group/filter_select_item.test.tsx --runInBand --react-version=17yarn test-unit src/components/filter_group/filter_select_item.test.tsx --runInBand --react-version=18yarn tsc --noEmitpasses.Validation completed
git diff --check: passed.Checklist before marking Ready for Review
QA: Broad browser, visual, mobile, keyboard, and screen-reader testing is not applicable because rendered behavior and markup are preserved.QA: CodeSandbox and Kibana testing is not applicable for this internal refactor with no public API or visual changes.QA: No documentation changes.Breaking changes: Not applicable.Reviewer checklist