-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Remember tab choice between logs explorer and discover #194930
Remember tab choice between logs explorer and discover #194930
Conversation
…hoice-between-Logs-Explorer-and-Discover
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
…hoice-between-Logs-Explorer-and-Discover
…hoice-between-Logs-Explorer-and-Discover
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
To update your PR or re-run it, just comment with: |
@awahab07 It Looks like something is not working when storing the last visited page and trying to restore it, looks at this recording and let me know if you have any questions. This is a local stateful environment with project view enabled: Screen.Recording.2024-10-07.at.11.26.54.mov |
src/plugins/discover/public/components/logs_explorer_tabs/logs_explorer_tabs.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting that it triggered an application usage change... but telemetry changes LGTM
…hoice-between-Logs-Explorer-and-Discover
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
I found a couple of scenarios where it seems to not work at the moment. Restore not working when updating the page URLWhen using any link from the history, the stored value in the localStorage is probably not updated, as when leaving the page and returning to it, we are no longer on the previously visited tab. Screen.Recording.2024-10-09.at.12.06.34.movActive navigation itemThe navigation item in the sidebar doesn't maintain the active status when the user switches to Discover. Screen.Recording.2024-10-09.at.11.59.56.mov |
…r tab is selected.
…hoice-between-Logs-Explorer-and-Discover
@tonyghiani thanks for catching:
I've pushed a fix. For
It asks for a decision that how we want implement it. Currently the tab choice is only persisted when user explicitly clicks on the tab and not when the url is visited. Accounting the fact that direct links to Discover or Logs Explorer from other apps or pasted urls shouldn't affect this choice. For example, a user may want to always use Discover when simply exploring the logs, and links to Logs Explorer from other apps should not override this choice. WDYT? Open for suggestions if there are other considerations I am missing. |
@awahab07 I see your point, on the other hand, it feels like an inconsistent experience that the user doesn't always get back to the last tab during a session if they perform back and forth from discover, Logs Explorer and other apps... We might be complicating this more than it's worth to, as it should soon be removed, although it still feels a bit confusing. |
…ast visited status instead of last tab clicked status.
…hoice-between-Logs-Explorer-and-Discover
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It now works as expected, thanks for addressing all the edge cases.
Let's keep in mind this is a temporary solution and should be reverted/removed as soon as we remove the Logs Explorer tabs 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the navigation tree changes on stateful solution nav and works as expected. I didn't test on serverless, did code review only. LGTM!
Screen.Recording.2024-10-10.at.13.20.15.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, codeowner review. tested it locally and works as expected
…hoice-between-Logs-Explorer-and-Discover
💛 Build succeeded, but was flaky
Failed CI StepsTest FailuresMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11324724825 |
Closes elastic#193321 ## Summary The PR adds the redirection point when "Discover" menu item is clicked on the sidenav in serverless (or solution nav on stateful). Based on what tab between "Discover" or "Logs Explorer" the user clicked recently, "Discover" will point to that app/tab. Previously, "Discover" would always point to "Logs Explorer" on serverless and to "Discover" on stateful. In order to implement this, a temporary app `last-used-logs-viewer` is registered in `observability-logs-explorer` plugin whose only job is to read the last stored value in local storage and perform the redirection. Doing the redirection from a temporary app should help prevent triggering unnecessary telemetry and history entries. And it should be fairly easy to undo once context aware redirection is in place. ~With this implementation, only the behavior of user clicking "Discover" on the sidenav and clicking the tabs is affected and any deeplinks from other apps or direct links should work as is.~ The tab choice will be updated even if the apps are visited via url. https://github.com/user-attachments/assets/8a0308db-9ddb-47b6-b1a5-8ed70662040d --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit fed9a19)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
#196068) # Backport This will backport the following commits from `main` to `8.x`: - [Remember tab choice between logs explorer and discover (#194930)](#194930) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Abdul Wahab Zahid","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-14T09:26:24Z","message":"Remember tab choice between logs explorer and discover (#194930)\n\nCloses #193321 \r\n\r\n## Summary\r\n\r\nThe PR adds the redirection point when \"Discover\" menu item is clicked\r\non the sidenav in serverless (or solution nav on stateful). Based on\r\nwhat tab between \"Discover\" or \"Logs Explorer\" the user clicked\r\nrecently, \"Discover\" will point to that app/tab. Previously, \"Discover\"\r\nwould always point to \"Logs Explorer\" on serverless and to \"Discover\" on\r\nstateful.\r\n\r\nIn order to implement this, a temporary app `last-used-logs-viewer` is\r\nregistered in `observability-logs-explorer` plugin whose only job is to\r\nread the last stored value in local storage and perform the redirection.\r\n\r\nDoing the redirection from a temporary app should help prevent\r\ntriggering unnecessary telemetry and history entries. And it should be\r\nfairly easy to undo once context aware redirection is in place.\r\n\r\n~With this implementation, only the behavior of user clicking \"Discover\"\r\non the sidenav and clicking the tabs is affected and any deeplinks from\r\nother apps or direct links should work as is.~ The tab choice will be\r\nupdated even if the apps are visited via url.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/8a0308db-9ddb-47b6-b1a5-8ed70662040d\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"fed9a193869739c2fae0bd7a49087fa1e216f5ac","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs","Team:obs-ux-management"],"title":"Remember tab choice between logs explorer and discover","number":194930,"url":"https://github.com/elastic/kibana/pull/194930","mergeCommit":{"message":"Remember tab choice between logs explorer and discover (#194930)\n\nCloses #193321 \r\n\r\n## Summary\r\n\r\nThe PR adds the redirection point when \"Discover\" menu item is clicked\r\non the sidenav in serverless (or solution nav on stateful). Based on\r\nwhat tab between \"Discover\" or \"Logs Explorer\" the user clicked\r\nrecently, \"Discover\" will point to that app/tab. Previously, \"Discover\"\r\nwould always point to \"Logs Explorer\" on serverless and to \"Discover\" on\r\nstateful.\r\n\r\nIn order to implement this, a temporary app `last-used-logs-viewer` is\r\nregistered in `observability-logs-explorer` plugin whose only job is to\r\nread the last stored value in local storage and perform the redirection.\r\n\r\nDoing the redirection from a temporary app should help prevent\r\ntriggering unnecessary telemetry and history entries. And it should be\r\nfairly easy to undo once context aware redirection is in place.\r\n\r\n~With this implementation, only the behavior of user clicking \"Discover\"\r\non the sidenav and clicking the tabs is affected and any deeplinks from\r\nother apps or direct links should work as is.~ The tab choice will be\r\nupdated even if the apps are visited via url.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/8a0308db-9ddb-47b6-b1a5-8ed70662040d\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"fed9a193869739c2fae0bd7a49087fa1e216f5ac"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194930","number":194930,"mergeCommit":{"message":"Remember tab choice between logs explorer and discover (#194930)\n\nCloses #193321 \r\n\r\n## Summary\r\n\r\nThe PR adds the redirection point when \"Discover\" menu item is clicked\r\non the sidenav in serverless (or solution nav on stateful). Based on\r\nwhat tab between \"Discover\" or \"Logs Explorer\" the user clicked\r\nrecently, \"Discover\" will point to that app/tab. Previously, \"Discover\"\r\nwould always point to \"Logs Explorer\" on serverless and to \"Discover\" on\r\nstateful.\r\n\r\nIn order to implement this, a temporary app `last-used-logs-viewer` is\r\nregistered in `observability-logs-explorer` plugin whose only job is to\r\nread the last stored value in local storage and perform the redirection.\r\n\r\nDoing the redirection from a temporary app should help prevent\r\ntriggering unnecessary telemetry and history entries. And it should be\r\nfairly easy to undo once context aware redirection is in place.\r\n\r\n~With this implementation, only the behavior of user clicking \"Discover\"\r\non the sidenav and clicking the tabs is affected and any deeplinks from\r\nother apps or direct links should work as is.~ The tab choice will be\r\nupdated even if the apps are visited via url.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/8a0308db-9ddb-47b6-b1a5-8ed70662040d\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"fed9a193869739c2fae0bd7a49087fa1e216f5ac"}}]}] BACKPORT--> Co-authored-by: Abdul Wahab Zahid <[email protected]>
Closes #193321
Summary
The PR adds the redirection point when "Discover" menu item is clicked on the sidenav in serverless (or solution nav on stateful). Based on what tab between "Discover" or "Logs Explorer" the user clicked recently, "Discover" will point to that app/tab. Previously, "Discover" would always point to "Logs Explorer" on serverless and to "Discover" on stateful.
In order to implement this, a temporary app
last-used-logs-viewer
is registered inobservability-logs-explorer
plugin whose only job is to read the last stored value in local storage and perform the redirection.Doing the redirection from a temporary app should help prevent triggering unnecessary telemetry and history entries. And it should be fairly easy to undo once context aware redirection is in place.
With this implementation, only the behavior of user clicking "Discover" on the sidenav and clicking the tabs is affected and any deeplinks from other apps or direct links should work as is.The tab choice will be updated even if the apps are visited via url.193321-Remember-tab-choice-between-Logs-Explorer-and-Discover.mov