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

feat(structure): support closing first collapsed DocumentPanel #5867

Merged
merged 1 commit into from
Feb 29, 2024
Merged

Conversation

rdunk
Copy link
Member

@rdunk rdunk commented Feb 27, 2024

Description

Presently, if a DocumentPanel is both in its collapsed state and also the first pane, neither a back button nor a close button can be displayed.

Presentation tool uses the DocumentPanel without any other panes, but also needs to support a collapsed state to prevent the inspector causing overflow issues.

This PR lifts some logic for displaying the DocumentPanel close button, relying on the presence of a provided BackLink, which Structure's PaneRouterProvider will now only pass if the pane is not the first. Presentation's router provider can therefore always pass a BackLink and display a close button even in a collapsed state.

What to review

There should be no changes within Structure tool, with the close and back buttons rendering as expected. The buttons should also both still be hidden if a user defines structure without multiple panes, e.g.

structureTool({
  structure: (S) =>
    S.document()
      .schemaType('page')
      .documentId('some-id'),
})

Testing

Notes for release

N/A. This is an internal feature.

@rdunk rdunk requested a review from a team as a code owner February 27, 2024 18:36
@rdunk rdunk requested review from juice49 and removed request for a team February 27, 2024 18:36
Copy link

vercel bot commented Feb 27, 2024

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

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Feb 27, 2024 6:40pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2024 6:40pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Feb 27, 2024 6:40pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Feb 27, 2024 6:45 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 34s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 5s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 12s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 31s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 59s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 1s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 19s 9 0 0

Copy link
Contributor

@juice49 juice49 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@juice49 juice49 added this pull request to the merge queue Feb 29, 2024
Merged via the queue into next with commit 6d61e94 Feb 29, 2024
40 checks passed
@juice49 juice49 deleted the crx-583 branch February 29, 2024 15:55
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