Skip to content

feat: close tabs with middle mouse click #268

Description

@ebifrier

Feature description

Tabs in the group tab bar can currently only be closed with the × button or the context menu. Browsers and most editors also close a tab on middle mouse click, and muscle memory makes people try it here too. Right now a middle click does nothing (it just activates the tab).

Proposed solution

Close a non-permanent tab on middle click (auxclick with button === 1) in GroupTabBar.svelte, for both workspace and Home tab groups, reusing the existing close handler so the behaviour matches the × button.

Two small details worth handling at the same time:

  • The pointerdown handler currently activates the tab for any mouse button. Restricting it to the primary button avoids briefly focusing a background tab before it is closed.
  • Cancelling pointerdown for the middle button suppresses the browser's autoscroll cursor on Linux/Windows.

Permanent tabs (Home, Files) are excluded, same as they have no × button.

Additional context

Implemented on a fork; single-file frontend change (+18/-1):
main...ebifrier:computer:feat/middle-click-close-tab

Related: #254 (rename tabs via the tab-bar context menu) touches the same tab bar but is a separate feature.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions