-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add canvas as a source for useQuery and useDispatchIntent #665
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
laurenashpole
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I left a couple comments about document type names and the type changes we talked about at pairing (unfortunately I couldn't leave that as a suggestion).
packages/react/src/hooks/dashboard/utils/getResourceIdFromDocumentHandle.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Lauren Ashpole <lauren@laurenashpole.com>
laurenashpole
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Adds
canvasSourcewhich behaves likemediaLibrarySource. Right now, thesourceparam is only respected byuseQueryanduseDispatchIntent. Minimal logic was added touseDispatchIntentto ensure that it can dispatch intents for Canvas documents, and corresponding Kitchensink components were added to this as well.I also corrected the resource type for the
media-libraryresource type, since that's the string used basically everywhere. It doesn't change functionality, since intents don't care about resource types (only document types).What to review
Again, please keep me honest and make sure things are appropriately marked
beta!Testing
A few tests were added to ensure 100% coverage of all logic branches. Also, Kitchensink was deployed with these changes: https://core-4owxlg8l9.sanity.build/@oblZgbTFj/application/wkyoigmzawwnnwx458zgoh46/intents
If buttons don't work, try to navigate to another app and back to the Kitchensink (it's a bug I'm working on).
Fun gif