[content list] Bundle performance improvements#271117
Merged
Merged
Conversation
This was referenced May 25, 2026
d08c8ae to
e6e3d0f
Compare
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
kowalczyk-krzysztof
approved these changes
May 25, 2026
Member
kowalczyk-krzysztof
left a comment
There was a problem hiding this comment.
LGTM
I wonder if maybe we could use some eslint rule (and a skill or a mention in some existing skill) for css`` optimization because it's easy to miss.
de5dd7c to
34d26e5
Compare
34d26e5 to
93717bc
Compare
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
|
clintandrewhall
added a commit
that referenced
this pull request
Jun 2, 2026
## Summary Extends `@kbn/content-list-provider-client` with a typed API for defining custom filters and sort orders that content list providers can contribute at registration time. This gives plugin-level providers first-class control over the toolbar filters their listing exposes, without having to reach into content list internals. **New public API surface (`kbn-content-list-provider-client`)** - `ContentListFilterDefinition<TItem, TValue, TOption>` — declarative filter descriptor: title, the field it targets, how to extract values from items, and the available options (either a static array or derived from a data array via `getOptionValue`/`getOptionLabel`). - `ResolvedContentListFilter` — runtime form of a filter definition with methods: `getOptions()`, `getLabelForValue()`, `normalizeValues()`, `toFieldDefinition()`. - `ContentListFilterMap` — record of resolved filters keyed by id. - `ContentListSortDefinition` / `sorting.ts` — analogous API for custom sort fields. - `CustomFilterRenderer` — React component that renders a resolved filter as an EUI `FilterGroup` button. - `useClientFilterCounts` — hook that counts how many items match each option's value against the current item set, used to populate filter option counts without a server round-trip. - `ClientStrategyContext` — context type threading filter/sort definitions into the client strategy. - Updated `provider.tsx` and `strategy.ts` to wire custom filter and sort definitions through the provider lifecycle. **Part of the `@kbn/content-list` stacked PR series:** - #271117 — performance foundations - **This PR** — custom filter/sort extension API - #271119 — render custom filters in toolbar - #271120 — migrate annotation library listing - #271121 — data view filter for annotation listing ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] [Backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) reviewed and applicable `backport:*` labels applied ### Identify risks New API surface on a shared package. No existing callers are modified; the new types are purely additive. The resolved filter/sort objects are computed inside the provider, so a misconfigured definition fails loudly at provider setup rather than silently at query time.
clintandrewhall
added a commit
that referenced
this pull request
Jun 2, 2026
## Summary Wires the custom filter/sort definitions introduced in #271118 into the content list toolbar so they render alongside the built-in filters (tags, starred, created-by, sort). **Changes** - `use_filters.ts` — reads `customFilters` from the provider client context and merges them into the resolved filter list handed to the toolbar's `FilterGroup`. - `dashboard_listing.stories.tsx` — adds a Storybook story demonstrating a dashboard listing with a custom provider filter (data view picker), serving as a live integration example and a visual regression target. - `kbn-content-list-docs` `tsconfig.json` — adds the `kbn-content-list-provider-client` reference needed by the new story. **Part of the `@kbn/content-list` stacked PR series:** - #271117 — performance foundations - #271118 — custom filter/sort extension API - **This PR** — render custom filters in toolbar - #271120 — migrate annotation library listing - #271121 — data view filter for annotation listing ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] [Backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) reviewed and applicable `backport:*` labels applied ### Identify risks Small surface change to `use_filters.ts`. Custom filters only appear when the provider registers them; listings with no custom filters are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces unnecessary re-renders and object allocations in
@kbn/content-list-tableand@kbn/content-list-toolbarto improve frame budget headroom as the content list scales.kbn-content-list-table—TableSkeletontableCssout of the component body so it isn't re-allocated on every render.bodyCellCssandheaderCellCssinlinecsscalls withuseMemo-wrapped versions, keyed oneuiThemeandcompressed.RectangleCellwrapper component (which calleduseEuiTheme()once per cell). The theme value is now threaded in from the parent and passed torenderSkeletonCellasdefaultRectangleHeight, so the hook is called exactly once for the whole skeleton regardless of row/column count.columnDescriptorsarray viauseMemoso the body-row loop reuses the same React nodes across all rows instead of re-allocating per cell.kbn-content-list-toolbar— filterscreated_by_filter,sort,starred_filter, andtag_filterfrom plain.tsmodules to.tsxto support inline JSX in filter renderers (required by follow-on work in this stack).filters/index.tsand the toolbarindex.ts.Part of the
@kbn/content-liststacked PR series:Checklist
release_note:*label is applied per the guidelinesbackport:*labels appliedIdentify risks
No user-facing behavior changes. All modifications are internal to skeleton rendering and filter module structure.