Repository navigation
Studio: drag sidebar rows in the desktop app, and drop the drag hint - #11561
Conversation
Sidebar rows were wired to the HTML5 drag API, which the desktop webview never forwards to the page, so no row could be dragged there. Rebuild the gesture on pointer events, and take out the label that followed the cursor.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85b9e50037
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Edge scrolling ran off pointermove alone, so a pointer resting on the edge took one step and stalled, and the cue stayed on the row that had slid away. A frame loop drives it now and re-aims as the list moves. The window handlers also answered every pointer, so a finger could drive and drop a drag the mouse started, which is what touch is kept out of. Each one now answers only the pointer that pressed the row.
|
Both findings were right, and both are fixed in 6e02cae. Edge scrolling. Pointer identity. The window handlers answered every pointer. Both are covered by tests in Note that 3badef5 on this branch is a pre-commit.ci autofix touching backend Python formatting. It is not mine and is unrelated to the sidebar. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e02caec80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Rebuilding Live test (the real hook on a 60-row scrolling list, driven by Playwright in Chromium, at
Checks:
Desktop: I tested in Chromium, not in a Tauri build. The macOS and Windows fix follows from the wry drag handling in the description, the same reason LGTM. |
|
Right, and confirmed in the code: This PR was already merged when the review landed, so the fix is #11568 against main. Escape no longer ends the gesture there. It marks it escaped, clears the drag and leaves the pointer listeners in place, so the release is what detaches, swallows the click and returns without a drop. A move after escape is ignored, so a cancelled drag cannot come back to life under a pointer that keeps travelling. Escape before the threshold still abandons the press outright, since nothing was lifted and a click after it belongs to the row. |
…nslothai#11561) * Studio: drag sidebar rows in the desktop app, and drop the drag hint Sidebar rows were wired to the HTML5 drag API, which the desktop webview never forwards to the page, so no row could be dragged there. Rebuild the gesture on pointer events, and take out the label that followed the cursor. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Keep the edge scroll going, and let one pointer own the drag Edge scrolling ran off pointermove alone, so a pointer resting on the edge took one step and stalled, and the cue stayed on the row that had slid away. A frame loop drives it now and re-aims as the list moves. The window handlers also answered every pointer, so a finger could drive and drop a drag the mouse started, which is what touch is kept out of. Each one now answers only the pointer that pressed the row. --------- Co-authored-by: Unsloth <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The bug
#11373 gave every sidebar row a drag gesture built on the HTML5 drag API:
draggable,dragstart,dragover,drop. That works in a browser. In the desktop app no row can be dragged anywhere, and since the same PR took Move up and Move down out of the row menus for everything but touch screens, there is no way left to reorder a chat there short of alt and an arrow key.The webview owns every OS drag. wry answers
draggingEntered,draggingUpdatedandperformDragOperationitself, and only calls through to the webview when the listener declines the event:Tauri's listener always returns
true, so nothing in the page hears the drag anddragoveranddropnever fire.Windows gets to the same place by another route. wry walks the child HWNDs and calls
RevokeDragDropon each one before registering its own target, throwing away the target WebView2 implements HTML5 drag and drop on. The replacement returns early unless the payload carriesCF_HDROP, so a dragged row is ignored and the original target is gone. Linux looks unaffected: those handlers returnfalseand revoke nothing, so WebKit keeps its own drag and drop.None of this is new to us.
shared-composer.tsxalready skips its own drop handlers underisTauri, and files arrive throughfeatures/native-intentson Tauri's own DragDrop window event. That path carries OS file paths and has nothing to say about a chat row.Turning
dragDropEnabledoff is not the fix. It would take the native file drop with it.The fix
hooks/use-sidebar-drag.tsis rebuilt on pointer events.lib/sidebar-drag.tsis untouched, so every drop rule and every cue stands as it was.data-sidebar-dropattribute, andelementsFromPointhit tests innermost first. Same nesting the old dragover bubbling gave: row, then folder block, then section.The drag hint goes
The label that followed the cursor reading Pin, Unpin, Reorder or Move to a folder is gone, along with
shell.drag.*in all 12 locales. The line on the landing edge and the ring around a folder already say where the row will land.Tests
npm run testpasses 8466.sidebar-row-drag.test.tskeeps its planner coverage and gains the guard that would have caught this: the suite fails ifdraggable,onDragOverordataTransfercomes back to the sidebar.npm run i18n:checkpasses across all 12 locales. Lint is unchanged from the baseline on every file touched.