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
Expected the document editor to be opened. Please compare to behaviour with the following steps in test-studio.
Click 'Custom panes'
Click 'Authors & Books'
Click '+' icon next to 'Authors & Books'
Click 'Author'
Which versions of Sanity are you using?
Run sanity versions in the terminal and copy-paste the result here.
@sanity/cli (global) 3.78.0 (latest: 3.78.1)
@sanity/eslint-config-i18n 1.0.0 (latest: 1.1.0)
@sanity/eslint-config-studio 4.0.0 (latest: 5.0.2)
@sanity/mutate 0.12.1 (up to date)
@sanity/pkg-utils 6.13.4 (latest: 7.0.4)
@sanity/prettier-config 1.0.3 (up to date)
@sanity/test 0.0.1-alpha.1 (up to date)
@sanity/tsdoc 1.0.169 (latest: 2.0.9)
@sanity/ui 2.15.2 (up to date)
@sanity/uuid 3.0.2 (up to date)
sanity 3.78.1 (up to date)
Additional context
getIntentState() in packages/sanity/src/structure/getIntentState.ts seems to expect that all documentLists with matching type and filter are able to handle the create intent. This is not the case if the documentList has children as the steps to reproduce mentioned above shows.
Adding && pane.child === undefined to the statement seems to fix the issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
When clicking "Create new document" in a documentList pane with a child, the child pane will open instead of the document editor.
This is problematic because a lot of Sanity documentation instructs to build filtered lists like this. E.g. https://www.sanity.io/docs/structure-builder-cheat-sheet#68ee42d8c7a5
To Reproduce
Steps to reproduce the behavior in test-studio.
Expected behavior
Expected the document editor to be opened. Please compare to behaviour with the following steps in test-studio.
Which versions of Sanity are you using?
Run
sanity versions
in the terminal and copy-paste the result here.@sanity/cli (global) 3.78.0 (latest: 3.78.1)
@sanity/eslint-config-i18n 1.0.0 (latest: 1.1.0)
@sanity/eslint-config-studio 4.0.0 (latest: 5.0.2)
@sanity/mutate 0.12.1 (up to date)
@sanity/pkg-utils 6.13.4 (latest: 7.0.4)
@sanity/prettier-config 1.0.3 (up to date)
@sanity/test 0.0.1-alpha.1 (up to date)
@sanity/tsdoc 1.0.169 (latest: 2.0.9)
@sanity/ui 2.15.2 (up to date)
@sanity/uuid 3.0.2 (up to date)
sanity 3.78.1 (up to date)
Additional context
getIntentState() in
packages/sanity/src/structure/getIntentState.ts
seems to expect that all documentLists with matching type and filter are able to handle the create intent. This is not the case if the documentList has children as the steps to reproduce mentioned above shows.Adding
&& pane.child === undefined
to the statement seems to fix the issue.The text was updated successfully, but these errors were encountered: