Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presentation should respect schema groups and fieldsets #1644

Closed
liamb13 opened this issue Jun 8, 2024 · 4 comments · May be fixed by #1649
Closed

Presentation should respect schema groups and fieldsets #1644

liamb13 opened this issue Jun 8, 2024 · 4 comments · May be fixed by #1649

Comments

@liamb13
Copy link

liamb13 commented Jun 8, 2024

Describe the bug

When clicking an Overlay, Presentations correctly navigates to the right Document. But it doesn't seem to understand 'groups'.

The correct field won't be highlighted until changing the active group to the right one.

To Reproduce

Steps to reproduce the behavior:

Set up a document schema with groups and use presentations to navigate between the two fields:

export default defineType({
  name: 'page',
  type: 'document',
  title: 'Page',
  groups: [
    {
      name: 'details',
      title: 'Details',
      default: true,
    },
    {
      name: 'content',
      title: 'Content',
    },
  ],
  fields: [
    defineField({
      group: 'details',
      name: 'title',
      title: 'Title (will navigate correctly)',
      type: 'string',
    }),
    defineField({
      group: 'content',
      name: 'subtitle',
      title: 'Subtitle (will not navigate correctly)',
      type: 'string',
    }),
  ]
})

Expected behavior

Presentations should be able to set the right active group.

@HumidBrains
Copy link

Some additional context:

  1. Since visual editing only opens the group that is set to the default, you can never have anything else than “All fields” set as the default group or you won’t be able to open any field of your choice.

  2. If you have selected any other group just by browsing your content and then go back to clicking an overlay to open another field, that won’t work, nothing will happen, making it feel like the UI has hung, hence giving the impression there is a bug.

@rdunk
Copy link
Member

rdunk commented Jul 12, 2024

This seems to be an upstream bug in the core related to the form expand operations necessary to focus a given path.

I've got a fix in the works that seems to work for both groups and fieldsets, just needs some more testing, but hoping I can land it early next week.

@rdunk rdunk changed the title Presentation should respect schema groups Presentation should respect schema groups and fieldsets Jul 12, 2024
@rdunk
Copy link
Member

rdunk commented Jul 16, 2024

The fix has been merged into core so should make its way into the next studio release: sanity-io/sanity#7154

@liamb13
Copy link
Author

liamb13 commented Jul 16, 2024

The fix has been merged into core so should make its way into the next studio release: sanity-io/sanity#7154

🙌🏻🙌🏻

Thanks @rdunk

@liamb13 liamb13 closed this as completed Jul 16, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants