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

[Logs UI] Fix endless scrolling to load more entries #49535

Merged
merged 2 commits into from
Oct 29, 2019

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Oct 28, 2019

Summary

Fixes #48952

Corrects a regression that broke scrolling up and down to load more entries in the logs stream.

Checklist

For maintainers

@Zacqary Zacqary added bug Fixes for quality problems that affect the customer experience v8.0.0 Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.5.0 labels Oct 28, 2019
@Zacqary Zacqary requested a review from a team October 28, 2019 20:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@Zacqary Zacqary added the release_note:skip Skip the PR/issue when compiling release notes label Oct 28, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@@ -102,6 +102,11 @@ export class ScrollableLogTextStreamView extends React.PureComponent<
targetId: null,
items: [],
};
} else if (hasItems && nextItems.length > prevState.items.length) {
Copy link
Member

Choose a reason for hiding this comment

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

Is looking at the number of items a sufficient criterion? What if the list of items is replaced by a list of the same length?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way the app is built right now, this never happens. The only time the list of items is wholly replaced is when the user jumps to a timestamp that requires all logs data to reload, which unmounts this component and replaces it with the loading screen.

However this also seems to work if I change it to (nextItems.length !== prevState.items.length || nextItems[0] !== prevState.items[0]) so that could make this fix more future-proof.

Copy link
Member

Choose a reason for hiding this comment

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

True, that shouldn't happen in the context of the app. I like your improvement, though 👍 Let's hope we find an opportunity to clean up the whole state and rendering code soon (and move to hooks and react-virtualized 😇) 🤞 I hope #49154 will give us the opportunity.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@Zacqary Zacqary merged commit 77792af into elastic:master Oct 29, 2019
@Zacqary Zacqary deleted the 48952-load-more-fix branch October 29, 2019 17:16
Zacqary added a commit to Zacqary/kibana that referenced this pull request Oct 29, 2019
* [Logs UI] Fix endless scrolling to load more entries

* Make scrollable list state update more robust
Zacqary added a commit to Zacqary/kibana that referenced this pull request Oct 29, 2019
* [Logs UI] Fix endless scrolling to load more entries

* Make scrollable list state update more robust
Zacqary added a commit that referenced this pull request Oct 30, 2019
* [Logs UI] Fix endless scrolling to load more entries

* Make scrollable list state update more robust
Zacqary added a commit that referenced this pull request Oct 30, 2019
* [Logs UI] Fix endless scrolling to load more entries

* Make scrollable list state update more robust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Logs UI Logs UI feature release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.5.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs UI] Scrolling up and down to load additional entries doesn't work
3 participants