Skip to content

fix(native): end a tab drag that can no longer hear its drop - #934

Merged
omartelo merged 1 commit into
mainfrom
fix/native-stuck-tab-drag
Oct 24, 2026
Merged

omartelo merged 1 commit into
mainfrom
fix/native-stuck-tab-drag

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Summary

A top bar tab could get stuck lifted (accent fill, detached shape) until lich restarted, and no tab could be dragged again.

  • Keyboard drag losing focus. A click focuses the tab; Space or Enter then picks it up to reorder from the keyboard. Space and Escape only reach the focused item, so once a click elsewhere (the terminal) took the keyboard, the drag could neither drop nor cancel, and pointer ignores every press while active is set. The drag now ends, dropping nothing, when its item loses focus.
  • Pointer drag disabled mid-drag. A layout tab's rename sets Sortable.Disabled, which lays the items out without a handler, so the release of a drag already in the air never arrived. Update now ends the drag when the Sortable is disabled.

Test plan

  • TestSortableKeyboardDragEndsWhenFocusLeaves and TestSortableDisabledMidDragEndsIt fail without the fix and pass with it.
  • native/: gofmt -l ., go vet ./..., go test ./... clean.

A keyboard drag listens for Space and Escape only on the focused item, so
once focus moved elsewhere the tab stayed lifted for good and every other
press was ignored. A pointer drag whose Sortable turned Disabled mid-drag
(a layout tab's rename) lost its release the same way. Both now end the
drag without dropping.
@omartelo
omartelo merged commit 81ae9bc into main Oct 24, 2026
7 checks passed
@omartelo
omartelo deleted the fix/native-stuck-tab-drag branch October 24, 2026 01:29
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.

1 participant