-
Notifications
You must be signed in to change notification settings - Fork 5
fix context panel on node dragging #709
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
| children: ReactNode; | ||
| }) => { | ||
| const { setNodes } = useReactFlow(); | ||
| const defaultContentRef = useRef<ReactNode>(defaultContent); |
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.
This ref is needed to make "clearContent" stable. Another approach to try - is to extract the piece of JSX in PipelineEditor and other places, where we using <ContextPanelProvider>.
const pipelineDetails = useMemo(() => <PipelineDetails />, []);
...
<ContextPanelProvider defaultContent={pipelineDetails}>a23bf03 to
39e01e3
Compare
| setArguments, | ||
| setAnnotations, | ||
| setCacheStaleness, | ||
| } = data.callbacks ?? DEFAULT_TASK_NODE_CALLBACKS; |
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.
We need stable references
| type, | ||
| }); | ||
| }; | ||
| const notify = useCallback( |
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.
iirc we're running the latest React and we should no longer need to explicitly call useCallback?
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.
In case if we use Compiler. But I dont think we enabled it yet
camielvs
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
Merge activity
|
39e01e3 to
fe5234a
Compare

Description
Closes https://github.com/Shopify/oasis-frontend/issues/202
This PR improves performance and code quality through several optimizations:
isDraggingcheck in TaskNodeCard that was causing performance issuesuseToastNotificationhook withuseCallbackto prevent unnecessary re-rendersType of Change
Checklist
Test Instructions
Screen Recording 2025-12-04 at 3.33.30 PM.mov (uploaded via Graphite)