Skip to content

Fix context menu on collapsed clips - #12205

Merged
grliszas14 merged 2 commits into
audacity:masterfrom
grliszas14:clip_menu
Oct 20, 2026
Merged

grliszas14 merged 2 commits into
audacity:masterfrom
grliszas14:clip_menu

Conversation

@grliszas14

Copy link
Copy Markdown
Contributor

Resolves: #12204

  • I signed CLA
  • This PR includes AI assistance
  • If the PR is AI-assisted, I have read, understood and complied with the guidelines for AI-assisted contributions
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

@grliszas14
grliszas14 requested a review from kryksyh September 17, 2026 14:19
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

📝 Walkthrough

Walkthrough

ClipItem adds a cursor-enabled HoverHandler to its hover state. The collapsed clip header remains visible while its menu is open. When the clip is collapsed, ClipHandles excludes the visible menu button from right trim hit testing.

Priority: ➖ Normal

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

Severity of issue fixed: Medium


Merge Risk: 🔵 Low · up to e41e5

Collapsed clips may still have a narrow right-trim area that does not respond, and the header may hide during a right-click menu. These are localized interface risks; the right-click menu behavior remains uncertain.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: fixing the context menu for collapsed clips.
Description check Passed The description links the resolved issue and completes the required checklist. It omits the template's short description of the changes and motivation, but it remains mostly complete and relevant.
Linked Issues check Passed The changes address issue [#12204]. ClipItem.qml keeps the collapsed header visible while its menu is open and includes clipHoverHandler.hovered in the hover state. ClipHandles.qml excludes the …
Out of Scope Changes check Passed The changes are limited to ClipItem.qml and ClipHandles.qml. They modify collapsed-header visibility, hover state, and trim-handle hit testing for the menu button. Each change supports issue [#122…

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 0d8170fe-f8a8-4c24-8320-9ed8532679fd

📥 Commits

Reviewing files that changed from the base of the PR and between de2e43d and 892f033.

📒 Files selected for processing (1)
  • src/projectscene/qml/Audacity/ProjectScene/tracksitemsview/ClipItem.qml

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

z: 2

visible: !root.collapsed || root.hover
visible: !root.collapsed || root.hover || menuBtn.isMenuOpened

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

set -eu
printf '%s\n' '--- candidate files ---'
fd -i '.*(ClipItem|ContextMenuLoader|MenuButton).*' src | head -80
printf '%s\n' '--- relevant references ---'
rg -n -C 5 'singleClipContextMenuLoader|multiClipContextMenuLoader|isMenuOpened|ContextMenuLoader|MenuButton' src/projectscene/qml/Audacity/ProjectScene/tracksitemsview src/projectscene/qml 2>/dev/null | head -260

Repository: audacity/audacity

Length of output: 28656


🏁 Script executed:

set -eu
printf '%s\n' '--- type definitions and imports ---'
rg -n -C 8 '(^|[[:space:]])(component[[:space:]]+)?(ContextMenuLoader|MenuButton)[[:space:]]*\{|ContextMenuLoader|MenuButton' src --glob '*.qml' --glob '*.qrc' --glob '*.cmake' | head -360
printf '%s\n' '--- QML files containing likely definitions ---'
rg -l 'ContextMenuLoader|isMenuOpened' src --glob '*.qml' | sort

Repository: audacity/audacity

Length of output: 37187


🏁 Script executed:

set -eu
printf '%s\n' '--- exact definitions across tracked files ---'
git grep -n -E 'ContextMenuLoader|isMenuOpened|class[[:space:]]+MenuButton|MenuButton::|QML_ELEMENT|show[[:space:]]*\(' -- \
  ':!*.qml' ':!*.json' ':!*.ts' ':!*.js' | head -400
printf '%s\n' '--- QML imports for ClipItem ---'
sed -n '1,80p' src/projectscene/qml/Audacity/ProjectScene/tracksitemsview/ClipItem.qml

Repository: audacity/audacity

Length of output: 9700


🏁 Script executed:

set -eu
printf '%s\n' '--- tracked names ---'
git ls-files | rg -i 'context.*menu|menu.*button|qmldir|uicomponents' | head -240
printf '%s\n' '--- module metadata and relevant properties ---'
git grep -n -i -E 'Muse\.UiComponents|ContextMenuLoader|MenuButton|isMenuOpened' -- \
  '*CMakeLists.txt' '*.cmake' '*.qmltypes' 'qmldir' '*.qrc' '*.pri' 2>/dev/null | head -300
printf '%s\n' '--- local MenuButton usage ---'
git grep -n -C 3 'MenuButton[[:space:]]*{' -- '*.qml' | head -180

Repository: audacity/audacity

Length of output: 10777


🌐 Web query:

"ContextMenuLoader" "isMenuOpened" "MenuButton" Muse UiComponents

💡 Result:

<search_synthesis>
The components and concepts you mentioned (ContextMenuLoader, isMenuOpened, MenuButton) appear in the context of custom UI development within the MuseScore application, specifically within their muse::uicomponents framework, which utilizes QML [1][2]. In the MuseScore codebase, ContextMenuLoader and MenuButton are QML components used to handle context menus and their associated interaction logic [3]. For instance, MenuButton typically interfaces with a ContextMenuModel (e.g., PianoKeyboardPanelContextMenuModel or CloudAudioFileContextMenuModel), which inherits from muse::uicomponents::AbstractMenuModel [1][4]. The property isMenuOpened or similar state-tracking boolean values are often used in these components to manage the visible state of the menu during user interactions [3]. It is important to distinguish these components from: 1. Muse-UI: A separate, third-party Material Design UI library for Vue.js 2.0 [5][6]. 2. WPF UI: A library for WPF applications that also contains a component named ContextMenuLoader used for overwriting default context menu styles in specific UIElements [7][8]. In summary, when discussing ContextMenuLoader, MenuButton, and UiComponents in the same context, you are likely referring to the internal QML framework used by MuseScore [1][2]. If you are working in a different technical stack, the names likely refer to the WPF UI library or a coincidence in naming conventions across different projects [7][9].
</search_synthesis>

<source_evidence>

<title>src/notationscene/qml/MuseScore/NotationScene/pianokeyboard/pianokeyboardpanelcontextmenumodel.h</title> https://github.com/musescore/MuseScore/blob/main/src/notationscene/qml/MuseScore/NotationScene/pianokeyboard/pianokeyboardpanelcontextmenumodel.h # src/notationscene/qml/MuseScore/NotationScene/pianokeyboard/pianokeyboardpanelcontextmenumodel.h - Branch: main - Repository: musescore/MuseScore --- /* * SPDX-License-Identifier: GPL-3.0-only * MuseScore-Studio-CLA-applies * * MuseScore Studio * Music Composition & Notation * * Copyright (C) 2022 MuseScore Limited and others * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see. */ `#pragma` once `#include` <qqmlintegration.h> `#include` "actions/actionable.h" `#include` "uicomponents/qml/Muse/UiComponents/abstractmenumodel.h" `#include` "modularity/ioc.h" `#include` "actions/iactionsdispatcher.h" `#include` "inotationsceneconfiguration.h" namespace muse { class TranslatableString; } namespace mu::notation { class PianoKeyboardPanelContextMenuModel : public muse::uicomponents::AbstractMenuModel, public muse::actions::Actionable { Q_OBJECT Q_PROPERTY(int numberOfKeys READ numberOfKeys NOTIFY numberOfKeysChanged) Q_PROPERTY(qreal keyWidthScaling READ keyWidthScaling WRITE setKeyWidthScaling NOTIFY keyWidthScalingChanged) QML_ELEMENT muse::GlobalInject configuration; muse::ContextInject dispatcher = { this }; public: explicit PianoKeyboardPanelContextMenuModel(QObject* parent = nullptr); Q_INVOKABLE void load() override; qreal keyWidthScaling() const; void setKeyWidthScaling(qreal scaling); int numberOfKeys() const; signals: void keyWidthScalingChanged(); void setKeyWidthScalingRequested(qreal scaling); void numberOfKeysChanged(); private: muse::uicomponents::MenuItem* makeViewMenu(); muse::uicomponents::MenuItem* makeKeyWidthScalingItem(const muse::TranslatableString& title, qreal scaling); muse::uicomponents::MenuItem* makeNumberOfKeysItem(const muse::TranslatableString& title, int numberOfKeys); void updateKeyWidthScalingItems(); muse::uicomponents::MenuItemList m_keyWidthScalingItems; qreal m_currentKeyWidthScaling = 0.0; }; } <title>e2e0e02 Migrate muse_uicomponents to a proper QML module</title> https://github.com/musescore/MuseScore/commit/e2e0e02ca14c97f6a8c39855b0c5935a3fa8080b | src/framework/uicomponents/qml/Muse/UiComponents/CMakeLists.txt | added | 219 | 0 | | src/framework/uicomponents/qml/Muse/UiComponents/ColorPicker.qml | modified | 1 | 3 | | src/framework/uicomponents/qml/Muse/UiComponents/StyledPopupView.qml | modified | 0 | 3 | ... | src/framework/uicomponents/qml/Muse/UiComponents/Utils.mjs | renamed | 6 | 7 | ... | src/framework/uicomponents/qml/Muse/UiComponents/abstractmenumodel.cpp | renamed | 0 | 0 | | src/framework/uicomponents/qml/Muse/UiComponents/abstractmenumodel.h | renamed | 3 | 0 | ... | src/framework/uicomponents/qml/Muse/UiComponents/abstracttoolbarmodel.cpp | renamed | 0 | 0 | | src/framework/uicomponents ... toolbarm ... .h | renamed | 15 | 10 | ... | src/framework/uicomponents/qml/Muse/UiComponents/buttonboxmodel.cpp | renamed | 0 | 0 | | src/framework/uicomponents/qml/Muse/UiComponents/buttonboxmodel.h | renamed | 3 | 4 | ... | src/framework/uicomponents/qml/Muse/UiComponents/menuitem.cpp | renamed | 0 | 0 | | src/framework/uicomponents/qml/Muse/UiComponents/menuitem.h | renamed | 5 | 4 | | src/framework/uicomponents/qml/Muse/UiComponents/menuview.cpp | renamed | 0 | 0 | | src/framework/uicomponents/qml/Muse/UiComponents/menuview.h | renamed | 3 | 0 | ... | src/framework/uicomponents/uicomponentsmodule.cpp | modified | 1 | 67 | | src/framework/uicomponents/uicomponentsmodule.h | modified | 1 | 7 | | src <title>Some Incredible Code</title> https://cephalochromoscope.net/472c833c-f85f-464e-b598-5524dc47e85b property TrackViewStateModel trackViewState: TrackViewStateModel { trackId: root.item ? root.item.trackId : -1 } TrackContextMenuModel { id: contextMenuModel trackId: root.item ? root.item.trackId : -1 onTrackRenameRequested: title.edit() onOpenRequested: { menuButton.toggleMenu(menuButton) } } function init() { trackViewState.init() contextMenuModel.load() // Disable ancestor&`#39`;s states // to provide custom styling states = [] } ContextMenuLoader { id: contextMenuLoader onHandleMenuItem: function (itemId) { contextMenuModel.handleMenuItem(itemId) } } MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton onClicked: function (e) { if (!isSelected) { root.selectionRequested(true) } contextMenuLoader.show(Qt.point(e.x, e.y), contextMenuModel.items) } } ... anchors.bottom ... width: ... color: "transparent" ... ColumnLayout { ... contentColumn ... anchors.left: spacer.right anchors.right: separatorLine.left ... anchors.top: parent.top anchors.topMargin: 7 anchors.margins: 12 RowLayout { Layout.fillWidth: true spacing: 8 StyledIconLabel { iconCode: Boolean(root.item) ? root.item.icon : 0 } EditableLabel { id: title Layout.preferredHeight: title.implicitHeight Layout.fillWidth: true text: Boolean(root.item) ? root.item.title : "" navigation.panel: root.headerNavigationPanel navigation.order: root.navigation.order + 1 onTextEdited: function (text) { if (Boolean(root.item)) { root.item.title = text } } } Loader { id: headerTrailingControls visible: root.collapsed && item !== null } MenuButton { id: menuButton menuModel: contextMenuModel navigation.panel: root.headerNavigationPanel navigation.order: root.collapsed ? root.headerTrailingControlsNavigationEnd + 1 : title.navigation.order + 1 navigation.accessible.name: qsTrc("projectscene", "Track menu") onClicked: { root.selectionRequested(true) } onHandleMenuItem: function (itemId) { contextMenuModel.handleMenuItem(itemId) } } } Loader { id: extraControlsLoader Layout.fillWidth: true Layout.preferredHeight: implicitHeight } } Separator <title>Some Incredible Code</title> https://cephalochromoscope.net/537d9928-7818-4c2b-9f2a-ae00e4553b20 # Some Incredible Code The content below is some of the most incredible code we&`#39`;ve ever had the privilege of coming across. ``` /* * Audacity: A Digital Audio Editor */ `#include` "cloudaudiofilecontextmenumodel.h" `#include` "framework/actions/actiontypes.h" using namespace au::project; namespace { constexpr const char* OPEN_AUDIO_FILE_ACTION = "audacity://cloud/open-audio-file"; constexpr const char* OPEN_AUDIO_PAGE_ACTION = "audacity://cloud/open-audio-page"; } CloudAudioFileContextMenuModel::CloudAudioFileContextMenuModel(QString audioId, QString slug, QObject* parent) : AbstractMenuModel(parent), m_audioId(std::move(audioId)), m_slug(std::move(slug)) { } void CloudAudioFileContextMenuModel::load() { muse::uicomponents::AbstractMenuModel::load(); muse::uicomponents::MenuItem* openItem = makeMenuItem(OPEN_AUDIO_FILE_ACTION); muse::uicomponents::MenuItem* viewAudiocom = makeMenuItem(OPEN_AUDIO_PAGE_ACTION); setItems({ openItem, viewAudiocom }); } void CloudAudioFileContextMenuModel::handleMenuItem(const QString& itemId) { if (itemId == OPEN_AUDIO_PAGE_ACTION) { if (m_slug.isEmpty()) { return; } muse::actions::ActionQuery query(OPEN_AUDIO_PAGE_ACTION); query.addParam("slug", muse::Val(m_slug)); dispatch(query); return; } if (itemId == OPEN_AUDIO_FILE_ACTION) { if (m_audioId.isEmpty()) { return; } muse::actions::ActionQuery query(OPEN_AUDIO_FILE_ACTION); query.addParam("audioId", muse::Val(m_audioId)); dispatch(query); return; } AbstractMenuModel::handleMenuItem(itemId); } ``` Thanks for stopping by! <title>museui/muse-ui</title> https://github.com/museui/muse-ui/ # museui/muse-ui Material Design UI library for Vuejs 2.0 - Stars: 8153 - Forks: 883 - Watchers: 8153 - Open issues: 186 - Homepage: https://muse-ui.org - Default branch: master - Created: 2016-09-19T00:51:10Z ## Languages - Less - Vue ## Topics - material - muse-ui - vue - vue2 - vuejs2 ## Top Contributors - myronliu347 (828 contributions) - tvChan (41 contributions) - linxiaowu66 (24 contributions) - luozhihua (13 contributions) - n1ru4l (13 contributions) - ShanaMaid (11 contributions) - fourcels (9 contributions) - shayneo (7 contributions) - IWANABETHATGUY (5 contributions) - shimarulin (5 contributions) --- ## README Muse-UI [不再维护] Material Design UI library for Vuejs 2.0 ## Installation Muse-UI is available as an npm package ```bash npm install muse-ui -S yarn add muse-ui ``` ## Usage ```javascript import Vue from &`#39`;vue&`#39`; import MuseUI from &`#39`;muse-ui&`#39`; import &`#39`;muse-ui/dist/muse-ui.css&`#39`; Vue.use(MuseUI) ``` For more information, please refer to Usage in our documentation. ## Browser Support Modern browsers and Internet Explorer 10+. ## Contributing Please make sure to read the contributing guide (中文 | English) before making a pull request. ## Changelog Detailed changes for each release are documented in the release notes. ## Licence muse-ui is open source and released under the MIT Licence. Copyright (c) 2016 myron

Citations:


🌐 Web query:

site:github.com/musescore/MuseScore "ContextMenuLoader.qml" "isMenuOpened"

💡 Result:

<search_synthesis>
In the context of the MuseScore codebase, ContextMenuLoader.qml is a specialized QML component used for managing and displaying context menus. While standard Qt Quick Controls or internal implementations may use different property names, the codebases referencing ContextMenuLoader.qml often utilize an isMenuOpened property to track or react to the visibility state of the menu [1]. For example, in ViewModeControl.qml, the component&#39;s appearance is dynamically updated based on the state of the menu [1]: transparent:!menu.isMenuOpened accentButton: menu.isMenuOpened This property allows UI elements to adjust their styling (such as transparency or accent colors) to reflect whether the associated context menu is currently active [1]. Developers typically integrate this component by defining it with an id and then accessing its properties (like isMenuOpened) or calling its methods (like show) to trigger menu display [1][2]. If you are encountering issues where a menu fails to open or is not displaying correctly, it is often due to the loader not being properly placed or its parent/anchor item not being correctly defined [3].
</search_synthesis>

<source_evidence>

<title>src/notationscene/qml/MuseScore/NotationScene/ViewModeControl.qml</title> https://github.com/musescore/MuseScore/blob/main/src/notationscene/qml/MuseScore/NotationScene/ViewModeControl.qml # src/notationscene/qml/MuseScore/NotationScene/ViewModeControl.qml - Branch: main - Repository: musescore/MuseScore --- /* * SPDX-License-Identifier: GPL-3.0-only * MuseScore-Studio-CLA-applies * * MuseScore Studio * Music Composition & Notation * * Copyright (C) 2021 MuseScore Limited and others * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see. */ import QtQuick import QtQuick.Window import Muse.Ui import Muse.UiComponents FlatButton { id: root property var currentViewMode property var availableViewModeList: [] signal changeCurrentViewModeRequested(var newViewMode) transparent: !menu.isMenuOpened accentButton: menu.isMenuOpened buttonType: FlatButton.Horizontal isNarrow: true margins: 6 visible: Boolean(root.currentViewMode) text: Boolean(root.currentViewMode) ? root.currentViewMode.title : "" icon: Boolean(root.currentViewMode) ? root.currentViewMode.icon : IconCode.NONE orientation: Qt.Horizontal contentItem: Row { spacing: 4 StyledIconLabel { iconCode: root.icon font: ui.theme.toolbarIconsFont } StyledTextLabel { anchors.verticalCenter: parent.verticalCenter text: root.text } StyledIconLabel { anchors.verticalCenter: parent.verticalCenter iconCode: IconCode.SMALL_ARROW_DOWN } } onClicked: { menu.toggleOpened(root.availableViewModeList) } StyledMenuLoader { id: menu menuAnchorItem: root.Window.window ? root.Window.window.contentItem : null onHandleMenuItem: function(itemId) { Qt.callLater(root.changeCurrentViewModeRequested, itemId) } } } <title>src/notationscene/qml/MuseScore/NotationScene/percussionpanel/PercussionPanelPadContent.qml</title> https://github.com/musescore/MuseScore/blob/main/src/notationscene/qml/MuseScore/NotationScene/percussionpanel/PercussionPanelPadContent.qml # src/notationscene/qml/MuseScore/NotationScene/percussionpanel/PercussionPanelPadContent.qml - Branch: main - Repository: musescore/MuseScore --- /* * SPDX-License-Identifier: GPL-3.0-only * MuseScore-Studio-CLA-applies * * MuseScore Studio * Music Composition & Notation * * Copyright (C) 2024 MuseScore Limited and others * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see. */ import QtQuick import Muse.Ui import Muse.UiComponents import MuseScore.NotationScene Column { id: root property var padModel: null property int panelMode: -1 property bool useNotationPreview: false property alias notationPreviewNumStaffLines: notationPreview.numStaffLines property color notationPreviewBackgroundColor: "transparent" property alias footerHeight: footerArea.height property bool padSwapActive: false property real cornerRadius: 0 function openContextMenu(pos) { if (!root.padModel) { return } if (!pos) { pos = menuLoader.parent.mapFromItem(root, 0, root.height) } menuLoader.show(pos, root.padModel.contextMenuItems) } QtObject { id: prv readonly property var currentColor: root.useNotationPreview ? root.notationPreviewBackgroundColor : ui.theme.accentColor readonly property var currentOpacityNormal: root.useNotationPreview ? 0.9 : ui.theme.buttonOpacityNormal readonly property var currentOpacityHover: root.useNotationPreview ? 0.7 : ui.theme.buttonOpacityHover readonly property var currentOpacityHit: root.useNotationPreview ? 1.0 : ui.theme.buttonOpacityHit } Item { id: mainContentArea width: parent.width height: parent.height - separator.height - footerArea.height MouseArea { id: mouseArea anchors.fill: parent enabled: mainContentArea.enabled hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton onPressed: function(event) { ui.tooltip.hide(root) if (!Boolean(root.padModel)) { return } if (event.button === Qt.RightButton) { let pos = menuLoader.parent.mapFromItem(mouseArea, event.x, event.y) root.openContextMenu(pos) return } root.padModel.triggerPad(event.modifiers) } onContainsMouseChanged: { if (!Boolean(root.padModel)) { ui.tooltip.hide(root) return } if (mouseArea.containsMouse && root.useNotationPreview) { ui.tooltip.show(root, root.padModel.padName) } else { ui.tooltip.hide(root) } } } RoundedRectangle { id: padBackground color: Utils.colorWithAlpha(prv.currentColor, prv.currentOpacityNormal) anchors.fill: parent topLeftRadius: root.cornerRadius topRightRadius: root.cornerRadius } StyledTextLabel { id: padNameLabel visible: !root.useNotationPreview anchors.centerIn: parent width: parent.width - 12 wrapMode: Text.WordWrap maximumLineCount: 4 font: ui.theme.bodyBoldFont text: Boolean(root.padModel) ? root.padModel.padName : "" } PaintedEngravingItem { id: notationPreview visible: root.useNotationPreview anchors.fill: parent engravingItem: Boolean(root.padModel) ? root.padModel.notationPreviewItem : null spatium: 6.25 // Value approximated visually (needs to accommodate "extreme ledger line" situations) opacity: 0.9 } states: [ State { name: "MOUSE_HOVERED" when: mouseArea.containsMouse && !mouseArea.pressed && !root.padSwapActive PropertyChanges { target: padBackground color: Utils.colorWithAlpha(prv.currentColor, prv.currentOpacityHover) } }, State { name: "MOUSE_HIT" when: mouseArea.pressed || root.padSwapActive PropertyChanges { target: padBackground color: Utils.colorWithAlpha(prv.currentColor, prv.currentOpacityHit) } } ] } Rectangle { id: separator width:…[truncated] <title>Can&`#39`;t open sound menu in Mixer</title> GitHub issue 29412 in musescore/MuseScore (link omitted to avoid creating a cross-reference) # Can&`#39`;t open sound menu in Mixer - State: closed - Author: block36underscore - Created: 2025-08-22T02:35:58Z - Updated: 2025-08-22T02:37:46Z - Repository: musescore/MuseScore - Number: `#29412` ## Labels - UI - regression MS4 --- ### Issue type UI bug (incorrect info or interface appearance) ### Description with steps to reproduce 1. Open Mixer 2. Click on dropdown menu for the Sound section 3. Nothing shows up ### Supporting files, videos and screenshots Clicking here does nothing (static image provided as a video would look exactly the same) ### What is the latest version of MuseScore Studio where this issue is present? 4.6.0.252301442 ### Regression Yes, this used to work in a previous version of MuseScore 4.x ### Operating system Linux ### Additional context This was run on Arch linux on wayland using the appimage provided in the github releases for the 4.6 alpha. When clicking this button, the console prints these messages: ``` 22:18:39.389 | ERROR | main_thread | GuiApp::perform | error: qrc:/qml/Muse/UiComponents/StyledMenuLoader.qml:28:1: QML StyledMenuLoader: Created graphical object was not placed in the graphics scene. 22:18:39.389 | WARN | main_thread | Qt | qrc:/qml/Muse/UiComponents/StyledMenuLoader.qml:28:1: QML StyledMenuLoader: Created graphical object was not placed in the graphics scene. ``` ### Checklist - [x] This report follows the guidelines for reporting bugs and issues - [x] I have verified that this issue has not been logged before, by searching the issue tracker for similar issues - [x] I have attached all requested files and information to this report - [x] I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible ## Timeline - block36underscore issue_type_added - muse-bot added label "regression MS4" - muse-bot added label "UI" **cbjeukendrup** commented on 2025-08-22T02:37:46Z: > This has been reported earlier as https://github.com/musescore/MuseScore/issues/28775 - cbjeukendrup closed - devurandom subscribed <title>c4ea712 Versionless imports</title> https://github.com/musescore/MuseScore/commit/c4ea712bd6c576b47f3600908555751b1dc19f4a | src/framework/uicomponents/qml/Muse/UiComponents/ContextMenuLoader.qml | modified | 1 | 1 | ... | src/framework/uicomponents/qml/Muse/UiComponents/ExpandableBlankSection.qml | modified | 1 | 1 | | src/framework/uicomponents/qml/Muse/UiComponents/FilePicker.qml | modified | 3 | 3 | <title>Fix `#29471`: Context menus in undocked panels</title> GitHub pull request 29512 in musescore/MuseScore (link omitted to avoid creating a cross-reference) # Fix `#29471`: Context menus in undocked panels - State: merged - Author: mathesoncalum - Created: 2025-08-26T21:05:43Z - Updated: 2025-12-15T12:20:28Z - Repository: musescore/MuseScore - Number: `#29512` - +12 -2 in 1 files - Merged: 2025-08-27T16:11:25Z - Merge commit: 57ad425acfbf3e3a844be8a35800a36ab893c6cf - Assignees: zacjansheski --- Resolves: `#29471` Addresses an oversight from `#29249` - we cant bind `contextMenuModel` like this. The approach used in this solution is largely the same as the one used for toolbar components in DockTabBar.qml. ## Timeline - someone committed - Review requested from cbjeukendrup **cbjeukendrup** commented on 2025-08-26T21:37:32Z: > Ah yeah... sad that this is necessary. But it is. > > Or maybe something like `tabBar.currentItem?.model?.contextMenuModel` works as a binding? **mathesoncalum** commented on 2025-08-26T23:00:06Z: > Hmm, quickly checked and couldn&`#39`;t quite get it to work as a one-liner... Either way, I&`#39`;m not so keen on the idea of `titleBar` referencing parts of `tabBar` since they serve different purposes. - Review by cbjeukendrup: - zacjansheski was assigned **zacjansheski** commented on 2025-08-27T12:47:27Z: > Double clicking on 3-dot undocks the panel and options fall behind the panel > > https://github.com/user-attachments/assets/5f3862cb-515e-42a0-b6c8-3fcbe6d9a285 > **zacjansheski** commented on 2025-08-27T16:08:17Z: > Tested on MacOS 15, Windows 11, Ubuntu 22.04.3. Approved > https://github.com/musescore/MuseScore/issues/29471 FIXED - Referenced by issue `#29537`: Double clicking on 3-dot undocks the panel and options fall behind the panel - RomanPudashkin merged - RomanPudashkin closed - Referenced by PR `#29538`: Porting more PRs to 4.6.0 - mathesoncalum head_ref_deleted

Citations:


🏁 Script executed:

set -eu
base='https://raw.githubusercontent.com/musescore/MuseScore/main/src/framework/uicomponents/qml/Muse/UiComponents'
for f in ContextMenuLoader.qml StyledMenuLoader.qml MenuButton.qml; do
  printf '\n--- %s ---\n' "$f"
  curl -fsSL "$base/$f" | sed -n '1,240p'
done

Repository: audacity/audacity

Length of output: 387


🏁 Script executed:

set -eu
printf '%s\n' '--- upstream filenames ---'
curl -fsSL 'https://api.github.com/repos/musescore/MuseScore/git/trees/main?recursive=1' |
  jq -r '.tree[]?.path' |
  rg '(^|/)(ContextMenuLoader|StyledMenuLoader|MenuButton)\.(qml|h|cpp)$|uicomponents.*(menu|button)' |
  head -120
printf '%s\n' '--- Audacity dependency references ---'
git grep -n -i -E 'musescore|muse.*framework|framework.*revision|MUSE_.*VERSION|MUSE_.*COMMIT' -- \
  'CMakeLists.txt' '*.cmake' '.gitmodules' 'buildscripts/**' 'cmake/**' 2>/dev/null | head -220

Repository: audacity/audacity

Length of output: 7985


🏁 Script executed:

set -eu
printf '%s\n' '--- dependency submodule metadata ---'
cat .gitmodules
printf '%s\n' '--- muse_framework filenames ---'
curl -fsSL 'https://api.github.com/repos/musescore/muse_framework/git/trees/master?recursive=1' |
  jq -r '.tree[]?.path' |
  rg '(^|/)(ContextMenuLoader|StyledMenuLoader|MenuButton)\.(qml|h|cpp)$|uicomponents.*(menu|button)' |
  head -160

Repository: audacity/audacity

Length of output: 454


🏁 Script executed:

set -eu
branch=$(curl -fsSL https://api.github.com/repos/musescore/muse_framework | jq -r '.default_branch')
printf 'default branch: %s\n' "$branch"
curl -fsSL "https://api.github.com/repos/musescore/muse_framework/git/trees/$branch?recursive=1" |
  jq -r '.tree[]?.path' |
  rg -i '(^|/)(ContextMenuLoader|StyledMenuLoader|MenuButton)\.(qml|h|cpp)$|uicomponents.*(menu|button)' |
  head -160

Repository: audacity/audacity

Length of output: 2110


🏁 Script executed:

set -eu
base='https://raw.githubusercontent.com/musescore/muse_framework/main/framework/uicomponents/qml/Muse/UiComponents'
for f in ContextMenuLoader.qml StyledMenuLoader.qml MenuButton.qml; do
  printf '\n--- %s ---\n' "$f"
  curl -fsSL "$base/$f" | sed -n '1,260p'
done

Repository: audacity/audacity

Length of output: 8071


🏁 Script executed:

set -eu
sha=$(git ls-tree HEAD muse | awk '{print $3}')
printf 'muse gitlink: %s\n' "$sha"
base="https://raw.githubusercontent.com/musescore/muse_framework/$sha/framework/uicomponents/qml/Muse/UiComponents"
for f in ContextMenuLoader.qml MenuButton.qml; do
  printf '\n--- %s at %s ---\n' "$f" "$sha"
  curl -fsSL "$base/$f" | rg -n 'property alias isMenuOpened|function show|function open|StyledMenuLoader|signal opened|signal closed|onOpened|onClosed' || true
done

Repository: audacity/audacity

Length of output: 604


Keep collapsed clip headers visible while a context menu is open.

ContextMenuLoader.show() opens its own internal StyledMenuLoader. menuBtn.isMenuOpened tracks a separate loader owned by MenuButton. Right-click paths do not update that state. Therefore, the binding can hide a collapsed header after root.hover clears while its context menu remains open. Track the opened and closed signals from both context loaders in shared state, then include that state in this binding.

@grliszas14
grliszas14 force-pushed the clip_menu branch 3 times, most recently from e2a8166 to e41e543 Compare October 12, 2026 12:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f084dab-c0f6-45e8-9be9-c352b6aecc0e
📥 Commits

Reviewing files that changed from the base of the PR and between e2a8166 and e41e543.

📒 Files selected for processing (1)
  • src/projectscene/qml/Audacity/ProjectScene/tracksitemsview/ClipHandles.qml

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


containmentMask: QtObject {
function contains(point: point): bool {
return point.x >= 0 && point.y >= 0 && point.x < rightTrimMa.width && point.y < rightTrimMa.height && !root.isExcluded(rightTrimMa, point)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 5 '\benableCursorInteraction\b|\bhandlesVisible\b|\bexclusionItem\b|\bcollapsed\b|menuBtn\.mouseArea\.visible' \
  src/projectscene/qml/Audacity/ProjectScene/tracksitemsview/ClipItem.qml

Repository: audacity/audacity

Length of output: 7656


🏁 Script executed:

set -euo pipefail
printf '%s\n' '--- ClipItem.qml: header/menu/handles ---'
nl -ba src/projectscene/qml/Audacity/ProjectScene/tracksitemsview/ClipItem.qml | sed -n '560,850p;1145,1180p'
printf '%s\n' '--- ClipHandles.qml: properties and mouse areas ---'
nl -ba src/projectscene/qml/Audacity/ProjectScene/tracksitemsview/ClipHandles.qml | sed -n '1,80p;250,360p'

Repository: audacity/audacity

Length of output: 21632


🏁 Script executed:

set -euo pipefail
printf '%s\n' '--- right trim handle block ---'
nl -ba src/projectscene/qml/Audacity/ProjectScene/tracksitemsview/ClipHandles.qml | sed -n '170,370p'
printf '%s\n' '--- enableCursorInteraction inputs ---'
rg -n -C 4 '\b(selectionInProgress|selectionEditInProgress|verticalSelectionEditInProgress|isBrush)\b' src/projectscene/qml/Audacity/ProjectScene/tracksitemsview src/projectscene/qml/Audacity/ProjectScene

Repository: audacity/audacity

Length of output: 41696


Tie the exclusion to menu interactivity.

A collapsed, selected clip can keep its trim handles and visible menu button while enableCursorInteraction is false. The exclusion currently checks only menuBtn.visible, but menuBtn.mouseArea.visible is false in that state. The right-trim mask can then reject the overlapping button area even though the menu cannot receive the press.

Suggested fix
-        exclusionItem: root.collapsed ? menuBtn : null
+        exclusionItem: root.collapsed && menuBtn.mouseArea.visible ? menuBtn : null

@grliszas14
grliszas14 merged commit 3c265f2 into audacity:master Oct 20, 2026
3 of 10 checks passed
@grliszas14
grliszas14 deleted the clip_menu branch October 20, 2026 10:05
kryksyh added a commit that referenced this pull request Oct 27, 2026
Fix context menu on collapsed clips
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.

Can't open context menu for collapsed clip

2 participants