Skip to content

Make middle click not mousedown close tabs#44916

Merged
Anthony-Eid merged 8 commits intozed-industries:mainfrom
Zachiah:ZS/make-middle-click-close-not-middle-mousedown
Feb 5, 2026
Merged

Make middle click not mousedown close tabs#44916
Anthony-Eid merged 8 commits intozed-industries:mainfrom
Zachiah:ZS/make-middle-click-close-not-middle-mousedown

Conversation

@Zachiah
Copy link
Copy Markdown
Collaborator

@Zachiah Zachiah commented Dec 15, 2025

Closes #44856

Release Notes:

  • Make a full middle click be required to close tabs not just a middle mousedown

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Dec 15, 2025
@github-project-automation github-project-automation Bot moved this to Community Champion PRs in Quality Week – December 2025 Dec 15, 2025
@franciskafyi franciskafyi moved this from Community Champion PRs to Community PRs in Quality Week – December 2025 Dec 15, 2025
Comment thread crates/gpui/src/interactive.rs
@Zachiah Zachiah marked this pull request as ready for review December 16, 2025 02:10
@Zachiah
Copy link
Copy Markdown
Collaborator Author

Zachiah commented Dec 16, 2025

This PR needs extensive testing. I hope I took the right approach. This is by far my most substantial PR to zed so far so please have grace 🙃. I wonder if the methods I added should be used in other places? I added on_right_click even though I didn't need it because it felt crazy to add on_middle_click but not on_right_click

@Zachiah
Copy link
Copy Markdown
Collaborator Author

Zachiah commented Dec 16, 2025

I added on_right_click and on_middle_click instead of adding a first parameter to match the API of say on_mouse_down because I didn't want to make this a breaking change to gpui and have to update a billion places. If it is preferable to make a breaking change and add it as a first parameter just let me know and I will get working on that. My thought is that if we ever did want to do that we could change it to that from what it is currently fairly easily when we had other breaking changes say. I honestly don't know enough about how gpui is used and if it's fine to break it willy nilly to make the right call on my own.

Comment thread crates/gpui/src/elements/div.rs Outdated
@Anthony-Eid
Copy link
Copy Markdown
Contributor

if !click_listeners.is_empty() || drag_listener.is_some() {
You should add the new click listeners you added to this check

@Zachiah Zachiah force-pushed the ZS/make-middle-click-close-not-middle-mousedown branch from a628d5d to 22505dd Compare January 9, 2026 21:02
@Zachiah Zachiah force-pushed the ZS/make-middle-click-close-not-middle-mousedown branch from 22505dd to 476a948 Compare January 9, 2026 21:04
@Zachiah
Copy link
Copy Markdown
Collaborator Author

Zachiah commented Jan 9, 2026

@Anthony-Eid Thanks for the helpful feedback and review. I updated it. Sorry about the force push. The sqlite db had conflicts for me locally so I rebased and that fixed it.

@Anthony-Eid Anthony-Eid enabled auto-merge (squash) February 5, 2026 09:20
@Anthony-Eid Anthony-Eid merged commit 81562a3 into zed-industries:main Feb 5, 2026
27 checks passed
@github-project-automation github-project-automation Bot moved this from Community PRs to Done in Quality Week – December 2025 Feb 5, 2026
rtfeldman pushed a commit that referenced this pull request Feb 5, 2026
Closes #44856

This PR also adds an `on_aux_click` interface to the div element that follows MDM standard https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event

Release Notes:

- fix bug where mouse down middle click would close tab instead of full middle click

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
naaiyy added a commit to Glass-HQ/Glass that referenced this pull request Feb 16, 2026
Key changes:
- Thermal state detection (zed-industries#45638) - GPUI detects system thermal state, throttles to ~60fps when overheating
- Checkerboard shader for side-by-side diff (zed-industries#48417) - visual pattern for diff backgrounds
- cosmic-text v0.17 (zed-industries#48504) - fixes font ligatures on Linux
- Middle click tab close (zed-industries#44916) - on_aux_click/is_middle_click API additions
- Soft wrap modes for wrap width (zed-industries#46422)
- Tab switcher mode similar to vim/helix buffer picker (zed-industries#47079)
- Multi_buffer optimization batch (zed-industries#48519)
- TreeMap for diagnostics (zed-industries#48482) - performance improvement
- Semantic token follow-up fixes (zed-industries#48485)
- Claude Opus 4.6 and 1M context window model variants (zed-industries#48508)
- Anthropic adaptive thinking types (zed-industries#48517)
- Side-by-side diff: hunk gutter highlights restored, toolbar buttons for SplittableEditor
- Shell quote bypass fix in terminal permission system (zed-industries#48436)
- Project panel: Collapse All improvements (zed-industries#47328, zed-industries#48443)
- Edit prediction: trailing newlines fix, cursor position in global coords
- Properly discard tokens on language server stop (zed-industries#48490)
- AgentTool::NAME const instead of hardcoded strings (zed-industries#48506)

Conflict resolution:
- collab/editor_tests.rs: deleted (collab removed)
- vim (helix, motion, increment): deleted (vim removed)
- GPUI (17 files): deleted from Glass (handled in Obsydian-HQ/gpui)
- editor/items.rs: merged imports (added BufferId, kept Theme)
- project_diff.rs: removed old native_button toggle (upstream uses toolbar buttons now)
- lsp_store.rs: added SemanticTokenConfig, removed GlobalLogStore/LanguageServerKind
- project_panel.rs: merged UI imports (added ContextMenuEntry, ScrollAxes)
- Keymaps: took upstream JetBrains bindings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

Development

Successfully merging this pull request may close these issues.

Middle clicking on a tab closes it on mousedown instead of mouseup

5 participants