elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.65k stars 8.23k forks source link

Switching Spaces should retain the user's location in Kibana #114158

Open cjcenizal opened 3 years ago

cjcenizal commented 3 years ago

Currently, switching Spaces takes the user to the Home page.

Imagine a user who's looking at dashboards. They switch to a new space. What are the chances that Home is where they want to go to next? I think it's close to zero. What are the chances they want to continue looking at dashboards, just in a different space? I think it's somewhat higher. And even if they don't want to continue looking at dashboards in the new space, at least preserving the current context is less jarring than being taken to Home.

elasticmachine commented 3 years ago

Pinging @elastic/kibana-security (Team:Security)

elasticmachine commented 3 years ago

Pinging @elastic/kibana-design (Team:Kibana-Design)

legrego commented 3 years ago

Also tagging in the design team since we've recently had discussions around space selection & management

ryankeairns commented 3 years ago

Thanks for keeping us informed. For now, we're focused on some quick wins for the Space selector view, but ++ the suggestion of keeping their context, if possible.

legrego commented 2 years ago

This is potentially at odds with https://github.com/elastic/kibana/issues/19584. If I (in the future) have a user-specific default route defined for each of my spaces, then does that only apply when I enter the space after logging in? If I'm already in a space and I switch to another space, should the default route be ignored? We could technically solve for that, but it feels like a confusing UX to me.

Another option is to forego https://github.com/elastic/kibana/issues/19584 altogether, but we still have the problem of the space-specific default routes today. Administrators can configure the "landing page" of each space to be whatever they want; by default it's the Home Page, but it doesn't have to be.

ryankeairns commented 2 years ago

In my mind, the practical next step is to allow users to set a default route per Space (i.e. override the default route set by the Space admin) and see how far that gets us (i.e. watch for feedback; try it out ourselves) before attempting the more complex URL/view preservation option.

jportner commented 2 years ago

We could consider adding an "overflow actions" button to the side of the space menu (it's just a quick mockup, pretend that it's centered vertically 😅):

image
Click to see diff ```diff diff --git a/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.tsx b/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.tsx index 9a88b3c2db1..d395effe734 100644 --- a/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.tsx +++ b/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.tsx @@ -8,9 +8,12 @@ import './spaces_menu.scss'; import { + EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiFieldSearch, + EuiFlexGroup, + EuiFlexItem, EuiLoadingContent, EuiLoadingSpinner, EuiText, @@ -196,16 +199,23 @@ class SpacesMenuUI extends Component { ); return ( - - {space.name} - + + + + {space.name} + + + + + + ); }; ```

Then the default behavior could be to go to that space's landing page, and the overflow action could give an option to go to the current page (or even other favorite page(s)?)

I wouldn't mind an extra click for that.

cjcenizal commented 2 years ago

Why do people switch spaces?

jportner commented 2 years ago

Why do people switch spaces?

Talk about a loaded question :D

Spaces are used for a combination of authorization and organization. We've also heard recently that some folks create different spaces for "staging" and "production" saved objects (dashboards etc.)

One common use case that I run into all the time is using the Saved Objects Management page-- I may copy a saved object to a different space, then I want to go to the same SOM page on that space and do something to that object. Right now I have to either switch spaces and then navigate all the way back there, or hack the URL because I happen to know that I can just prepend it with /s/my-space. It would be nice to have a button to get there instead, IMO.

But other times you may want to switch spaces to do something totally different (if you have APM in one space and Security Solution stuff in another space). In that case you wouldn't want to go to the same page in that other space, you'd probably want to go to the configured landing page in that space.

ryankeairns commented 2 years ago

That's a neat concept @jportner

The reverse of that might also be interesting - the main button goes to current page equivalent and, instead of an overflow, it's a house/home icon that goes to your default route.

shahzad31 commented 11 months ago

un-assigning myself, since my idea didn't work, giving chance for someone else to wokr.