Skip to content

UI: Shift-click document tab close box closes all - #3974

Open
MiQ71 wants to merge 1 commit into
storytold:mainfrom
MiQ71:fix-3900-shift-close-all
Open

MiQ71 wants to merge 1 commit into
storytold:mainfrom
MiQ71:fix-3900-shift-close-all

Conversation

@MiQ71

@MiQ71 MiQ71 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3900.

Shift-clicking the close box on any document tab now uses the existing Close All path. Plain clicks still close only that tab, and unsaved documents keep the existing Save / Don't Save / Cancel flow.

Tests:

  • cargo test -p vectorcraft-ui-egui shift_clicking_a_tabs_close_box_closes_all_documents --lib
  • cargo test -p vectorcraft-ui-egui a_tabs_close_box_sits_where_the_platform_puts_it --lib
  • cargo test -p vectorcraft-ui-egui close_all_and_quit_ask_once_per_modified_document --lib

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or unimplemented! outside tests, and no unchecked indexing on data from files, parameters or messages. Errors are returned as Result and shown to the user.
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code.
  • Every new asset has a row in ASSETS.md (no new assets in this PR).

Summary by CodeRabbit

  • Bug Fixes
    • Shift-clicking a document tab’s close button now closes all documents through the unsaved-document flow. Any errors are shown in the status bar.
    • Clicking the close button without Shift continues to close only that tab.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 75dacb4 and 31f783a.

Files selected for processing: 1
  • crates/ui-egui/src/chrome.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Shift-clicking a document-tab close button now invokes the close-all flow. A plain click still closes only the selected tab. Errors from the close-all flow appear in the status bar. A test covers Shift-clicking when three documents are open.

Changes: Document-tab close gesture

Layer / File(s) Summary
Tab close gesture and close flow
crates/ui-egui/src/chrome.rs
doc_tabs routes Shift-clicks to unsaved::close_all with "closeAll" and displays returned errors in the status bar. Plain clicks retain the individual-tab close path. A test checks that Shift-clicking closes three open documents.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant CloseButton
  participant doc_tabs
  participant close_all as unsaved::close_all
  participant status as app.status
  CloseButton->>doc_tabs: Shift-click close button
  doc_tabs->>close_all: close_all(app, "closeAll")
  close_all-->>doc_tabs: Return result
  doc_tabs->>status: Display returned error
Loading

Possibly related PRs

Suggested reviewers: bflatastic

Merge Risk: Minimal · up to 31f78

The tab gesture appears ready to merge after normal checks; no actionable closing-flow risk remains identified.

Architecture risk: Medium · up to 31f78

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/ui-egui/src/chrome.rs: doc_tabs adds a close_all flag to track whether the close-button click requests closing every document.
  • observed — Modified behavior in crates/ui-egui/src/chrome.rs: A close-button click with Shift sets the close-all flag; without Shift, it records the clicked tab for individual closure.
  • observed — Modified behavior in crates/ui-egui/src/chrome.rs: doc_tabs calls unsaved::close_all with "closeAll" when the flag is set and reports errors through app.status; otherwise, the existing individual-tab close path runs.
  • observed — Modified behavior in crates/ui-egui/src/chrome.rs: Adds a test that opens three documents, Shift-clicks the first tab’s close button, and asserts that all documents are closed.

Reliability and maintainability

  • inferred — Risk-relevant change factors for crates: blast_radius_1; direct_dependents_1
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title "UI: Shift-click document tab close box closes all" matches the change in crates/ui-egui/src/chrome.rs, where Shift-clicking a document tab's close button runs the closeAll flow. A plain cli…
Linked Issues check Passed Issue [#3900] requires Shift+click on any tab close box to close all documents, while a plain click closes one document. The diff adds Shift detection for each tab close response and routes the gestur…
Out of Scope Changes check Passed The changes are limited to document-tab close handling and a focused UI test in crates/ui-egui/src/chrome.rs. The test supports issue [#3900]. No unrelated product behavior or new command is introdu…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files.
Description check Passed The description states the purpose (Shift-click on a document tab's close box runs the Close All path, plain clicks close only that tab, and unsaved documents keep the Save / Don't Save / Cancel flow)…
Full details: Title check

Explanation

The title "UI: Shift-click document tab close box closes all" matches the change in crates/ui-egui/src/chrome.rs, where Shift-clicking a document tab's close button runs the closeAll flow. A plain click still closes only that tab. The title is specific and describes the primary change. It uses a "UI:" prefix, which is acceptable.

Full details: Linked Issues check

Explanation

Issue [#3900] requires Shift+click on any tab close box to close all documents, while a plain click closes one document. The diff adds Shift detection for each tab close response and routes the gesture to crate::unsaved::close_all(app, "closeAll"); the plain path still calls crate::unsaved::close(app, i). The existing close_all and confirm flow preserves modified-document prompts, stops on cancellation, and uses file.closeAll. The added test covers three documents, and existing close_all_and_quit_ask_once_per_modified_document covers the shared prompt flow.

Full details: Out of Scope Changes check

Explanation

The changes are limited to document-tab close handling and a focused UI test in crates/ui-egui/src/chrome.rs. The test supports issue [#3900]. No unrelated product behavior or new command is introduced.

Full details: Description check

Explanation

The description states the purpose (Shift-click on a document tab's close box runs the Close All path, plain clicks close only that tab, and unsaved documents keep the Save / Don't Save / Cancel flow) and lists three test commands. It references the issue (#3900). It does not follow the template's 'What and why' and 'How it was tested' headings, and it has no explicit 'Why' rationale beyond the linked issue. The checklist is filled in and mirrors the template. Its 'How it was tested' content is limited to test command names without describing manual checks (CLI, MCP, screenshots) or results, and the checklist items are ticked without evidence. Overall the description is mostly complete, so it passes.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff. A plain click on a tab close box still closes that tab; with Shift held it runs Close All, and a failure goes to the status line as before. The new test sends a real shift-click on the first tab close box and checks every document closed, and the gate passes at this head.

@bflatastic

Copy link
Copy Markdown
Member

Thanks @MiQ71! The code is fine and goes through the existing close-all flow, but I couldn't find any public documentation that Shift-clicking a tab's close box closes all documents in the reference app (the tip I found is for Photoshop). I'm holding it on parity; if you can link a source for Illustrator, I'll take another look.

@MiQ71

MiQ71 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for catching that. I went back and checked the Illustrator references more carefully, and I can't substantiate the Shift-click behavior there either. The Illustrator material I found documents Close All via the tab context menu / Ctrl+Alt+W, while Shift-clicking the close box appears to be Photoshop behavior. So the parity claim in #3900 seems to be incorrect. No objection to holding this PR on that basis.

@sadkotheguest

Copy link
Copy Markdown

Thanks for catching that. I went back and checked the Illustrator references more carefully, and I can't substantiate the Shift-click behavior there either. The Illustrator material I found documents Close All via the tab context menu / Ctrl+Alt+W, while Shift-clicking the close box appears to be Photoshop behavior. So the parity claim in #3900 seems to be incorrect. No objection to holding this PR on that basis.

Thanks for digging into the references again — and thanks for the PR itself, it's appreciated.

One clarification on the parity claim, because I think we're measuring different things. The Shift+click isn't something I took from Adobe's documentation: it's an undocumented gesture in Illustrator. It isn't in the help pages, the shortcut list, or (as far as I could find) any community post — which is exactly why the references don't substantiate it. So "the docs don't describe it" and "the app doesn't do it" are two different statements here, and my original write-up didn't make that distinction clearly enough. I've since updated the issue to say the behaviour is observed, not documented.

What I can offer instead of a citation is a reproduction on a stock Illustrator install:

  1. Open three documents, so three tabs are visible.
  2. Hover any tab, hold Shift, click the × on that tab.
  3. All three documents close in one action, with the usual save prompts for modified ones.
    That's the behaviour on the desktop build I use, and it's the reason the muscle memory exists — someone who works this way for years simply expects the × to behave that way in other apps too.

Whether Photoshop shares the gesture I honestly don't know; both use the same tabbed document shell, so it wouldn't surprise me. But "also in Photoshop" wouldn't make it Photoshop-only — the point is that Illustrator does it as well, just quietly.

Since there's no documentation to cite, the practical check is the app itself: anyone with Adobe Illustrator installed can repeat steps 1–3 above in under a minute and see the result directly.

@Messhias Messhias left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo xtask ci is incomplete or unchecked on this PR. Run it end to end (fmt, clippy, tests, assets, brands, layers, wasm), tick the checklist when green, and reply here with the outcome. That is required before any approve from here.

@MiQ71

MiQ71 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Ran cargo xtask ci end to end on the current head (31f783ae). All 12 steps passed: fmt, clippy, tests, doctests, no-bundled-fonts, pdf-deps, assets, brands, cursors, i18n-report, layers, and wasm. I also restored and checked the PR checklist.

@sadkotheguest

Copy link
Copy Markdown

cargo xtask ci is incomplete or unchecked on this PR. Run it end to end (fmt, clippy, tests, assets, brands, layers, wasm), tick the checklist when green, and reply here with the outcome. That is required before any approve from here.

@Messhias
Cargo xtask ci run has been completed.

This branch has not been deployed

No deployments
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.

Close all documents with Shift+click on a tab's close button

5 participants