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(presentation): prevent openInStructure from linking to the presentation tool itself #1762

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marcusforsberg
Copy link

Hey Sanity team! 👋

On some of our projects, the Presentation tool is the only tool used to work with content; i.e. there's no Structure tool at all.
In this scenario, the "Open in Structure" action will end up linking back to the Presentation tool itself, so nothing happens when you click on it.

Example screenshot below. Our Presentation tool is titled "Live Edit" and the action says "Open in Live Edit", but that tool is already open so the button effectively does nothing.

Screenshot 2024-08-27 at 15 38 52

This PR solves that by excluding the Presentation tool when trying to find matches in findStructureTool. With this change, there's no action button shown at all, since there's no relevant tool to link to:

Screenshot 2024-08-27 at 15 42 48

@marcusforsberg marcusforsberg requested a review from a team as a code owner August 27, 2024 13:51
Copy link

vercel bot commented Aug 27, 2024

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

Name Status Preview Comments Updated (UTC)
visual-editing-astro ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 1:35pm
visual-editing-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 1:35pm
visual-editing-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 1:35pm

Copy link

vercel bot commented Aug 27, 2024

@marcusforsberg is attempting to deploy a commit to the Sanity Sandbox Team on Vercel.

A member of the Team first needs to authorize it.

@marcusforsberg marcusforsberg changed the title fix(presentation): prevent openInStructure from from linking to the presentation tool itself fix(presentation): prevent openInStructure from linking to the presentation tool itself Aug 27, 2024
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.

1 participant