Skip to content

feat(ui): a middle click closes a tab (#1853) - #1920

Merged
echelon merged 1 commit into
storytold:mainfrom
mtlcl410:feat/middle-click-closes-tab
Oct 15, 2026
Merged

echelon merged 1 commit into
storytold:mainfrom
mtlcl410:feat/middle-click-closes-tab

Conversation

@mtlcl410

Copy link
Copy Markdown
Contributor

What this changes

Fixes #1853. A middle click on a tab closes it, as in Acrobat and browsers.

  • A document tab goes through the same path as its close button (close = Some(i) → Action::Close → request_close_tab), so a document with unsaved changes asks first instead of closing.
  • The Combine files tab closes on a middle click too.
  • Nothing else changes: a left click still activates the tab, and the context menu is as before.

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_clicked is egui's own per-button click tracking on the tab's existing click sense.

How you verified it

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.rs reverted the test fails: left: 2, right: 1 (both tabs still open).

Never-crash

  • No new unwrap/expect/indexing outside tests
  • No unsafe

Provenance

  • No assets, no external code. The behaviour is the common tab convention the issue describes.

Security

  • No paths, MCP, control channel or network involved

Parity and reach

  • A small interface convention; no parity/ entry describes tab gestures, so none changes. Not a headless operation, so no automation tool.

🤖 Generated with Claude Code

@mtlcl410
mtlcl410 force-pushed the feat/middle-click-closes-tab branch from f21e9c6 to 664d2cb Compare October 13, 2026 22:37
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
mtlcl410 force-pushed the feat/middle-click-closes-tab branch from 664d2cb to 5d81968 Compare October 14, 2026 04:46
@echelon
echelon merged commit 668f491 into storytold:main Oct 15, 2026
5 checks passed
@echelon

echelon commented Oct 15, 2026

Copy link
Copy Markdown
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

iRehmanAhmad added a commit to iRehmanAhmad/Rehman-PDF that referenced this pull request Oct 20, 2026
…y pass

- Merge of upstream tag v0.9.0 (645016a) into main (1da0c60): engine/render
  security and feature updates, vi locale added; fork identity kept (ur locale
  + reverse_rtl + corpus, trademark strip, app id, T-007/T-009 ATTRIBUTION
  state; assets gate green, 275 assets).
- Design pass: upstream organize_panel removed - the T-003 canvas action bar
  is the shipped Organize (PM decision); PageSelectionInput::show and
  DocView::organize_range removed with it (parse kept for the control
  channel); the panel's two upstream shape tests removed with it.
- Tab strip: upstream behaviours ported into the T-003 strip - middle-click
  closes a tab (storytold#1920), tab drop-line clamped into the clip rect in front of
  the first tab (storytold#2278); Home / combine_tab.focused handling verified present.
  the_edit_tab_turns_on_edit_text_and_images adapted to pick the mode tab by
  position (the fork's mode bar has two 'Edit' nodes); assertions unchanged.
- Excluded from this push: .github/workflows/ (token lacks workflow scope) -
  upstream's ci.yml changes and nix.yml stay at main's current state; the
  owner applies them manually.
- QA: full ui-egui suite - only GPU-env 'No adapter found' failures remain
  (no GPU on the test VM); cargo check --workspace clean; clippy -D warnings
  clean on the touched crate; cargo xtask assets + layers green.

Second parent is the v0.9.0 tag commit, so the merge topology is preserved.
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.

Middle mouse not closing tabs

2 participants