Repository navigation
Conversation
The asset, data-object and document tree search now offers antd's allowClear with Studio's close icon. Clearing calls onSearch('') and resets the search term and page like an empty submit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops the import/first eslint-disable comments the Sonar pre-check reports; jest.mock is hoisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped shared-component change addresses the missing control with focused regression coverage and no unresolved blocking findings.
No open issues 🎉
What changed in this PR
Verdict: LGTM. This PR addresses #3759 by adding a clear (X) button to the shared element-tree search used by assets, data objects, documents, and SDK consumers.
Changes:
- Enables Ant Design’s
allowClearwith Studio’s close icon (search-container.tsx:44–51), fixing the missing control in the owning component rather than individual tree consumers. - Reuses the close-icon styling without changing the component’s public signature. All consumers receive the additive clear control.
- Adds focused regression tests for clear-button visibility and clearing the field while resetting the search term and page (
search-container.test.tsx:61–83).
Coverage and remaining risks: The shared implementation covers all three tree types without caller-specific changes. No documentation or changelog files were changed. Tests were not rerun during this review; the PR reports successful checks, but browser verification for Assets and Documents used reduced page sizes rather than their real defaults.
| File | Description |
|---|---|
| assets/js/src/core/components/element-tree/search/search-container.tsx | Adds the shared clear control and Studio close-icon styling. |
| assets/js/src/core/components/element-tree/search/search-container.test.tsx | Tests control visibility, field clearing, and search/pagination reset. |
Review effort: Balanced



Changes in this pull request
Resolves #3759
The search field in the asset, data-object and document trees had no clear (X) button: to reset a search, the text had to be deleted by hand and submitted again.
All three trees use the shared
ElementTreeSearchContainer, which rendered antdInput.SearchwithoutallowClear. It now hasallowClearwith Studio's close icon, asSearchInputand the user tree autocomplete already do. In antd 5.22 a click on the X callsonSearch(''), which goes through the existing handler unchanged: the search term is reset and the pager goes back to page 1, exactly like an empty submit.For reviewers to weigh:
ElementTreeSearchContaineris exported in the SDK, so plugin trees that render it also get the X, with no prop to switch it off. Additive; no signature change.search-input.styles, not its full search style, so a later style change inSearchInputdoes not reach the tree search.Additional info
Tests
search-container.test.tsx(new): the X appears once there is text; clicking it clears the field and resets the search like an empty submit (term undefined, page 1). Both fail without the change.Verified
check-types,lint,npm test(1929 tests) andbuild-apppass.Not verified
The build output is not part of this PR.
🤖 Generated with Claude Code