You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The sanity studio supports defining multiple views for a document (see https://www.sanity.io/docs/create-custom-document-views-with-structure-builder#b0873d62a06a) which allows CMS admin users to define visual previews of document changes directly in the studio. An example of this is shown on the linked documentation page, ie the form view is opened on the left and a custom view is shown on the right (imagine this is a nice visual preview):
This is good, however, the issue is that by default, only a single view is shown initially when a user opens a document in the studio (ie the form view or maybe the first defined view, I haven't tried changing order). This means CMS content editor users have to go through the repetitive process of duplicating the document window and then opening the custom/preview view on the other window, to allow them to see the visual result of changes in real-time.
The repetitive process to setup the form and a preview side-by-side likely means users make changes in the form view and then switch back and forth to a preview view to see changes which is inconvenient. Also, since the process to show previews side by side requires knowledge of the ability to duplicate windows, it is not very accessible to non-technical people, and so in some cases it's the user's inconvenience due to not knowing there is a better way.
Describe the solution you'd like
Instead of relying on CMS editor users to setup side-by-side views, it would be good if CMS admins could configure (via the StructureBuilder API from the sanity/structure package) certain views (multiple) to be shown by default when a user opens a document, where it is likely to be beneficial to editor users.
I do not know the best solution for this but my idea is to provide the ability to define default views/windows via a new API e.g.
constformView=S.view.form();constpreview1View=S.view.component(Preview1Component);constpreview2View=S.view.component(Preview2Component);S.document()// define all available views.views([formView,preview1View,preview2View])// new API - define views that are shown by default in separate windows// views are shown in the defined order side-by-side horizontally.defaultWindows([formView,preview1View])
For the example above, this would show two windows side by side with the form view on the left and the preview1 view on the right. The windows would still have the normal UI so a user can then customise e.g. open different views (like preview2) on the different windows, duplicate more windows etc but the benefit is that there is a default experience which is much more accessible and can be defined where it makes sense.
Describe alternatives you've considered
No alternatives as no API is exposed to open/duplicate windows. So just been relying on users manually opening previews.
However alternative solutions could be to define certain views as opening in a new window, so the document opens as normal with the form view, then when a user clicks the preview view, a new window is opened automatically to the side and leaves the form view open. However, I did not like this idea because:
what happens if the user clicks the preview again? does it open in a new window again? its difficult to know what a user actually wants to do in this case so there is a risk of an annoying UX if the behaviour is not the intention e.g. the user just wants to open the view in the same window
this is still a bit "hidden" as the user needs to know to click the preview to know that the preview exists. Personally, I prefer for the preview to be more explicit
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The sanity studio supports defining multiple views for a document (see https://www.sanity.io/docs/create-custom-document-views-with-structure-builder#b0873d62a06a) which allows CMS admin users to define visual previews of document changes directly in the studio. An example of this is shown on the linked documentation page, ie the form view is opened on the left and a custom view is shown on the right (imagine this is a nice visual preview):
This is good, however, the issue is that by default, only a single view is shown initially when a user opens a document in the studio (ie the form view or maybe the first defined view, I haven't tried changing order). This means CMS content editor users have to go through the repetitive process of duplicating the document window and then opening the custom/preview view on the other window, to allow them to see the visual result of changes in real-time.
The repetitive process to setup the form and a preview side-by-side likely means users make changes in the form view and then switch back and forth to a preview view to see changes which is inconvenient. Also, since the process to show previews side by side requires knowledge of the ability to duplicate windows, it is not very accessible to non-technical people, and so in some cases it's the user's inconvenience due to not knowing there is a better way.
Describe the solution you'd like
Instead of relying on CMS editor users to setup side-by-side views, it would be good if CMS admins could configure (via the
StructureBuilder
API from thesanity/structure
package) certain views (multiple) to be shown by default when a user opens a document, where it is likely to be beneficial to editor users.I do not know the best solution for this but my idea is to provide the ability to define default views/windows via a new API e.g.
For the example above, this would show two windows side by side with the form view on the left and the preview1 view on the right. The windows would still have the normal UI so a user can then customise e.g. open different views (like preview2) on the different windows, duplicate more windows etc but the benefit is that there is a default experience which is much more accessible and can be defined where it makes sense.
Describe alternatives you've considered
No alternatives as no API is exposed to open/duplicate windows. So just been relying on users manually opening previews.
However alternative solutions could be to define certain views as opening in a new window, so the document opens as normal with the form view, then when a user clicks the preview view, a new window is opened automatically to the side and leaves the form view open. However, I did not like this idea because:
Additional context
N/A
The text was updated successfully, but these errors were encountered: