Skip to content

fix(tabs): stop drag auto-scroll#2771

Open
janburzinski wants to merge 1 commit into
mainfrom
jan/eng-1762-dragging-a-tab-can-make-the-tab-bar-disappear
Open

fix(tabs): stop drag auto-scroll#2771
janburzinski wants to merge 1 commit into
mainfrom
jan/eng-1762-dragging-a-tab-can-make-the-tab-bar-disappear

Conversation

@janburzinski

Copy link
Copy Markdown
Collaborator

Description

  • fixes tab bar "disappearing" during tab drag

Screenshot/Recording (if applicable)

https://cap.link/z86xe7s5cqb7hef

Checklist
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • I updated docs when behavior or setup changed
  • I added or updated tests when behavior changed, or explained why not
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for commit
    messages and, when possible, the PR title

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes an issue where the tab bar would visually "disappear" during tab drag operations by disabling the auto-scroll behavior of @dnd-kit/core's DndContext.

  • Adds autoScroll={false} to the DndContext in SplitPaneLayout, preventing dnd-kit from manipulating scroll position during drag, which was causing the tab bar to scroll out of view.

Confidence Score: 5/5

Single-prop addition with no risk of regressions; tab drag still works, just without auto-scroll.

The change is a one-prop addition to DndContext that stops dnd-kit from adjusting scroll during drag. The tab bar is a fixed-height horizontal strip where auto-scroll provided no useful behavior anyway, so disabling it has no negative UX side effects in realistic usage.

No files require special attention.

Important Files Changed

Filename Overview
apps/emdash-desktop/src/renderer/features/tasks/view/task-main-column.tsx Adds autoScroll={false} to DndContext to prevent the tab bar from scrolling out of view during tab drag operations.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant DndContext
    participant AutoScroll
    participant TabBar

    Note over AutoScroll: autoScroll=false (this PR)

    User->>DndContext: "Start drag (pointer down + distance > 6px)"
    DndContext->>TabBar: onDragStart → setActiveDragId
    DndContext--xAutoScroll: Auto-scroll suppressed
    Note over TabBar: Tab bar stays visible
    User->>DndContext: Release pointer
    DndContext->>TabBar: onDragEnd → handleDragEnd / onDragCancel
    DndContext->>TabBar: setActiveDragId(null)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant DndContext
    participant AutoScroll
    participant TabBar

    Note over AutoScroll: autoScroll=false (this PR)

    User->>DndContext: "Start drag (pointer down + distance > 6px)"
    DndContext->>TabBar: onDragStart → setActiveDragId
    DndContext--xAutoScroll: Auto-scroll suppressed
    Note over TabBar: Tab bar stays visible
    User->>DndContext: Release pointer
    DndContext->>TabBar: onDragEnd → handleDragEnd / onDragCancel
    DndContext->>TabBar: setActiveDragId(null)
Loading

Reviews (1): Last reviewed commit: "fix(tabs): stop drag auto-scroll" | Re-trigger Greptile

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