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

fix(sanity): open correct groups and fieldsets on setOpenPath #7154

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

rdunk
Copy link
Member

@rdunk rdunk commented Jul 15, 2024

Description

For context, this PR is to resolve issues largely reported by Presentation users. I believe the same issue affects the Structure tool, but is far less visible as this is a less common scenario and largely non-critical in that context.

In summary: setOpenPath in the DocumentPaneProvider fails to focus the specified field if it exists in non-default groups or collapsed fieldsets.

This is because getExpandOperations is not returning the expected operations, which in turn seems to be because immutableReconcile drops the _allMembers property of the form state as it currently only handles enumerable properties (and _allMembers is explicitly set to non-enumerable).

There is also a small change to getExpandOperations as I believe the setSelectedGroup operation was returning the wrong group name.

What to review

The simplest way to reproduce the issue in Structure is by clicking on the global presence avatar of a user who is currently focused on a field in a non-default group or collapsed fieldset.

This PR also adds a new schema type and an update to the Presentation test studio preview (under the FieldGroups tab) useful for checking the focus behaviour of non-default groups and collapsed fieldsets.

Testing

One test added to check that immutableReconcile always returns the latest value of non-enumerable properties.

Notes for release

Copy link

vercel bot commented Jul 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2024 7:05pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2024 7:05pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2024 7:05pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2024 7:05pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2024 7:05pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jul 15, 2024 7:05pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Jul 15, 2024

Component Testing Report Updated Jul 15, 2024 7:17 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 42s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 36s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 16s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 43s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 42s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 14s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 8s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 25s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 1m 23s 20 0 1
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 1m 45s 30 0 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 19s 3 0 0

@rdunk rdunk force-pushed the fix/form-expand-operations branch from e53ddfa to f966d62 Compare July 15, 2024 10:23
@rdunk rdunk force-pushed the fix/form-expand-operations branch from f966d62 to 22e058f Compare July 15, 2024 13:19
@rdunk rdunk force-pushed the fix/form-expand-operations branch 2 times, most recently from a7ccfe6 to 7db67ad Compare July 15, 2024 16:43
@rdunk rdunk force-pushed the fix/form-expand-operations branch from 7db67ad to 7c325af Compare July 15, 2024 16:58
@rdunk rdunk force-pushed the fix/form-expand-operations branch from 7c325af to 378be0c Compare July 15, 2024 17:20
Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you so much for this @rdunk, appreciate the added test as well <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants