Palette search cannot find sharp or flat key signatures typed as "F#" or "Bb" - #34395
Palette search cannot find sharp or flat key signatures typed as "F#" or "Bb"#34395macaquedev wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughAdds configurable palette test builds and a new palette search filter. Search supports musical accidental symbols, ASCII shorthand, spelled-out names, regular palette names, and parent palette matching. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped 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: 1
🤖 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 `@CMakeLists.txt`:
- Line 141: Update the UTest configuration block in CMakeLists.txt so enabling
MUE_BUILD_PALETTE_TESTS also forces MUE_BUILD_PALETTE_MODULE on, overriding the
UTest default. Preserve the existing palette-test option behavior and ensure the
real palette target is used so palette_tests is added.
🪄 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 Plus
Run ID: 02cc38aa-77e2-484d-bbb3-5435b469d3fe
📒 Files selected for processing (9)
CMakeLists.txtSetupConfigure.cmakesrc/palette/CMakeLists.txtsrc/palette/internal/palettemodel.cppsrc/palette/internal/palettemodel.hsrc/palette/internal/paletteprovider.cppsrc/palette/internal/paletteprovider.hsrc/palette/tests/CMakeLists.txtsrc/palette/tests/palettesearch_tests.cpp
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Palette item names use the real accidental signs, e.g. "F♯ major /
D♯ minor", but neither ♯ nor ♭ is on a standard keyboard layout.
Search did a plain substring match on those names, so "F#", "F sharp",
"Bb" and "B flat" all returned no results, leaving a bare "F" as the
only way to look for a sharp or flat key signature.
PaletteCellFilterProxyModel now matches an item if the search text
occurs in its name, in its ASCII shorthand ("F# major / D# minor") or
in its spelled out form ("F sharp major / D sharp minor"). The spelled
out names are translatable patterns taking the character the sign
follows, so languages that attach the accidental to the note letter
instead of writing it as a separate word can do so, e.g. "%1is" for
German "Fis".
This applies to every palette item whose name contains an accidental
sign, not just key signatures.
The palette module is no longer disabled in the UTEST configuration,
so that the new palette_tests target is actually built and run.
Resolves: musescore#34394
f72e144 to
3d924ca
Compare
Resolves: #34394
Palette item names contain the real accidental signs —
F♯ major / D♯ minor,B♭ major / G minor— and palette search matched them with a plain substring test against the name. Since neither ♯ nor ♭ is on a standard keyboard layout, none of the ways a user can actually type an accidental found anything:F#,F sharp,BbandB flatall returned no results. The only search that worked was a bareF, which returns every palette item containing that letter.PaletteCellFilterProxyModelnow accepts an item if the search text occurs in any of three spellings of its name:F♯ major / D♯ minorF# major / D# minorF sharp major / D sharp minorTwo points worth flagging for review:
muse::qtrc, so the alternative spellings follow the language the item names are displayed in rather than being hardcoded English. This adds two translatable strings to thepalettecontext,"%1 sharp"and"%1 flat", each with a disambiguation explaining that it is a search alternative for an accidental sign.%1is the character the sign follows, so languages that attach the accidental to the note letter instead of writing it as a separate word can translate them as"%1is"/"%1es"and getFis/Ges.Palette search filtering speed has been tuned in the past, so the alternative spellings are only built for names that actually contain an accidental sign. Every other name takes an early return and does the same single substring test as before.
The palette module had no unit tests, so this adds a
palette_teststarget. It covers the three spellings plus the pre-existing behaviour of matching a palette's name to show all of its cells. The expected cell names come fromTConv::translatedUserNamerather than string literals, so the tests keep exercising the real names if those are ever reworded. I confirmed the two new-behaviour tests fail when the change is reverted. The UTest configuration disabled the palette module, which would have left the new target unbuilt, so that line is gone fromSetupConfigure.cmake.