Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b55347c
First attempt
Heenawter Oct 23, 2025
e960a02
Clean up fetch
Heenawter Oct 23, 2025
b840ad3
More cleanup
Heenawter Oct 23, 2025
8fc5e90
Fix not hitting cache
Heenawter Oct 23, 2025
d92dead
Fix hook
Heenawter Oct 23, 2025
c47cdd9
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Oct 23, 2025
e8f0c49
Start fixing tests
Heenawter Oct 23, 2025
2c8e1df
Merge branch 'decouple-fetch-and-search-sessions_2025-10-23' of githu…
Heenawter Oct 23, 2025
5d51146
Fix more tests
Heenawter Oct 27, 2025
8efa926
Small test cleanups
Heenawter Oct 27, 2025
a7dcf78
Fix types
Heenawter Oct 27, 2025
0054eab
Fix other jest tests
Heenawter Oct 27, 2025
9c3909a
Fix reload
Heenawter Oct 27, 2025
12dc971
More reload cleanup
Heenawter Oct 27, 2025
6e2af76
Remove exclusive test
Heenawter Oct 27, 2025
15abe43
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Oct 27, 2025
db5b84a
Fix Discover
Heenawter Oct 28, 2025
affb517
Remove unused variable
Heenawter Oct 28, 2025
08ccf22
Fix tests
Heenawter Oct 28, 2025
c0a2f08
Merge branch 'main' into decouple-fetch-and-search-sessions_2025-10-23
Heenawter Oct 28, 2025
5b5f0ba
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Oct 28, 2025
b92c03e
remove unused `timeRange` code
Heenawter Oct 29, 2025
dae4f42
Address feedback
Heenawter Oct 29, 2025
1c4c3f1
Fix missed type
Heenawter Oct 29, 2025
d0a60b9
Fix missed `lastReloadRequestTime$`
Heenawter Oct 30, 2025
7cfa8c3
Revert "Fix missed `lastReloadRequestTime$`"
Heenawter Oct 30, 2025
359638a
Merge branch 'main' into decouple-fetch-and-search-sessions_2025-10-23
Heenawter Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export interface UnifiedHistogramChartProps {
isPlainRecord?: boolean;
lensVisService: LensVisService;
relativeTimeRange?: TimeRange;
lastReloadRequestTime?: number;
request?: UnifiedHistogramRequestContext;
hits?: UnifiedHistogramHitsContext;
chart?: UnifiedHistogramChartContext;
Expand Down Expand Up @@ -104,6 +105,7 @@ export function UnifiedHistogramChart({
dataView,
requestParams,
relativeTimeRange: originalRelativeTimeRange,
lastReloadRequestTime,
request,
hits,
chart,
Expand Down Expand Up @@ -223,6 +225,7 @@ export function UnifiedHistogramChart({
visContext,
esqlVariables,
onLoad,
lastReloadRequestTime,
});

const { chartToolbarCss, histogramCss } = useChartStyles(chartVisible);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type LensProps = Pick<
| 'searchSessionId'
| 'executionContext'
| 'onLoad'
| 'lastReloadRequestTime'
>;

export const useLensProps = ({
Expand All @@ -40,13 +41,15 @@ export const useLensProps = ({
visContext,
esqlVariables,
onLoad,
lastReloadRequestTime,
}: {
request?: UnifiedHistogramRequestContext;
getTimeRange: () => TimeRange;
fetch$: Observable<UnifiedHistogramInputMessage>;
visContext?: UnifiedHistogramVisContext;
esqlVariables?: ESQLControlVariable[];
onLoad: (isLoading: boolean, adapters: Partial<DefaultInspectorAdapters> | undefined) => void;
lastReloadRequestTime?: number;
}) => {
const buildLensProps = useCallback(() => {
if (!visContext) {
Expand All @@ -63,9 +66,17 @@ export const useLensProps = ({
attributes,
esqlVariables,
onLoad,
lastReloadRequestTime,
}),
};
}, [visContext, request?.searchSessionId, getTimeRange, esqlVariables, onLoad]);
}, [
visContext,
request?.searchSessionId,
getTimeRange,
esqlVariables,
onLoad,
lastReloadRequestTime,
]);

// Initialize with undefined to avoid rendering Lens until a fetch has been triggered
const [lensPropsContext, setLensPropsContext] = useState<ReturnType<typeof buildLensProps>>();
Expand All @@ -85,12 +96,14 @@ export const getLensProps = ({
attributes,
esqlVariables,
onLoad,
lastReloadRequestTime,
}: {
searchSessionId?: string;
getTimeRange: () => TimeRange;
attributes: TypedLensByValueInput['attributes'];
esqlVariables?: ESQLControlVariable[];
onLoad: (isLoading: boolean, adapters: Partial<DefaultInspectorAdapters> | undefined) => void;
lastReloadRequestTime?: number;
}): LensProps => ({
id: 'unifiedHistogramLensComponent',
viewMode: 'view',
Expand All @@ -103,4 +116,5 @@ export const getLensProps = ({
description: 'fetch chart data and total hits',
},
onLoad,
lastReloadRequestTime,
});
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export type UseUnifiedHistogramProps = Omit<UnifiedHistogramStateOptions, 'servi
* The relative time range, used when timeRange is an absolute range (e.g. for edit visualization button)
*/
relativeTimeRange?: TimeRange;
/**
* The timestamp of the last data request
*/
lastReloadRequestTime?: number;
/**
* The current columns
*/
Expand Down
Loading