Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Sep 7, 2025

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

  • Bug fix

Testing

  • Rapidly clicked multiple workflows (not intending to drag): each click navigates immediately.
  • Intentionally dragged rows between folders and to root: DnD still works; payload (workflow-ids) unchanged.
  • Shift+click multi-select, rename input, and hover edit button behaviors unchanged.
  • Marketplace/editing states still disable drag as before.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • No new warnings introduced

Screenshots/Videos

N/A

@waleedlatif1 waleedlatif1 added the capy PR created by Capy label Sep 7, 2025
@vercel
Copy link

vercel bot commented Sep 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Sep 7, 2025 2:51am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Sep 7, 2025 2:51am

@waleedlatif1 waleedlatif1 removed the capy PR created by Capy label Sep 7, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit d45324b into main Sep 7, 2025
4 of 5 checks passed
@waleedlatif1 waleedlatif1 deleted the capy/fix-sidebar-workflow-876715a5 branch September 7, 2025 02:52
icecrasher321 added a commit that referenced this pull request Sep 17, 2025
* 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>
Acumen-Desktop pushed a commit to Acumen-Desktop/sim that referenced this pull request Sep 20, 2025
* 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>
icecrasher321 added a commit that referenced this pull request Sep 26, 2025
…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>
@waleedlatif1 waleedlatif1 mentioned this pull request Sep 27, 2025
10 tasks
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.

2 participants