Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Added context aware logic for logs view in discover to show Load More… #211176

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

achyutjhunjhunwala
Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala commented Feb 14, 2025

Summary

Closes - #166679

What's included ?

  • The PR adds a feature in Logs View of Observability (to start with) to hide the regular pagination toolbar from the footer and show Load More only when the user has scrolled to the bottom of the page.
  • The table would always load the items in batches of default set 500
  • This PR also add 2 helper functions useThrottleFn and useDebounceFn. Current React help library which KIbana uses called -react-use does not have these and we cannot use Lodash variant of these. We need such hooks which are React safe. Hence added these 2

What's pending ?

  • Unit tests for the 2 new helper React hooks
  • Unit tests for data table footer component
  • Unit tests for Profile Resolution
  • Functional Serverless Tests
  • Functional Stateful Tests

Feb-14-2025 15-25-18

… for pagination rather than regular page number based pagination
@achyutjhunjhunwala achyutjhunjhunwala added release_note:feature Makes this part of the condensed release notes Team:obs-ux-logs Observability Logs User Experience Team labels Feb 14, 2025
@achyutjhunjhunwala achyutjhunjhunwala self-assigned this Feb 14, 2025
@achyutjhunjhunwala achyutjhunjhunwala requested review from a team as code owners February 14, 2025 09:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@achyutjhunjhunwala achyutjhunjhunwala marked this pull request as draft February 14, 2025 09:46
@achyutjhunjhunwala achyutjhunjhunwala added the backport:skip This commit does not require backporting label Feb 14, 2025
@kertal kertal added Feature:Discover Discover Application Project:OneDiscover Enrich Discover with contextual awareness labels Feb 17, 2025
Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

I gave this a spin locally, and it's working well overall, but I am noticing that UI flickering I was referring to in the issue when scrolling to the point where the footer is toggled. It's a bit harder to hit using debounce vs throttle, but still there:
flicker

I'm also not really a fan of the debounce effect in general. It makes things feel laggy and delayed while scrolling IMO. Is there a particular reason to use it over throttle?

@achyutjhunjhunwala
Copy link
Contributor Author

I'm also not really a fan of the debounce effect in general. It makes things feel laggy and delayed while scrolling IMO. Is there a particular reason to use it over throttle?

@davismcphee I was initially using debounce and then after reading your previous comment i gave it another thought and changed it to throttle . if you look at the code, i am still calling the variable throttledHandleItemsRendered but forgot to change the actual function call from useDebounce to useThrottle. I will update it.

https://github.com/achyutjhunjhunwala/kibana/blob/b1ed427645d2f091da94f49a9f5a189de4c1db94/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx#L1165

@achyutjhunjhunwala achyutjhunjhunwala marked this pull request as ready for review February 21, 2025 08:24
@achyutjhunjhunwala achyutjhunjhunwala requested review from a team as code owners February 21, 2025 08:24
Copy link
Contributor

@logeekal logeekal left a comment

Choose a reason for hiding this comment

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

Code Review and Desk Testing LGTM from investigations side. Just added couple of small comments.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1661 1666 +5
cloudSecurityPosture 705 722 +17
controls 369 376 +7
discover 1020 1025 +5
esqlDataGrid 443 460 +17
infra 1197 1203 +6
inventory 226 232 +6
investigateApp 256 263 +7
lens 1696 1710 +14
maps 1258 1265 +7
presentationPanel 111 117 +6
securitySolution 7110 7117 +7
slo 918 935 +17
streamsApp 316 323 +7
visualizations 506 511 +5
total +133

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/react-hooks 19 25 +6
@kbn/unified-data-table 107 109 +2
total +8

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cloudSecurityPosture 503.7KB 504.9KB +1.2KB
discover 810.8KB 811.7KB +1003.0B
esqlDataGrid 174.0KB 175.2KB +1.2KB
securitySolution 8.9MB 8.9MB +1.2KB
slo 795.6KB 796.8KB +1.2KB
total +5.7KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/react-hooks 0 2 +2

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cloudSecurityPosture 16.9KB 16.9KB -1.0B
Unknown metric groups

API count

id before after diff
@kbn/react-hooks 20 26 +6
@kbn/unified-data-table 185 188 +3
total +9

History

cc @achyutjhunjhunwala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Discover Discover Application Project:OneDiscover Enrich Discover with contextual awareness release_note:feature Makes this part of the condensed release notes Team:obs-ux-logs Observability Logs User Experience Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants