studio
studio copied to clipboard
Feat #4241 Improve empty layout state
User-Facing Changes
Description
Add's Create new layout
button as referenced in issue #4241

Thanks for the PR!
This is an improvement over what we have currently. I think it would be better still if:
- If no layout is selected, automatically select the first personal layout
- If there are no personal layouts, automatically create the "default layout" (functionality already exists)
@foxymiles @banisadr thoughts?
Thanks for the PR!
This is an improvement over what we have currently. I think it would be better still if:
- If no layout is selected, automatically select the first personal layout
- If there are no personal layouts, automatically create the "default layout" (functionality already exists)
@foxymiles @banisadr thoughts?
That sounds better. I've made the changes.
@amacneil Selecting the first personal layout is a lot harder because those can be in a variety of different syncing states.
@amacneil I think it'd be best to revert to this commit (https://github.com/foxglove/studio/pull/4578/commits/064d24e0d63f8e7eb2880ce7029e10dc2382e709) in response to @foxymiles comment on syncing states
What's hard about selecting a layout that is in a syncing state?
From foxymiles explanation, my understanding is that getLayouts
returns all layouts, but Studio periodically fetches layouts from the backend whenever they're available, there could be an instance where a user has a layout that isn't yet in getLayouts
or where the last layout in getLayouts
isn't actually the most recent layout
That doesn't seem like a major problem - worst case we select a different layout, but that is still better than showing them no layout.
Yes, that's a valid point, but shouldn't the Create a new layout
button always lead to the layout panel selector? That's what the button says. It seems inconsistent for the button to create a new layout sometimes and only select a new layout other times.
I don't think we need the button at all. If no layout is selected, just select one for me. If there are no available layouts, re-create the default layout.
Apparently "just select one for me" is difficult but I'm trying to understand why.
Apparently "just select one for me" is difficult but I'm trying to understand why.
It's not difficult to just select one of whatever we may have managed to sync at that point in time but that doesn't strike me as great UX. I can't think of any other apps that will just show me one of my existing documents picked at random.
I'd advocate for this screen to be more informative. Looking at the original issue here are the things we should be doing on this screen:
- Telling you that we couldn't select some layout with some layout id (maybe asking the user to check that they have permissions to access the layout)
- Showing you the list of layouts available to select
- Showing you a button to create a new empty layout
@amacneil I don't think making a default layout automatically is good UX for the flow here - we want to inform the user their desired layout is not one can load and then have them take an appropriate action as a next step.
Let's talk about what would cause you to get into this state. In regular use, studio doesn't allow you to have no layout selected.
- If you open the app with no layouts, we create a default layout for you
- If you open the app with an invalid
layoutId
query param, you get this page (we should instead show you an error, like you suggested) - If you delete the last available layout, we show this page. Makes sense, although I think it would be equally sensible to just re-create the default layout, as we would do when you next open the app.
- If you sign out, we delete all your layouts, but keep the active layout. That's weird - we should either delete all layouts or not, but deleting them and keeping one active is strange.
- If you sign out then hit refresh, we create a new Default layout for you (because the existing
layoutId
no longer exists). Makes sense, because this is the same as hitting out app with an empty state. - If you sign out and immediately back into a new org from console, you get
Your active layout was deleted
, then you see this page. That's silly, we should have cleared the layout state when you signed out. When I sign into a new org, you should show me a layout. Ideally show me the last layout I had selected when I was signed in to this org, but if we don't want to do this, then I would settle for just showing me the first personal layout you find in that org.
Anecdotally, the main reason I see this page is when switching orgs, and I would much prefer to have you select a layout for me rather than always seeing this page. I realize most users do not switch orgs often (or ever), which is why I haven't pushed on prioritizing this ticket, but here we are with a PR so I may as well share thoughts on it.
Discussed internally at product review. There are a lot of things we want to do to improve layout workflow, but your original idea here is a good improvement worth merging.
The only change we should make is provide both options (select existing layout + create layout). For example
You don't currently have a layout selected.
_Select an existing layout_ or _Create new layout_
(probably two buttons, but you could try two links instead)
cc @2metres for thoughts on the UI
I think 2 links are my preference

@amacneil @foxymiles