Issue
Kibana version: 7.x (Time to Visualize Flag set to true)
Describe the bug: With the time to visualize flag enabled, #86922 hid the visualize breadcrumb when editing or creating a panel by value. This behaviour is the same in Lens and Maps, the logic being that the panel you are editing / creating isn't technically part of the application.
This works fine in Maps & Lens, but Visualize uses the KbnUrlTracker to save and restore the last accessed URL. This means that if you edit or create a visualize panel by value, save and return, then navigate to the Visualize app via the left hand panel, visualize will restore the state by value (if you were editing), or the create by value page. The user may be confused, because they just navigated to the visualize app, and the breadcrumbs will say Dashboard / Create.
There is currently a workaround where pressing the 'Visualize' link in the left pane again will take you to the listing page.
Steps to reproduce:
- Create a new visualization from the dashboard
- Save and Return
- Navigate to Visualize via the left pane
- See that the breadcrumbs do not show
visualize
Expected behavior:
The Visualize link should take you to the Visualize application
Screenshots:
https://user-images.githubusercontent.com/14276393/106798593-2c22bb80-662c-11eb-81e8-a959d655b212.mp4
How to fix
Option 1:
The easiest option is just to show the Visualize breadcrumb in the Visualize editor even when the user is editing or creating By Value panels. The link will still redirect to the last visualize URL, but the user will be able to quickly return to the listing page via the breadcrumb.
One downside to this solution is that it will introduce some inconsistency when editing / creating by value visualizations in Lens vs Visualize. Another downside is that it will introduce an extra click when users are trying to head back to the Visualize listing page, although this downside is mitigated by the fact that users already do this if they were recently editing a visualization by reference.
Option 2:
Would be to introduce an onBeforeNavLinkSaved callback to Visualize, which reads from the embeddable state transfer, and returns a link to the listing page instead of the current link any time the visualize application has an originatingApp set.
This solution is more elegant, but also comes with some downsides. The url tracker is registered in setup, so a bit of funny business in the plugin would be required to access stateTransfer from there. The URL input to the onBeforeNavLinkSaved can't discriminate because the URL doesn't look any different for create by value / create by reference.
Issue
Kibana version: 7.x (Time to Visualize Flag set to true)
Describe the bug: With the time to visualize flag enabled, #86922 hid the
visualizebreadcrumb when editing or creating a panel by value. This behaviour is the same in Lens and Maps, the logic being that the panel you are editing / creating isn't technically part of the application.This works fine in Maps & Lens, but Visualize uses the
KbnUrlTrackerto save and restore the last accessed URL. This means that if you edit or create a visualize panel by value, save and return, then navigate to the Visualize app via the left hand panel, visualize will restore the state by value (if you were editing), or the create by value page. The user may be confused, because they just navigated to the visualize app, and the breadcrumbs will sayDashboard / Create.There is currently a workaround where pressing the 'Visualize' link in the left pane again will take you to the listing page.
Steps to reproduce:
visualizeExpected behavior:
The Visualize link should take you to the Visualize application
Screenshots:
https://user-images.githubusercontent.com/14276393/106798593-2c22bb80-662c-11eb-81e8-a959d655b212.mp4
How to fix
Option 1:
The easiest option is just to show the Visualize breadcrumb in the Visualize editor even when the user is editing or creating By Value panels. The link will still redirect to the last visualize URL, but the user will be able to quickly return to the listing page via the breadcrumb.
One downside to this solution is that it will introduce some inconsistency when editing / creating by value visualizations in Lens vs Visualize. Another downside is that it will introduce an extra click when users are trying to head back to the Visualize listing page, although this downside is mitigated by the fact that users already do this if they were recently editing a visualization by reference.
Option 2:
Would be to introduce an
onBeforeNavLinkSavedcallback to Visualize, which reads from the embeddable state transfer, and returns a link to the listing page instead of the current link any time the visualize application has anoriginatingAppset.This solution is more elegant, but also comes with some downsides. The url tracker is registered in setup, so a bit of funny business in the plugin would be required to access stateTransfer from there. The URL input to the
onBeforeNavLinkSavedcan't discriminate because the URL doesn't look any different for create by value / create by reference.