fix: v2 - component editor preview#2439
Open
maxy-shpfy wants to merge 1 commit into
Open
Conversation
🎩 PreviewA preview build has been created at: |
camielvs
reviewed
Jun 19, 2026
Comment on lines
+23
to
+57
| return { | ||
| id: "preview", | ||
| entityId: "preview", | ||
| taskName: spec.name ?? "component-preview", | ||
| selected: false, | ||
| isHovered: false, | ||
| isSubgraph: isGraphImplementation(spec.implementation), | ||
| collapsed: false, | ||
| description: spec.description ?? "", | ||
| inputs: (spec.inputs ?? []).map((input) => ({ | ||
| name: input.name, | ||
| type: input.type, | ||
| optional: input.optional, | ||
| default: input.default, | ||
| })), | ||
| outputs: (spec.outputs ?? []).map((output) => ({ | ||
| name: output.name, | ||
| type: output.type, | ||
| })), | ||
| connectedInputNames: new Set<string>(), | ||
| connectedOutputNames: new Set<string>(), | ||
| annotations: [], | ||
| taskColor: undefined, | ||
| cacheDisabled: false, | ||
| digest: undefined, | ||
| inputDisplayValues: {}, | ||
| isAggregator: false, | ||
| outputType: AggregatorOutputType.JsonArray, | ||
| onOutputTypeChange: noop, | ||
| onNodeClick: noop, | ||
| onInputClick: noop, | ||
| onOutputClick: noop, | ||
| onHandleClick: noop, | ||
| }; | ||
| } |
Collaborator
There was a problem hiding this comment.
hmm. manually listing everything out feels like a bit of a smell
Collaborator
Author
There was a problem hiding this comment.
It is typed, if contract changed - typecheck/lint will notify us. Not sure if there is a better justified way of building this object. In downstream PR we may try to extract "layout" portion of the TaskNodeCard to avoid usage of "handlers" , but I think it is too much for this specific use-case
camielvs
reviewed
Jun 19, 2026
272f8ce to
49e5720
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Closes https://github.com/Shopify/oasis-frontend/issues/660
Replaces the
usePreviewTaskNodeDatahook andgenerateTaskSpecutility with a new pure functionbuildPreviewTaskNodeViewPropsthat directly maps component YAML into the v2TaskNodeCard's prop interface. This removes the dependency onuseQueryClientand the MobX spec model for rendering the component preview, allowing the preview to work without the editor's ReactFlow node context or query cache side effects.The
PreviewTaskNodeCardnow wraps the v2TaskNodeCardwithReactFlowProviderandSpecProviderinstead ofTaskNodeProvider, and drops theQueryErrorResetBoundaryandSuspensewrappers since the new approach is fully synchronous.Related Issue and Pull requests
Type of Change
Screenshots (if applicable)
Test Instructions
Additional Comments
generateTaskSpechas been removed entirely as it is no longer needed outside of this preview context.