Skip to content

Fix tab drop after the last tab in the strip#226

Merged
parsakhaz merged 1 commit into
mainfrom
fix/strip-drop-after-last-tab
Jun 12, 2026
Merged

Fix tab drop after the last tab in the strip#226
parsakhaz merged 1 commit into
mainfrom
fix/strip-drop-after-last-tab

Conversation

@parsakhaz

Copy link
Copy Markdown
Member

Description

Dragging a tab to the right of the last tab in a strip (e.g. after Diff/Explorer/Browser in the top bar) was impossible: the drop indicator always meant insert-before-the-hovered-tab, and the strip's trailing empty space was not a drop target, so drops there silently did nothing. This was flagged as a UX gap in the #224 review.

Now the strip follows the VS Code midpoint rule:

  • Hovering the left half of a tab inserts before it; the right half inserts after it.
  • The empty space after the last tab is a drop target that appends.
  • The end-of-strip position shows a right-edge indicator on the last tab; between-tab boundaries keep showing the next tab's left edge, so there is always exactly one indicator.
  • Drops commit the midpoint-adjusted index, which composes with the same-group reorder index adjustment in movePanel (dropping a tab on its own right half is a no-op, as expected).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have run pnpm typecheck and pnpm lint locally

Critical Areas Modified

  • None of the above (single component, drag/drop handlers only)

The strip drop indicator always meant insert-before-the-hovered-tab, so
the position after the last tab was unreachable and dropping in the
strip's trailing empty space silently did nothing.

- use the VS Code midpoint rule: the cursor's half of the hovered tab
  decides insert-before (left half) vs insert-after (right half)
- the trailing empty space is now a drop target that appends
- the end-of-strip position renders a right-edge indicator on the last
  tab; between-tab boundaries keep rendering as the next tab's left edge
- drops commit the midpoint-adjusted index instead of the raw tab index
@parsakhaz parsakhaz merged commit 6b3e937 into main Jun 12, 2026
4 checks passed
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