[Streams 🌊] Listing and overview page improvements#223603
[Streams 🌊] Listing and overview page improvements#223603rStelmach merged 18 commits intoelastic:mainfrom
Conversation
…anage streams tabs
…ace old images with new ones
|
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
...s_app/public/components/data_management/stream_detail_management/ingest_pipeline_details.tsx
Outdated
Show resolved
Hide resolved
...ns/shared/streams_app/public/components/data_management/stream_detail_management/wrapper.tsx
Outdated
Show resolved
Hide resolved
| <EuiToolTip | ||
| position="top" | ||
| title={i18n.translate('xpack.streams.badges.classic.title', { | ||
| defaultMessage: 'Classic Stream', | ||
| })} | ||
| content={i18n.translate('xpack.streams.badges.classic.description', { | ||
| defaultMessage: | ||
| 'Classic streams are based on existing data streams and may not support all Streams features like custom re-routing', | ||
| })} | ||
| > | ||
| <ClassicStreamBadge /> | ||
| </EuiToolTip> |
There was a problem hiding this comment.
Could the tooltip be part of the badge so we get it for free wherever we display it?
There was a problem hiding this comment.
My bad, I removed it only from index. Right now it's removed also from wrapper.
I left the wrapped tooltip around <LifecycleBadge>, I think it's cleaner than placing the wrapper in every if case inside the component, but let me know if you think that it should be done the same way.
.../platform/plugins/shared/streams_app/public/components/stream_list_view/documents_column.tsx
Outdated
Show resolved
Hide resolved
| `} | ||
| > | ||
| <EuiI18nNumber value={docCount} /> | ||
| {hasData ? <EuiI18nNumber value={docCount} /> : 'N/A'} |
There was a problem hiding this comment.
N/A should be translated
...m/plugins/shared/streams_app/public/components/stream_list_view/streams_list_empty_state.tsx
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/streams_app/public/components/stream_list_view/tree_table.tsx
Outdated
Show resolved
Hide resolved
| const sortedRoots = React.useMemo(() => { | ||
| return [...enrichedTree].sort((a, b) => { | ||
| const av = a[sortField]; | ||
| const bv = b[sortField]; | ||
| if (typeof av === 'string' && typeof bv === 'string') { | ||
| return sortDirection === 'asc' ? av.localeCompare(bv) : bv.localeCompare(av); | ||
| } | ||
| if (typeof av === 'number' && typeof bv === 'number') { | ||
| return sortDirection === 'asc' ? av - bv : bv - av; | ||
| } | ||
| return 0; | ||
| }); | ||
| }, [enrichedTree, sortField, sortDirection]); |
There was a problem hiding this comment.
The sorting is still broken. The name column has the same issue we discussed for the documents column in that it only sorts root level streams.
There was a problem hiding this comment.
Right now it should work
There was a problem hiding this comment.
With the current logic we start off with a flat list of streams (coming from GET /internal/streams). We are then turning that into a deeply nested object, walking over the entire tree structure to sort nodes and then walking over the entire structure again to flatten it back to a flat list and enrich it with meta data.
Is all that necessary or can we optimise the code to reduce complexity?
I think we should be able to derive any required fields we need in a single iteration and then let EuiMemoryTable handle the sorting:
const enrichedStreams = streamsResponse.map(enrichWithMetaDataAndSortKeys)
What do you think?
There was a problem hiding this comment.
I tried to do it in a single iteration and pass it to EuiMemoryTable but that component is unaware of parent/child boundaries, and it mixes children from different roots.
I tried to simplified the logic. Now items is built in a single depth-first walk that flattens the tree and adds level + root-level meta in one go.
What do you think of this change ? Is it a bit cleaner?
| })}{' '} | ||
| <EuiLink | ||
| target="_blank" | ||
| href="https://www.elastic.co/docs/solutions/observability/logs/streams/streams" |
There was a problem hiding this comment.
Can we use the doc links service instead?
x-pack/platform/plugins/shared/streams_app/public/components/stream_list_view/index.tsx
Show resolved
Hide resolved
…dges to wrap lifecycle badge
thomheymann
left a comment
There was a problem hiding this comment.
Thanks, the code looks good and much clearer now.
For the unit tests, I don't think we need to be clever here or try and make this dry.
The function is supposed to sort an entire list of streams so our assertions should also verify the entire list. If you start filtering you create blind spots where the sort order will not be tested correctly.
We need the following 4 test scenarios:
- Sort by name (asc)
- Sort by name (desc)
- Sort by retention time (asc)
- Sort by retention time (desc)
We need to check that the full list has been sorted correctly, not just parts.
| const rows = buildStreamRows(allStreams, 'nameSortKey', 'asc' as Direction); | ||
| expect(rows.map((r) => r.name)).toEqual([ | ||
| 'logs-a', | ||
| 'logs-a.child1', | ||
| 'logs-a.child2', | ||
| 'logs-a.child3', | ||
| 'logs-b', | ||
| 'logs-b.child1', | ||
| 'logs-b.child2', | ||
| 'logs-b.child3', | ||
| 'metrics-c', | ||
| 'metrics-c.child1', | ||
| 'metrics-c.child2', | ||
| 'metrics-c.child3', | ||
| ]); |
There was a problem hiding this comment.
Can you add a case for desc order?
| expect(rows.map((r) => r.name).slice(0, 5)).toEqual([ | ||
| 'logs-b', | ||
| 'logs-b.child3', | ||
| 'logs-b.child2', | ||
| 'logs-b.child1', | ||
| 'metrics-c', | ||
| ]); |
There was a problem hiding this comment.
Why are you slicing the result?
It's quite hard to see what the expected behaviour here is without seeing the retention time. Can you include that? (e.g. rows.map((r) => ${r.name} (${retentionTime})))
| it('children are sorted by retention asc inside each root', () => { | ||
| const rows = buildStreamRows(allStreams, 'retentionMs', 'asc' as Direction); | ||
| const aChildren = rows | ||
| .filter((r) => r.name.startsWith('logs-a.') && r.level === 1) | ||
| .map((r) => r.name); | ||
| expect(aChildren).toEqual(['logs-a.child2', 'logs-a.child3', 'logs-a.child1']); | ||
| }); |
There was a problem hiding this comment.
What is this assertion checking?
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsasync chunk count
miscellaneous assets size
History
|
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15779974687 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## 📝 Summary Closes: [elastic#238](elastic/streams-program#238) This pull request introduces enhancements to the classic streams, focusing on visual updates, improved user interface elements, and the addition of new assets. Things that were done in this PR : - Improve page template to have transparent background and short description - Replaced old images with new ones - Introduced new empty state for streams list - Added sorting to streams list table - Improved loading indicators - Aligned streams tree table with designs and added loading indicators - Added tooltips to modify streams tabs as well as retention badge and stream-type badge - Modified `Component templates` table according to new designs ## 🎨 Previews Empty State Before:  Empty State After:  Streams List with no data Before:  Streams List with no data After:  Streams List Before:  Streams List After:  Component Templates Before:  Component Templates After:  ### Small demo of streams being loaded https://github.com/user-attachments/assets/f4a9ec48-ee01-4791-b874-03afeb7f719a ## 🔧 How to test - In dev console in kibana run POST kbn:/api/streams/_enable. This will enable the streams UI and put mappings and pipelines for the main logs stream into place - Reload the page - Navigate to the streams app in navigation - Ingesting data through synthrace: `node scripts/synthtrace.js sample_logs --live --kibana=http://elastic:changeme@localhost:5601 --target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000` For more info check this [README](https://github.com/elastic/streams-program) file Also please check the [issue and discussion](elastic/streams-program#238) for more context ## ❓ Discussion if you think that there is something else that needs improvements for classic streams, let me know so we can include it in this PR ## 🖌 Designs [Figma](https://www.figma.com/design/MgwQzRrh2CWFSE711GEW1o/Streams-Index-and-Onboarding?node-id=1343-139771&m=dev&focus-id=1344-51082) [New Images ](https://elasticsearch.app.box.com/s/37d3su7j500n9ax6666pv1hbckycjjr0/folder/319936922134) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 4741e67) # Conflicts: # src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts # x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_management/wired.tsx # x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_management/wrapper.tsx # x-pack/platform/plugins/shared/streams_app/public/components/stream_badges/index.tsx # x-pack/platform/plugins/shared/streams_app/tsconfig.json
…224715) # Backport This will backport the following commits from `main` to `8.19`: - [[Streams 🌊] Listing and overview page improvements (#223603)](#223603) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Robert Stelmach","email":"60304951+rStelmach@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-20T13:24:17Z","message":"[Streams 🌊] Listing and overview page improvements (#223603)\n\n## 📝 Summary\nCloses: [#238](https://github.com/elastic/streams-program/issues/238)\n\nThis pull request introduces enhancements to the classic streams,\nfocusing on visual updates, improved user interface elements, and the\naddition of new assets. Things that were done in this PR :\n\n- Improve page template to have transparent background and short\ndescription\n- Replaced old images with new ones\n- Introduced new empty state for streams list\n- Added sorting to streams list table \n- Improved loading indicators\n- Aligned streams tree table with designs and added loading indicators\n- Added tooltips to modify streams tabs as well as retention badge and\nstream-type badge\n- Modified `Component templates` table according to new designs\n\n\n\n## 🎨 Previews\nEmpty State Before: \nEmpty State After: \n\nStreams List with no data Before: \n\nStreams List with no data After:\n\n\n\nStreams List Before:\n\nStreams List After:\n\n\nComponent Templates Before:\n\nComponent Templates After:\n\n\n### Small demo of streams being loaded \n\n\nhttps://github.com/user-attachments/assets/f4a9ec48-ee01-4791-b874-03afeb7f719a\n\n## 🔧 How to test \n\n- In dev console in kibana run POST kbn:/api/streams/_enable. This will\nenable the streams UI and put mappings and pipelines for the main logs\nstream into place\n- Reload the page\n- Navigate to the streams app in navigation\n- Ingesting data through synthrace: `node scripts/synthtrace.js\nsample_logs --live --kibana=http://elastic:changeme@localhost:5601\n--target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000`\n\nFor more info check this\n[README](https://github.com/elastic/streams-program) file\n\nAlso please check the [issue and\ndiscussion](elastic/streams-program#238) for\nmore context\n\n## ❓ Discussion \n\nif you think that there is something else that needs improvements for\nclassic streams, let me know so we can include it in this PR\n\n## 🖌 Designs \n\n[Figma](https://www.figma.com/design/MgwQzRrh2CWFSE711GEW1o/Streams-Index-and-Onboarding?node-id=1343-139771&m=dev&focus-id=1344-51082)\n[New Images\n\n](https://elasticsearch.app.box.com/s/37d3su7j500n9ax6666pv1hbckycjjr0/folder/319936922134)\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"4741e67d5cc549ff7070b8e1101c59228e01f86c","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:obs-ux-logs","backport:version","Feature:Streams","v9.1.0","v8.19.0"],"title":"[Streams 🌊] Listing and overview page improvements","number":223603,"url":"https://github.com/elastic/kibana/pull/223603","mergeCommit":{"message":"[Streams 🌊] Listing and overview page improvements (#223603)\n\n## 📝 Summary\nCloses: [#238](https://github.com/elastic/streams-program/issues/238)\n\nThis pull request introduces enhancements to the classic streams,\nfocusing on visual updates, improved user interface elements, and the\naddition of new assets. Things that were done in this PR :\n\n- Improve page template to have transparent background and short\ndescription\n- Replaced old images with new ones\n- Introduced new empty state for streams list\n- Added sorting to streams list table \n- Improved loading indicators\n- Aligned streams tree table with designs and added loading indicators\n- Added tooltips to modify streams tabs as well as retention badge and\nstream-type badge\n- Modified `Component templates` table according to new designs\n\n\n\n## 🎨 Previews\nEmpty State Before: \nEmpty State After: \n\nStreams List with no data Before: \n\nStreams List with no data After:\n\n\n\nStreams List Before:\n\nStreams List After:\n\n\nComponent Templates Before:\n\nComponent Templates After:\n\n\n### Small demo of streams being loaded \n\n\nhttps://github.com/user-attachments/assets/f4a9ec48-ee01-4791-b874-03afeb7f719a\n\n## 🔧 How to test \n\n- In dev console in kibana run POST kbn:/api/streams/_enable. This will\nenable the streams UI and put mappings and pipelines for the main logs\nstream into place\n- Reload the page\n- Navigate to the streams app in navigation\n- Ingesting data through synthrace: `node scripts/synthtrace.js\nsample_logs --live --kibana=http://elastic:changeme@localhost:5601\n--target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000`\n\nFor more info check this\n[README](https://github.com/elastic/streams-program) file\n\nAlso please check the [issue and\ndiscussion](elastic/streams-program#238) for\nmore context\n\n## ❓ Discussion \n\nif you think that there is something else that needs improvements for\nclassic streams, let me know so we can include it in this PR\n\n## 🖌 Designs \n\n[Figma](https://www.figma.com/design/MgwQzRrh2CWFSE711GEW1o/Streams-Index-and-Onboarding?node-id=1343-139771&m=dev&focus-id=1344-51082)\n[New Images\n\n](https://elasticsearch.app.box.com/s/37d3su7j500n9ax6666pv1hbckycjjr0/folder/319936922134)\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"4741e67d5cc549ff7070b8e1101c59228e01f86c"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223603","number":223603,"mergeCommit":{"message":"[Streams 🌊] Listing and overview page improvements (#223603)\n\n## 📝 Summary\nCloses: [#238](https://github.com/elastic/streams-program/issues/238)\n\nThis pull request introduces enhancements to the classic streams,\nfocusing on visual updates, improved user interface elements, and the\naddition of new assets. Things that were done in this PR :\n\n- Improve page template to have transparent background and short\ndescription\n- Replaced old images with new ones\n- Introduced new empty state for streams list\n- Added sorting to streams list table \n- Improved loading indicators\n- Aligned streams tree table with designs and added loading indicators\n- Added tooltips to modify streams tabs as well as retention badge and\nstream-type badge\n- Modified `Component templates` table according to new designs\n\n\n\n## 🎨 Previews\nEmpty State Before: \nEmpty State After: \n\nStreams List with no data Before: \n\nStreams List with no data After:\n\n\n\nStreams List Before:\n\nStreams List After:\n\n\nComponent Templates Before:\n\nComponent Templates After:\n\n\n### Small demo of streams being loaded \n\n\nhttps://github.com/user-attachments/assets/f4a9ec48-ee01-4791-b874-03afeb7f719a\n\n## 🔧 How to test \n\n- In dev console in kibana run POST kbn:/api/streams/_enable. This will\nenable the streams UI and put mappings and pipelines for the main logs\nstream into place\n- Reload the page\n- Navigate to the streams app in navigation\n- Ingesting data through synthrace: `node scripts/synthtrace.js\nsample_logs --live --kibana=http://elastic:changeme@localhost:5601\n--target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000`\n\nFor more info check this\n[README](https://github.com/elastic/streams-program) file\n\nAlso please check the [issue and\ndiscussion](elastic/streams-program#238) for\nmore context\n\n## ❓ Discussion \n\nif you think that there is something else that needs improvements for\nclassic streams, let me know so we can include it in this PR\n\n## 🖌 Designs \n\n[Figma](https://www.figma.com/design/MgwQzRrh2CWFSE711GEW1o/Streams-Index-and-Onboarding?node-id=1343-139771&m=dev&focus-id=1344-51082)\n[New Images\n\n](https://elasticsearch.app.box.com/s/37d3su7j500n9ax6666pv1hbckycjjr0/folder/319936922134)\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"4741e67d5cc549ff7070b8e1101c59228e01f86c"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## 📝 Summary Closes: [elastic#238](elastic/streams-program#238) This pull request introduces enhancements to the classic streams, focusing on visual updates, improved user interface elements, and the addition of new assets. Things that were done in this PR : - Improve page template to have transparent background and short description - Replaced old images with new ones - Introduced new empty state for streams list - Added sorting to streams list table - Improved loading indicators - Aligned streams tree table with designs and added loading indicators - Added tooltips to modify streams tabs as well as retention badge and stream-type badge - Modified `Component templates` table according to new designs ## 🎨 Previews Empty State Before:  Empty State After:  Streams List with no data Before:  Streams List with no data After:  Streams List Before:  Streams List After:  Component Templates Before:  Component Templates After:  ### Small demo of streams being loaded https://github.com/user-attachments/assets/f4a9ec48-ee01-4791-b874-03afeb7f719a ## 🔧 How to test - In dev console in kibana run POST kbn:/api/streams/_enable. This will enable the streams UI and put mappings and pipelines for the main logs stream into place - Reload the page - Navigate to the streams app in navigation - Ingesting data through synthrace: `node scripts/synthtrace.js sample_logs --live --kibana=http://elastic:changeme@localhost:5601 --target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000` For more info check this [README](https://github.com/elastic/streams-program) file Also please check the [issue and discussion](elastic/streams-program#238) for more context ## ❓ Discussion if you think that there is something else that needs improvements for classic streams, let me know so we can include it in this PR ## 🖌 Designs [Figma](https://www.figma.com/design/MgwQzRrh2CWFSE711GEW1o/Streams-Index-and-Onboarding?node-id=1343-139771&m=dev&focus-id=1344-51082) [New Images ](https://elasticsearch.app.box.com/s/37d3su7j500n9ax6666pv1hbckycjjr0/folder/319936922134) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>






📝 Summary
Closes: #238
This pull request introduces enhancements to the classic streams, focusing on visual updates, improved user interface elements, and the addition of new assets. Things that were done in this PR :
Component templatestable according to new designs🎨 Previews
Empty State Before:

Empty State After:
Streams List with no data Before:


Streams List with no data After:
Streams List Before:


Streams List After:
Component Templates Before:


Component Templates After:
Small demo of streams being loaded
loading.demo.mov
🔧 How to test
node scripts/synthtrace.js sample_logs --live --kibana=http://elastic:changeme@localhost:5601 --target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000For more info check this README file
Also please check the issue and discussion for more context
❓ Discussion
if you think that there is something else that needs improvements for classic streams, let me know so we can include it in this PR
🖌 Designs
Figma
New Images