diff --git a/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx b/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx
index a843efcd3870..7174a9eae830 100644
--- a/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx
+++ b/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx
@@ -13,6 +13,7 @@ import React, { useEffect, useState } from 'react';
export enum ResultStatus {
UNINITIALIZED = 'uninitialized',
LOADING = 'loading', // initial data load
+ LOADING_MORE = 'loading_more', // loading additional data while existing results are presents
READY = 'ready', // results came back
NO_RESULTS = 'none', // no results came back
ERROR = 'error', // error occurred
@@ -59,23 +60,12 @@ export function QueryResult(props: { queryStatus: QueryStatus }) {
};
}, [props.queryStatus.startTime]);
- if (elapsedTime > BUFFER_TIME) {
- if (props.queryStatus.status === ResultStatus.LOADING) {
- const time = Math.floor(elapsedTime / 1000);
- return (
- {}}
- isLoading
- data-test-subj="queryResultLoading"
- >
- {i18n.translate('data.query.languageService.queryResults.loadTime', {
- defaultMessage: 'Loading {time} s',
- values: { time },
- })}
-
- );
+ if (
+ props.queryStatus.status === ResultStatus.LOADING ||
+ props.queryStatus.status === ResultStatus.LOADING_MORE
+ ) {
+ if (elapsedTime < BUFFER_TIME) {
+ return null;
}
const time = Math.floor(elapsedTime / 1000);
return (
diff --git a/src/plugins/data/public/ui/query_editor/editors/shared.tsx b/src/plugins/data/public/ui/query_editor/editors/shared.tsx
index 76ec959f7a4c..fb5df10c65c9 100644
--- a/src/plugins/data/public/ui/query_editor/editors/shared.tsx
+++ b/src/plugins/data/public/ui/query_editor/editors/shared.tsx
@@ -124,6 +124,7 @@ export const SingleLineInput: React.FC = ({
lineDecorationsWidth: 0,
scrollbar: {
vertical: 'hidden',
+ horizontalScrollbarSize: 1,
},
overviewRulerLanes: 0,
hideCursorInOverviewRuler: true,
diff --git a/src/plugins/discover/public/application/view_components/utils/use_search.ts b/src/plugins/discover/public/application/view_components/utils/use_search.ts
index 7184bc3f1090..ee75169abe18 100644
--- a/src/plugins/discover/public/application/view_components/utils/use_search.ts
+++ b/src/plugins/discover/public/application/view_components/utils/use_search.ts
@@ -38,6 +38,7 @@ import { trackQueryMetric } from '../../../ui_metric';
export enum ResultStatus {
UNINITIALIZED = 'uninitialized',
LOADING = 'loading', // initial data load
+ LOADING_MORE = 'loading_more', // loading additional data while existing results are present
READY = 'ready', // results came back
NO_RESULTS = 'none', // no results came back
ERROR = 'error', // error occurred
@@ -150,6 +151,7 @@ export const useSearch = (services: DiscoverViewServices) => {
if (!dataset) {
data$.next({
status: shouldSearchOnPageLoad() ? ResultStatus.LOADING : ResultStatus.UNINITIALIZED,
+ queryStatus: { startTime },
});
return;
}
@@ -181,7 +183,9 @@ export const useSearch = (services: DiscoverViewServices) => {
try {
// Only show loading indicator if we are fetching when the rows are empty
if (fetchStateRef.current.rows?.length === 0) {
- data$.next({ status: ResultStatus.LOADING });
+ data$.next({ status: ResultStatus.LOADING, queryStatus: { startTime } });
+ } else {
+ data$.next({ status: ResultStatus.LOADING_MORE, queryStatus: { startTime } });
}
// Initialize inspect adapter for search source
@@ -293,6 +297,7 @@ export const useSearch = (services: DiscoverViewServices) => {
toastNotifications,
interval,
data,
+ startTime,
services,
sort,
savedSearch?.searchSource,