Repository navigation
feat(ui): a middle click closes a tab (#1853) - #1920
Merged
Merged
Conversation
mtlcl410
force-pushed
the
feat/middle-click-closes-tab
branch
from
October 13, 2026 22:37
f21e9c6 to
664d2cb
Compare
As in Acrobat and browsers. A document tab with unsaved changes asks first, through the same close request as its close button; the Combine files tab closes too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RUNQSPVXx3dDBabRZHAnjz
mtlcl410
force-pushed
the
feat/middle-click-closes-tab
branch
from
October 14, 2026 04:46
664d2cb to
5d81968
Compare
Member
|
Thank you @mtlcl410 for closing tabs with a middle click! It's merged into main now. If you haven't already, please come and join us on Discord: https://discord.gg/artcraft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Fixes #1853. A middle click on a tab closes it, as in Acrobat and browsers.
close = Some(i)→Action::Close→request_close_tab), so a document with unsaved changes asks first instead of closing.Middle-button auto-scroll (
autoscroll.rs) only starts inside the document viewport, so it doesn't see a click on the tab strip.Response::middle_clickedis egui's own per-button click tracking on the tab's existing click sense.How you verified it
cargo fmt --checkcargo clippy -p pdfcraft-ui-egui -j 2 --all-targets -- -D warningscargo test -p pdfcraft-ui-egui -j 2 --test ui: 45 of 46 pass. The one failure,dropping_a_pdf_on_the_window_opens_it, fails onmainon Windows without this change too: it runs a fixed three frames after the drop while the background open worker (Desktop: prepare large PDFs off the UI thread #1493) is still preparing the document. test(ui): extend native opening and continuation regression coverage #1764 already fixes it with await_for.Test.
a_middle_click_closes_the_tab(kittest) opens two documents, middle-clicks the first tab and requires that only the second remains, with no close prompt. It then edits the remaining document, middle-clicks its tab and requires that it is still open and a close request is pending.With
chrome.rsreverted the test fails:left: 2, right: 1(both tabs still open).Never-crash
unwrap/expect/indexing outside testsunsafeProvenance
Security
Parity and reach
parity/entry describes tab gestures, so none changes. Not a headless operation, so no automation tool.🤖 Generated with Claude Code