Title: fix(sidebar): stop bubbled dragleave events cancelling an in-progress drag by waleedlatif1 · Pull Request #6679 · simstudioai/sim · GitHub
Open Graph Title: fix(sidebar): stop bubbled dragleave events cancelling an in-progress drag by waleedlatif1 · Pull Request #6679 · simstudioai/sim
X Title: fix(sidebar): stop bubbled dragleave events cancelling an in-progress drag by waleedlatif1 · Pull Request #6679 · simstudioai/sim
Description: Summary Fix drag-and-drop in the workflow sidebar silently doing nothing, which showed up most often when a folder was expanded Close folders that a drag spring-opened on its way past, instead of leaving them open Surface reorder failures instead of swallowing them, and report partial failures distinctly The drag bug dragleave bubbles, so a container-level listener fires for every descendant the pointer leaves — and Chrome reports relatedTarget as null on dragleave (Firefox populates it). Two places read "no related node" as "the drag left the list" and cleared the drop indicator; handleDrop bails on a null indicator, so releasing just after an internal boundary crossing did nothing at all. Rows nested inside an expanded folder sit behind three extra boundaries (content zone → spacing div → row wrapper), so an expanded folder made it dramatically more likely — which is why it read as "open folders break dragging". Both sites (the container listener and isLeavingElement, which backs the root drop zone's onDragLeave) now go through one predicate that falls back to hit-testing the pointer against the element box when relatedTarget is null. Spring-open revert Hovering a collapsed folder mid-drag opens it after 400ms, but nothing ever closed it again, so dragging past a folder left it permanently expanded. Folders opened this way are now tracked and closed on drag end, keeping the drop destination and its ancestors open. Runs on drop, Esc-cancel, and release-outside alike. Reorder failures Failures were logger.error only, so a failed reorder looked like the sidebar spontaneously undoing the move. Now a toast. Promise.all also became Promise.allSettled: with all, one rejection abandoned the sibling request while it was still in flight and committing anyway, so the caller could not distinguish a total failure from a half-applied one. This does not make the two reorder writes atomic — folders and workflows share one sortOrder index space but commit through separate endpoints. The proper fix is a single application operation writing both in one transaction, which needs a new contract, a migration of two legacy raw routes, and a merged optimistic-update handler. Filed separately rather than bundled here. Cleanup carried along Deleted a dead sibling cache: both its read and write were gated on !isDraggingRef.current, so it was written only at drop time and cleared by the next dragstart before anything read it — a 100% miss rate on every path Replaced a duplicated comparator with the existing exported compareByOrder from the sidebar's own utils Hoisted five closure-free callbacks to module scope, shortening the dependency chains that feed every row's handler factories Destructured mutateAsync off the reorder mutations: the mutation objects take a new identity on each state transition, so depending on them re-created every row's handler object mid-drop initDragOver now reads isDraggingRef rather than the state that lags it by a render, which also stabilises all six drop-zone factories for the whole drag Type of Change Bug fix Testing 8 unit tests covering both dragleave paths, the spring-open revert (including "drop landed inside" and "user opened it themselves"), and the existing stranded-drag reset. Each fix was verified by reverting it individually and confirming exactly the matching test goes red. Not verified in a browser — the diagnosis is from source plus tests reproducing the exact event shape. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Fix drag-and-drop in the workflow sidebar silently doing nothing, which showed up most often when a folder was expanded Close folders that a drag spring-opened on its way past, instead of ...
X Description: Summary Fix drag-and-drop in the workflow sidebar silently doing nothing, which showed up most often when a folder was expanded Close folders that a drag spring-opened on its way past, instead of ...
Opengraph URL: https://github.com/simstudioai/sim/pull/6679
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bc84c283-c8b0-f0c6-6ec0-b8cd85d787aa |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8AB8:2C34A2:20C1D9:2DE9C3:6AFB50B9 |
| html-safe-nonce | 09d2d1791baedd3f4373e0f882b6c8fa41e3e951691c1e334f85e75fcd01828d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUI4OjJDMzRBMjoyMEMxRDk6MkRFOUMzOjZBRkI1MEI5IiwidmlzaXRvcl9pZCI6IjM2NDg0NDU1MDAzMzQ2MTQzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c0b19d6c4a743260277108d79ecdfe5cf6e226b38a05f4dcd282e6575e763807 |
| hovercard-subject-tag | pull_request:4275213387 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6679/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Fix drag-and-drop in the workflow sidebar silently doing nothing, which showed up most often when a folder was expanded Close folders that a drag spring-opened on its way past, instead of ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width