Skip to content

Re-design PropertiesPanelTabButtons to hug contents instead of having equal widths#33765

Open
ajuncosa wants to merge 1 commit into
musescore:mainfrom
ajuncosa:truncated-text
Open

Re-design PropertiesPanelTabButtons to hug contents instead of having equal widths#33765
ajuncosa wants to merge 1 commit into
musescore:mainfrom
ajuncosa:truncated-text

Conversation

@ajuncosa

@ajuncosa ajuncosa commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Resolves: #32604

Related to muse_framework: musescore/muse_framework#82 (Add tooltips to StyledTabButton)

Instead of evenly dividing the available tab bar width amongst the tab buttons, the buttons' width now fits their content (up to a maximum).

If the sum of the widths of all buttons surpasses the available tab bar width, then we identify some buttons to truncate by looking for buttons which surpass a threshold (this process may take multiple iterations).

Then, the widths of the buttons which are not to be truncated, simply fit their contents. The remaining tab bar width which is not occupied by "fitted" items is equally distributed amongst the "too wide" items, and their text is truncated accordingly.

Captura de pantalla 2026-06-10 a las 13 15 57 Captura de pantalla 2026-06-10 a las 18 34 05 Grabación de pantalla 2026-06-10 a las 12 59 56

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d60f9d99-2f79-4e4d-9747-ff44fb89c4a3

📥 Commits

Reviewing files that changed from the base of the PR and between 5533654 and ab0a3ae.

📒 Files selected for processing (3)
  • muse
  • src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml
  • src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml

📝 Walkthrough

Walkthrough

This PR advances the muse submodule to a new commit and updates the properties panel tab UI: PropertiesPanelTabBar now computes a readonly truncatedItemWidth via computeTruncatedItemWidth(), and PropertiesPanelTabButton stops using fillWidth and instead limits its width to Math.min(implicitWidth, tabBar.truncatedItemWidth) when a tabBar is present.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes issue resolution, explains the approach with visual examples, but lacks completion of the required checklist items from the template. Complete the description template checklist by checking the required boxes and confirming CLA signature, coding standards compliance, testing verification, and no unnecessary changes.
Out of Scope Changes check ❓ Inconclusive The PR includes a muse submodule update beyond the scope of the stated objectives. This should be clarified or separated into a distinct commit. Clarify the purpose of the muse submodule update or separate it into a distinct commit with its own explanation if it's a required dependency.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main design change: tab buttons now adjust to content width instead of equal widths.
Linked Issues check ✅ Passed The PR addresses the truncated text issue (#32604) by implementing a smart truncation algorithm that fits button content when possible and distributes remaining space.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped musescore/muse_framework.git.


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 and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@muse`:
- Line 1: Update the PR description to clarify the submodule bump: explicitly
state that the change in muse/muse_framework (commit 65edd4a8... -> 6eadd9e0...)
only adds tooltips in StyledTabButton.qml and explain whether this tooltip
addition is part of the truncated-text/tab button fix for issue `#32604`; if it is
not related, split the tooltip change into its own PR referencing
StyledTabButton.qml and the specific commit so reviewers can review it
independently.

In
`@src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml`:
- Around line 35-37: The overflow check in the calculation of
tabBarContentImplicitWidth omits the spacing between tabs, so update the reduce
logic that computes tabBarContentImplicitWidth (or compute a new total) to add
the total spacing: include tabBar.spacing * Math.max(0,
tabBar.contentChildren.length - 1) when comparing against tabBar.width; ensure
you reference tabBar.contentChildren.reduce (or the tabBarContentImplicitWidth
variable) and use tabBar.spacing and tabBar.contentChildren.length so truncation
correctly triggers when widths plus spacing exceed tabBar.width.
- Around line 35-50: PropertiesPanelTabButton.qml currently uses
tabBar.contentChildren and tabBar.count (variables tabBarContentImplicitWidth,
widthLimitForTruncation, huggedItems) which include hidden buttons; change the
math to only consider visible buttons by filtering tabBar.contentChildren with
button.visible to compute visibleChildren, visibleCount,
visibleContentImplicitWidth and visible huggedItems, then replace uses of
tabBar.count, total sums and spacing with these visible-aware values so
truncation and width distribution ignore hidden tabs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 38e02acd-78cb-48e5-91a2-d2af07b2fa5b

📥 Commits

Reviewing files that changed from the base of the PR and between b6fd466 and 5533654.

📒 Files selected for processing (2)
  • muse
  • src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml

Comment thread muse Outdated
@ajuncosa ajuncosa marked this pull request as draft June 10, 2026 13:05
@ajuncosa ajuncosa force-pushed the truncated-text branch 2 times, most recently from 1abb41e to 0a3db75 Compare June 11, 2026 08:54
@ajuncosa ajuncosa marked this pull request as ready for review June 11, 2026 13:09
@ajuncosa ajuncosa requested a review from mathesoncalum June 12, 2026 06:04
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.

Truncated text in Properties>Beam in localized version (ES)

1 participant