fix(desktop): reorder repo tabs via pointer events (mouse, touch, pen) + keyboard a11y#121
Merged
Merged
Conversation
added 2 commits
July 8, 2026 13:04
Le drag-and-drop HTML5 natif est peu fiable dans les webviews WebKit qui font tourner l'app Tauri : dragstart ne se déclenche souvent pas. On pilote le réordonnancement avec des événements souris à la place. 🪄 Commit via GitWand
Ajoute un contour discret aux onglets inactifs et augmente l'opacité des affordances (caret, fermeture) pour qu'elles restent perceptibles sans survol. 🪄 Commit via GitWand
added 2 commits
July 9, 2026 10:53
Addresses correctness defects in the RepoTabStrip.vue pointer-drag rewrite found in PR #121's review: - Hit-test now compares the dragged tab's own shifted center (offset from its drag-start position) against the other tabs' centers, instead of the raw cursor position — a press near a tab's edge no longer overshoots into a reorder from a few pixels of hand wobble. - Only the left mouse button can end a drag; a right/middle-click released mid-drag (e.g. after middle-click closed another tab) is ignored instead of committing a stale reorder. - Releasing well above/below the strip, pressing Escape, or losing the mouseup to a window blur (alt-tab, native dialog) cancels the drag instead of always committing wherever the cursor lands. - Tab centers are re-snapshotted on strip scroll, and a tab opening/closing mid-drag now aborts the drag instead of committing against a stale position/index snapshot. - `didDrag` resets on a deferred tick rather than only via the trailing click, so it can't get stuck and swallow the next keyboard tab activation when the mouseup lands off the dragged tab. - Dropped the unconditional `preventDefault()` on tab mousedown, which was suppressing click-to-focus on the tablist (text selection is already blocked by `user-select: none` in CSS). - Removed the dead `.repo-tab__caret` branch from the drag-start guard (the caret already stops propagation on its own mousedown). Adds regression coverage for the wobble/reorder, wrong-button, and cancel-outside/blur cases. disabled
Extends the tab-reorder fix per code-review follow-ups: - Migrate mouse events to Pointer Events (setPointerCapture, feature- detected with a try/catch fallback) so drag-to-reorder works with touch and pen input, not just a mouse. `touch-action: none` on the tab claims the horizontal pan gesture so the strip's native overflow-x scroll can't win the race and hijack a touch drag mid-way; `pointercancel` cancels the drag if it does anyway. - Add Ctrl/Cmd+ArrowLeft/Right keyboard reordering with an aria-live announcement (`role="status"`) — the pointer/touch drag had no keyboard equivalent, leaving reordering unreachable without a mouse, trackpad or touchscreen. - Re-snapshot tab centers on window resize mid-drag too, not just on strip scroll — a resize shifts every tab's viewport position the same way a scroll does. - Fix a double-counting bug in that re-snapshot logic: re-measuring the dragged tab's rect mid-drag picks up its live translateX, which then got added to the drag offset a second time in the hit-test, overshooting the drop by however far the tab had already moved. New locale key `header.tabStripReorderAnnounce` added to all 5 locales for the keyboard-reorder announcement. disabled
Bare Ctrl+ArrowLeft/Right collides with macOS's default Mission Control "switch Space" shortcut, which the OS intercepts before the keydown ever reaches any app — a browser included, so this isn't Tauri-specific. Cmd+Arrow isn't bound by default, but third-party window-manager utilities and user remaps commonly claim bare Ctrl/Cmd+Arrow too. Require Shift alongside Ctrl/Cmd (Ctrl/Cmd+Shift+ArrowLeft/Right) to stay clear of every OS-level and third-party shortcut we know of for this combo, the same reasoning VS Code's editor-move commands use a Shift-modified combo rather than a bare arrow. Updates the aria-keyshortcuts hint and adds a regression test confirming a bare Ctrl+Arrow (no Shift) no longer triggers a reorder. disabled
devlint
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The native HTML5 drag-and-drop is unreliable in the WebKit webviews that host the Tauri app, where
dragstartoften fails to fire. This change drives tab reordering with pointer events instead (mouse, touch and pen in one code path), adds a keyboard equivalent for accessibility, and improves the visibility of inactive repo tabs.Changes
RepoTabStrip.vueAccessibility & cross-input follow-ups
setPointerCapture, feature-detected) — touch/pen drag now works, not just mouse.aria-liveannouncement — screen reader / keyboard-only users previously had no way to reorder tabs at all. (Shift is required alongside Ctrl/Cmd: a bare Ctrl+Arrow is macOS's default Mission Control "switch Space" shortcut, intercepted by the OS before any app — browsers included — ever sees the keydown.)translateXwas being measured back into the snapshot, then added a second time) that would otherwise have shipped a new drag-offset bug on scroll/resize.didDragflag that could swallow a keyboard tab activation, and a click-to-focus regression from an unconditionalpreventDefault().Test plan
Ctrl/Cmd+Shift+ArrowLeft/Right) and confirm both the order update and the screen-reader announcementHow it looks
Before
Now