Skip to content

Close dock tab by middle click - #335

Open
Ash-86 wants to merge 1 commit into
musescore:mainfrom
Ash-86:make-middle-click-close-dock
Open

Ash-86 wants to merge 1 commit into
musescore:mainfrom
Ash-86:make-middle-click-close-dock

Conversation

@Ash-86

@Ash-86 Ash-86 commented Oct 3, 2026 •

Copy link
Copy Markdown

Resolves: musescore/MuseScore#35121

Middle-clicking a panel tab now closes that panel, as middle-click already does for score tabs.

Behaviour changes:

  • Middle-click on a panel tab closes that panel. It goes through the tab's own "Close" menu item (dock/set-open with that panel's dock_name), so the panel's open state and the menu check stay in sync.
  • Closing a tab other than the current one leaves the current tab selected.
  • Closing the current tab selects the tab before it (or the new first tab if it was the first), instead of jumping to the first tab.
  • After any tab is closed, the title of the selected tab stays highlighted. DockFrame.qml now re-evaluates prv.currentIndex when the number of tabs changes. Previously, closing a tab before the current one left no title highlighted, because currentIndex went stale. This also affects the existing context menu "Close".

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: musescore/muse_framework/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7a83a696-d758-43d8-ab11-96c19c7c28f2
📥 Commits

Reviewing files that changed from the base of the PR and between 404fb5c and 00e9c1a.

📒 Files selected for processing (2)
  • framework/dockwindow/qml/Muse/Dock/DockFrame.qml
  • framework/dockwindow/qml/Muse/Dock/DockTabBar.qml

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


📝 Walkthrough

Walkthrough

The dock frame now recalculates its current index when the tab count changes and returns zero when no tabs or C++ frame are available. Each dock tab also gains a middle-button handler that requests dock/set-open. When the clicked tab is current, the handler schedules tabClicked for the preceding index, or zero.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 00e9c

Middle-click resolves to the Close action, removes the dock, and selects the preceding tab. No actionable merge risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 00e9c

The change affects 1 system.

Changed systems: framework

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — framework (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in framework/dockwindow/qml/Muse/Dock/DockFrame.qml: prv.currentIndex now depends on the tab count and returns 0 when there are no tabs or frameCpp is unavailable; with tabs and a frame, it returns the nonnegative C++ index or 0. Previously, it used the C++ index whenever a frame existed and the index was nonnegative, without checking the tab count.
  • observed — Modified behavior in framework/dockwindow/qml/Muse/Dock/DockTabBar.qml: Each tab gains a middle-button handler that requests dock/set-open. If the clicked tab is current, it defers a tabClicked signal for the preceding index, or zero when the current index is zero.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description identifies the issue and explains the behavior changes. However, it omits the template’s required checklist, including the AI-assistance declaration when applicable. Add the template checklist and mark each item accurately. If AI assistance was used, mark that item and list the tools used.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main change: closing dock tabs with a middle click.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

Allow middle click to close dock tabs

1 participant