-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(sidebar): prevent missed clicks during rapid workflow switching (keep row drag) #1276
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
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.
Greptile Summary
This PR fixes a UX bug in the sidebar's workflow navigation where rapid clicks on workflow items could be missed during workflow switching. The issue was caused by a timing mismatch between the drag state management and click handling logic.
The change modifies the workflow-item.tsx component within the sidebar's folder tree structure. Previously, the click handler used dragStartedRef.current to determine whether to prevent navigation clicks, but this ref was set synchronously during drag start and only reset asynchronously via requestAnimationFrame during drag end. This created a problematic window where legitimate clicks could be blocked even when no actual drag operation was occurring.
The fix replaces the ref-based check with the isDragging state variable, which is managed synchronously with the actual drag lifecycle. When a drag starts, setIsDragging(true) is called immediately, and when it ends, setIsDragging(false) is called before the asynchronous ref reset. This ensures that the click prevention logic accurately reflects the current drag state, allowing immediate navigation when users aren't actively dragging.
The change integrates well with the existing sidebar architecture, which uses the folder tree component to organize and display workflows. The drag-and-drop functionality remains fully intact, including multi-select operations, rename inputs, and marketplace/editing state handling. The dragStartedRef is preserved for any other potential uses but no longer interferes with the primary click navigation.
Confidence score: 5/5
- This PR is safe to merge with minimal risk
- Score reflects a surgical fix to a specific timing issue with clear before/after behavior and comprehensive testing coverage
- No files require special attention
1 file reviewed, no comments
* fix(sidebar): draggable cursor on sidebar when switching workflows (#1276) * added google form tool to read forms * added trigger mode and block docs * updated docs * removed file * reverted diff * greptile comments * Reverted bun file * remove outdated code for old webhook modal * restore ui changes to webhooks * removed provider specific logic * fix lint --------- Co-authored-by: Waleed Latif <walif6@gmail.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
* fix(sidebar): draggable cursor on sidebar when switching workflows (simstudioai#1276) * added google form tool to read forms * added trigger mode and block docs * updated docs * removed file * reverted diff * greptile comments * Reverted bun file * remove outdated code for old webhook modal * restore ui changes to webhooks * removed provider specific logic * fix lint --------- Co-authored-by: Waleed Latif <walif6@gmail.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
…1462) * fix(sidebar): draggable cursor on sidebar when switching workflows (#1276) * remove inline css for edge labels * fix remote code execution imports for javascript * add docs for new triggers * fix * fix draggable link --------- Co-authored-by: Waleed Latif <walif6@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com>
Summary
Prevent missed clicks when rapidly switching workflows by gating navigation on active drag state rather than a transient drag-start flag. Keeps full-row drag-and-drop intact.
Fixes: N/A (surgical UX bugfix)
Type of Change
Testing
workflow-ids) unchanged.Checklist
Screenshots/Videos
N/A