[DockWindow V2] Stabilization. Step 2#151
Conversation
|
Warning Review limit reached
Next review available in: 28 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughIntroduces 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@framework/dockwindow_v2/qml/Muse/Dock/topleveltoolbarslayout.cpp`:
- Around line 90-243: Add targeted unit tests for
TopLevelToolBarsLayout::adjustContentForAvailableSpace and alignToolBars,
covering compacting and expanding transitions, priority ordering, insufficient
or exact available width, and left/center/right alignment combinations including
missing blocks. Use realistic DockBase/DockToolBarView fixtures and assert
resulting compact states and width constraints.
- Around line 90-152: Update the compacting loop in adjustDocks within
adjustContentForAvailableSpace so it rechecks the updated width after each dock
is compacted and stops once width is below spaceWidth. Preserve the existing
priority ordering and eligibility checks, while avoiding compaction of
additional non-compact docks after sufficient space has been freed.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: a8c8c1ae-5749-4a85-bd85-4340ff23c6b2
📒 Files selected for processing (7)
framework/dockwindow_v2/internal/dockbase.cppframework/dockwindow_v2/internal/dockbase.hframework/dockwindow_v2/qml/Muse/Dock/CMakeLists.txtframework/dockwindow_v2/qml/Muse/Dock/dockwindow.cppframework/dockwindow_v2/qml/Muse/Dock/dockwindow.hframework/dockwindow_v2/qml/Muse/Dock/topleveltoolbarslayout.cppframework/dockwindow_v2/qml/Muse/Dock/topleveltoolbarslayout.h
79374e2 to
6bbf3c1
Compare
There was a problem hiding this comment.
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 `@framework/dockwindow_v2/internal/dockbase.cpp`:
- Around line 715-717: Update onIsInMainWindowChanged() so m_floating is
refreshed before invoking applySizeConstraints(). Ensure applySizeConstraints()
evaluates the current floating state, allowing the redocking constraint pass to
run instead of returning based on stale state.
In `@framework/dockwindow_v2/qml/Muse/Dock/topleveltoolbarslayout.cpp`:
- Around line 96-140: Update the adjustDocks lambda to calculate occupied width
using the same inter-toolbar separators included by alignToolBars(), rather than
summing only dock content widths. Change the compacting and expansion boundary
checks so an exact fit is retained or expanded: compact only when occupied width
exceeds spaceWidth, and allow expansion when the resulting width is equal to
spaceWidth.
In `@framework/dockwindow_v2/tests/topleveltoolbarslayout_tests.cpp`:
- Around line 209-225: Update CompactToolBarsThatDoNotFit so the first toolbar’s
compact state reduces its modeled width via an isCompactChanged connection or
equivalent fixture behavior. Adjust the expectations to verify the first toolbar
becomes compact while the second remains expanded when the occupied width
reaches the 700-pixel window limit; keep nonCompactable uncompact.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: c51c0a7e-2730-466f-accd-3511a2f6008f
📒 Files selected for processing (11)
framework/dockwindow_v2/CMakeLists.txtframework/dockwindow_v2/internal/dockbase.cppframework/dockwindow_v2/internal/dockbase.hframework/dockwindow_v2/qml/Muse/Dock/CMakeLists.txtframework/dockwindow_v2/qml/Muse/Dock/dockframemodel.cppframework/dockwindow_v2/qml/Muse/Dock/dockwindow.cppframework/dockwindow_v2/qml/Muse/Dock/dockwindow.hframework/dockwindow_v2/qml/Muse/Dock/topleveltoolbarslayout.cppframework/dockwindow_v2/qml/Muse/Dock/topleveltoolbarslayout.hframework/dockwindow_v2/tests/CMakeLists.txtframework/dockwindow_v2/tests/topleveltoolbarslayout_tests.cpp
Replaced reactive geometryChange handling (pendingWidth, forced sync resize, deferred QTimer fixup) with one idempotent pass in updatePolish(), extracted it into TopLevelToolBarsLayout.
Skip applying floating size constraints while the dock's group is still in the main layout - fixes the top row growing taller on undock.
6bbf3c1 to
ae677c0
Compare
|
/build |
|
Build dispatched: https://github.com/musescore/muse_framework/actions/runs/29336588374 |
|
/build |
|
Build dispatched: https://github.com/musescore/muse_framework/actions/runs/29339705844 |
Resolves: musescore/MuseScore#34146
Resolves: musescore/MuseScore#34147
Resolves: musescore/MuseScore#34145
Previously, the toolbars' alignment was recomputed reactively from geometryChange, which required manual state (m_pendingWidth), a forced synchronous layout resize and a deferred QTimer-based fixup, because KDDockWidgets' QtQuick layer syncs item sizes asynchronously.
Now all triggers (window resize, content size, visibility, floating state) just call polish(), and a single idempotent relayout pass runs from updatePolish() - after the frame's geometry and bindings have settled, but before rendering, so intermediate layout states are never drawn. The pass lives in a new TopLevelToolBarsLayout class: it adjusts compact mode, recomputes the alignment pins, syncs the layouting items' cached minimums and applies the layout size.