Skip to content

[Logs UX] [Obs Exploration] fix incorrect extraction of time range from wrong context#248795

Merged
achyutjhunjhunwala merged 3 commits intoelastic:8.19from
achyutjhunjhunwala:fix-missing-daterange-context-issue
Jan 14, 2026
Merged

[Logs UX] [Obs Exploration] fix incorrect extraction of time range from wrong context#248795
achyutjhunjhunwala merged 3 commits intoelastic:8.19from
achyutjhunjhunwala:fix-missing-daterange-context-issue

Conversation

@achyutjhunjhunwala
Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala commented Jan 13, 2026

Summary

Closes - https://discuss.elastic.co/t/request-for-guidance-on-resolving-the-view-in-context-issue-in-the-logs-stream-menu/384453

While replacing the Log Stream component code in 8.19, i seems to have imported the timeRange from a context which was not present in the React tree for Open in Context component. This caused the component to get undefined error resulting in React Boundary Error as shown in the screenshot of the Discuss issue.

Hence, this fix takes care of getting the dateRange from a proper available context

Release Notes

Fixed breaking of UI when user clicks on View in Context action on Logs Stream component in 8.19 due to incorrect react context usage

@achyutjhunjhunwala achyutjhunjhunwala self-assigned this Jan 13, 2026
@achyutjhunjhunwala achyutjhunjhunwala added release_note:fix backport:skip This PR does not require backporting Team:obs-exploration Observability Exploration team labels Jan 13, 2026
@achyutjhunjhunwala
Copy link
Contributor Author

/ci

@achyutjhunjhunwala
Copy link
Contributor Author

@weltenwort @gbamparop Seems like i made a mistake while replacing the Log Stream component which caused this issue to happen. I suspect while replacing the component in multiple place, i copied the logic from another page without realising that the hook relies on a particular context which was not available in the Component Tree for this particular View In Content component.

I have fixed this issue in this PR, and tested the whole thing and it works fine.

As per my understanding, 8.19 is the last version where we can do fixes and 8.19.11 is the next planned release.
hence i have created this PR directly for on 8.19.

Post 8.19 we don't need to support Log Stream, is this understanding correct ? or do we need this in 9.0 ?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
infra 1.6MB 1.6MB -4.9KB

History

cc @achyutjhunjhunwala

@achyutjhunjhunwala achyutjhunjhunwala marked this pull request as ready for review January 13, 2026 11:30
@gbamparop
Copy link
Contributor

Post 8.19 we don't need to support Log Stream, is this understanding correct ? or do we need this in 9.0 ?

Is the View in context functionality only available in the log stream app? Because the shared components were replaced in 9.1 #219425

@achyutjhunjhunwala
Copy link
Contributor Author

achyutjhunjhunwala commented Jan 14, 2026

Post 8.19 we don't need to support Log Stream, is this understanding correct ? or do we need this in 9.0 ?

Is the View in context functionality only available in the log stream app? Because the shared components were replaced in 9.1 #219425

@gbamparop The View in Context is used in Logs Categories page as well. But it has a different issue (with the same fix actually). Since 9.1 onwards we changed the logic on how we were consuming this dateRange object from the context

  • Until 8.19, we would try to access the from and to props inside the dateRange object which was undefined and hence caused React Boundary Error

  • But 9.1 onwards, we were straight away passing the dateRange object without trying to access the inside props to the Discover Locator directly. This means that undefined got passed and the timeRange defaulted to now to now-15mins. hence it did not break the user experience.

I will create another PR to target the current main and backport it all the way back to 9.2 and 9.3 (i don"t see any release for 9.1) to fix the incorrect Discover Link issue which instead of passing the actual dateRange is passing undefined resulting in now-15mins

Gif from 9.1 environment

Jan-14-2026 12-00-15

@achyutjhunjhunwala
Copy link
Contributor Author

achyutjhunjhunwala commented Jan 14, 2026

Update

I have created a different PR directly from main backporting all the way back to 8.19 9.1

#248939

I would appreciate instead of merging this, we merge the other one

cc: @weltenwort I am keeping this PR open for now as it has all the conversations, will close it once you align

This PR needs to be merged due to Locator Definition changes

@weltenwort
Copy link
Member

I could verify that this works in the logs stream on 8.19 and submitted a review over in #248939

achyutjhunjhunwala added a commit that referenced this pull request Jan 14, 2026
…context (#248939)

## Summary

Original issue - #248795

As part of the original issue it was found that in 8.19 it provides a
completely broken experience but 9.1 onwards, we don't access the
undefined object inside the react component and straight away were
passing it to the Discover Locator which was getting `undefined` for
`dateRange` and thus was defaulting to `now to now-15m`

With this PR we fix passing the correct `dateRange`. Now when user open
`View in Context` and then clicks Open in Discover from the modal, it
does passes the actual timerange from the Logs Categories page to
Discover

## Release Note

Fixes broken links from View In Context Modal to Discover which was not
respecting the DateRange
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 14, 2026
…context (elastic#248939)

## Summary

Original issue - elastic#248795

As part of the original issue it was found that in 8.19 it provides a
completely broken experience but 9.1 onwards, we don't access the
undefined object inside the react component and straight away were
passing it to the Discover Locator which was getting `undefined` for
`dateRange` and thus was defaulting to `now to now-15m`

With this PR we fix passing the correct `dateRange`. Now when user open
`View in Context` and then clicks Open in Discover from the modal, it
does passes the actual timerange from the Logs Categories page to
Discover

## Release Note

Fixes broken links from View In Context Modal to Discover which was not
respecting the DateRange

(cherry picked from commit 6302c6b)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 14, 2026
…context (elastic#248939)

## Summary

Original issue - elastic#248795

As part of the original issue it was found that in 8.19 it provides a
completely broken experience but 9.1 onwards, we don't access the
undefined object inside the react component and straight away were
passing it to the Discover Locator which was getting `undefined` for
`dateRange` and thus was defaulting to `now to now-15m`

With this PR we fix passing the correct `dateRange`. Now when user open
`View in Context` and then clicks Open in Discover from the modal, it
does passes the actual timerange from the Logs Categories page to
Discover

## Release Note

Fixes broken links from View In Context Modal to Discover which was not
respecting the DateRange

(cherry picked from commit 6302c6b)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 14, 2026
…context (elastic#248939)

## Summary

Original issue - elastic#248795

As part of the original issue it was found that in 8.19 it provides a
completely broken experience but 9.1 onwards, we don't access the
undefined object inside the react component and straight away were
passing it to the Discover Locator which was getting `undefined` for
`dateRange` and thus was defaulting to `now to now-15m`

With this PR we fix passing the correct `dateRange`. Now when user open
`View in Context` and then clicks Open in Discover from the modal, it
does passes the actual timerange from the Logs Categories page to
Discover

## Release Note

Fixes broken links from View In Context Modal to Discover which was not
respecting the DateRange

(cherry picked from commit 6302c6b)
@achyutjhunjhunwala achyutjhunjhunwala merged commit 6141dff into elastic:8.19 Jan 14, 2026
13 checks passed
@achyutjhunjhunwala achyutjhunjhunwala deleted the fix-missing-daterange-context-issue branch January 14, 2026 13:45
smith pushed a commit to smith/kibana that referenced this pull request Jan 16, 2026
…context (elastic#248939)

## Summary

Original issue - elastic#248795

As part of the original issue it was found that in 8.19 it provides a
completely broken experience but 9.1 onwards, we don't access the
undefined object inside the react component and straight away were
passing it to the Discover Locator which was getting `undefined` for
`dateRange` and thus was defaulting to `now to now-15m`

With this PR we fix passing the correct `dateRange`. Now when user open
`View in Context` and then clicks Open in Discover from the modal, it
does passes the actual timerange from the Logs Categories page to
Discover

## Release Note

Fixes broken links from View In Context Modal to Discover which was not
respecting the DateRange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:fix Team:obs-exploration Observability Exploration team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants