smoosic 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/smoosic.js +546 -125
- package/changes.md +85 -0
- package/package.json +23 -2
- package/release/smoosic.js +549 -128
- package/release/styles/menus.css +26 -0
- package/specs/022-text-reposition-on-resize/spec.md +1 -0
- package/specs/027-fix-bottom-modifier-lookup/checklists/requirements.md +38 -0
- package/specs/027-fix-bottom-modifier-lookup/contracts/division-lookup-contract.md +51 -0
- package/specs/027-fix-bottom-modifier-lookup/data-model.md +43 -0
- package/specs/027-fix-bottom-modifier-lookup/plan.md +77 -0
- package/specs/027-fix-bottom-modifier-lookup/quickstart.md +36 -0
- package/specs/027-fix-bottom-modifier-lookup/research.md +58 -0
- package/specs/027-fix-bottom-modifier-lookup/spec.md +105 -0
- package/specs/027-fix-bottom-modifier-lookup/tasks.md +167 -0
- package/specs/028-unsaved-changes-indicator/checklists/requirements.md +39 -0
- package/specs/028-unsaved-changes-indicator/contracts/score-change-contract.md +44 -0
- package/specs/028-unsaved-changes-indicator/data-model.md +64 -0
- package/specs/028-unsaved-changes-indicator/plan.md +96 -0
- package/specs/028-unsaved-changes-indicator/quickstart.md +54 -0
- package/specs/028-unsaved-changes-indicator/research.md +68 -0
- package/specs/028-unsaved-changes-indicator/spec.md +135 -0
- package/specs/028-unsaved-changes-indicator/tasks.md +173 -0
- package/specs/029-remove-promise-helpers/checklists/requirements.md +39 -0
- package/specs/029-remove-promise-helpers/contracts/public-api-contract.md +32 -0
- package/specs/029-remove-promise-helpers/data-model.md +45 -0
- package/specs/029-remove-promise-helpers/plan.md +86 -0
- package/specs/029-remove-promise-helpers/quickstart.md +53 -0
- package/specs/029-remove-promise-helpers/research.md +71 -0
- package/specs/029-remove-promise-helpers/spec.md +107 -0
- package/specs/029-remove-promise-helpers/tasks.md +164 -0
- package/specs/030-copy-paste-voices/checklists/requirements.md +39 -0
- package/specs/030-copy-paste-voices/contracts/voice-copy-paste-contract.md +47 -0
- package/specs/030-copy-paste-voices/data-model.md +63 -0
- package/specs/030-copy-paste-voices/plan.md +80 -0
- package/specs/030-copy-paste-voices/quickstart.md +50 -0
- package/specs/030-copy-paste-voices/research.md +80 -0
- package/specs/030-copy-paste-voices/spec.md +124 -0
- package/specs/030-copy-paste-voices/tasks.md +183 -0
- package/specs/031-select-voice/checklists/requirements.md +39 -0
- package/specs/031-select-voice/contracts/select-voice-contract.md +43 -0
- package/specs/031-select-voice/data-model.md +47 -0
- package/specs/031-select-voice/plan.md +79 -0
- package/specs/031-select-voice/quickstart.md +43 -0
- package/specs/031-select-voice/research.md +55 -0
- package/specs/031-select-voice/spec.md +113 -0
- package/specs/031-select-voice/tasks.md +171 -0
- package/specs/032-split-multimeasure-rests/checklists/requirements.md +40 -0
- package/specs/032-split-multimeasure-rests/contracts/grouping-contract.md +53 -0
- package/specs/032-split-multimeasure-rests/data-model.md +70 -0
- package/specs/032-split-multimeasure-rests/plan.md +81 -0
- package/specs/032-split-multimeasure-rests/quickstart.md +46 -0
- package/specs/032-split-multimeasure-rests/research.md +63 -0
- package/specs/032-split-multimeasure-rests/spec.md +127 -0
- package/specs/032-split-multimeasure-rests/tasks.md +174 -0
- package/specs/033-key-distance-transposition/checklists/requirements.md +35 -0
- package/specs/033-key-distance-transposition/contracts/spelling-api.md +36 -0
- package/specs/033-key-distance-transposition/data-model.md +49 -0
- package/specs/033-key-distance-transposition/plan.md +87 -0
- package/specs/033-key-distance-transposition/quickstart.md +40 -0
- package/specs/033-key-distance-transposition/research.md +82 -0
- package/specs/033-key-distance-transposition/spec.md +132 -0
- package/specs/033-key-distance-transposition/tasks.md +139 -0
- package/specs/034-smz-compressed-scores/checklists/requirements.md +35 -0
- package/specs/034-smz-compressed-scores/contracts/archive-api.md +30 -0
- package/specs/034-smz-compressed-scores/data-model.md +48 -0
- package/specs/034-smz-compressed-scores/plan.md +89 -0
- package/specs/034-smz-compressed-scores/quickstart.md +44 -0
- package/specs/034-smz-compressed-scores/research.md +86 -0
- package/specs/034-smz-compressed-scores/spec.md +137 -0
- package/specs/034-smz-compressed-scores/tasks.md +148 -0
- package/specs/035-paste-special/checklists/requirements.md +35 -0
- package/specs/035-paste-special/contracts/paste-special-api.md +50 -0
- package/specs/035-paste-special/data-model.md +47 -0
- package/specs/035-paste-special/plan.md +83 -0
- package/specs/035-paste-special/quickstart.md +51 -0
- package/specs/035-paste-special/research.md +97 -0
- package/specs/035-paste-special/spec.md +170 -0
- package/specs/035-paste-special/tasks.md +149 -0
- package/specs/036-autosave-recovery/checklists/requirements.md +36 -0
- package/specs/036-autosave-recovery/contracts/autosave-api.md +111 -0
- package/specs/036-autosave-recovery/data-model.md +70 -0
- package/specs/036-autosave-recovery/plan.md +87 -0
- package/specs/036-autosave-recovery/quickstart.md +65 -0
- package/specs/036-autosave-recovery/research.md +105 -0
- package/specs/036-autosave-recovery/spec.md +143 -0
- package/specs/036-autosave-recovery/tasks.md +165 -0
- package/specs/037-fix-new-part-dialog/checklists/requirements.md +38 -0
- package/specs/037-fix-new-part-dialog/contracts/create-part-api.md +84 -0
- package/specs/037-fix-new-part-dialog/data-model.md +68 -0
- package/specs/037-fix-new-part-dialog/plan.md +83 -0
- package/specs/037-fix-new-part-dialog/quickstart.md +58 -0
- package/specs/037-fix-new-part-dialog/research.md +86 -0
- package/specs/037-fix-new-part-dialog/spec.md +144 -0
- package/specs/037-fix-new-part-dialog/tasks.md +174 -0
- package/specs/038-per-measure-beam-groups/checklists/requirements.md +36 -0
- package/specs/038-per-measure-beam-groups/contracts/beam-groups-api.md +74 -0
- package/specs/038-per-measure-beam-groups/data-model.md +75 -0
- package/specs/038-per-measure-beam-groups/plan.md +84 -0
- package/specs/038-per-measure-beam-groups/quickstart.md +53 -0
- package/specs/038-per-measure-beam-groups/research.md +72 -0
- package/specs/038-per-measure-beam-groups/spec.md +146 -0
- package/specs/038-per-measure-beam-groups/tasks.md +132 -0
- package/specs/039-measure-fill-submenu/checklists/requirements.md +35 -0
- package/specs/039-measure-fill-submenu/contracts/measure-fill-api.md +56 -0
- package/specs/039-measure-fill-submenu/data-model.md +79 -0
- package/specs/039-measure-fill-submenu/plan.md +81 -0
- package/specs/039-measure-fill-submenu/quickstart.md +62 -0
- package/specs/039-measure-fill-submenu/research.md +68 -0
- package/specs/039-measure-fill-submenu/spec.md +153 -0
- package/specs/039-measure-fill-submenu/tasks.md +121 -0
- package/specs/040-dynamics-dialog-cleanup/checklists/requirements.md +36 -0
- package/specs/040-dynamics-dialog-cleanup/contracts/dynamics-dialog.md +52 -0
- package/specs/040-dynamics-dialog-cleanup/data-model.md +48 -0
- package/specs/040-dynamics-dialog-cleanup/plan.md +89 -0
- package/specs/040-dynamics-dialog-cleanup/quickstart.md +69 -0
- package/specs/040-dynamics-dialog-cleanup/research.md +80 -0
- package/specs/040-dynamics-dialog-cleanup/spec.md +120 -0
- package/specs/040-dynamics-dialog-cleanup/tasks.md +114 -0
- package/specs/041-delete-special/checklists/requirements.md +35 -0
- package/specs/041-delete-special/contracts/delete-special-api.md +41 -0
- package/specs/041-delete-special/data-model.md +40 -0
- package/specs/041-delete-special/plan.md +93 -0
- package/specs/041-delete-special/quickstart.md +41 -0
- package/specs/041-delete-special/research.md +75 -0
- package/specs/041-delete-special/spec.md +136 -0
- package/specs/041-delete-special/tasks.md +106 -0
- package/src/application/application.ts +475 -459
- package/src/application/exports.ts +401 -395
- package/src/application/generateVexTests.ts +2 -2
- package/src/common/promiseHelpers.ts +2 -2
- package/src/render/audio/samples.ts +117 -118
- package/src/render/sui/NoteEntryCaret.ts +117 -16
- package/src/render/sui/autosave.ts +265 -0
- package/src/render/sui/formatter.ts +12 -2
- package/src/render/sui/pageDivisions.ts +58 -0
- package/src/render/sui/renderState.ts +469 -464
- package/src/render/sui/scoreChangeState.ts +67 -0
- package/src/render/sui/scoreView.ts +77 -2
- package/src/render/sui/scoreViewOperations.ts +363 -37
- package/src/render/sui/staffLineGeometry.ts +82 -0
- package/src/render/sui/svgPageMap.ts +16 -17
- package/src/render/sui/textEdit.ts +310 -311
- package/src/render/sui/tracker.ts +40 -0
- package/src/render/vex/vxMeasure.ts +22 -8
- package/src/render/vex/vxNote.ts +5 -5
- package/src/smo/data/measure.ts +58 -1
- package/src/smo/data/measureModifiers.ts +81 -1
- package/src/smo/data/music.ts +169 -359
- package/src/smo/data/note.ts +1 -1
- package/src/smo/data/noteModifiers.ts +12 -0
- package/src/smo/data/score.ts +167 -2
- package/src/smo/data/scoreModifiers.ts +46 -1
- package/src/smo/data/systemStaff.ts +43 -0
- package/src/smo/xform/beamers.ts +80 -6
- package/src/smo/xform/copypaste.ts +511 -51
- package/src/smo/xform/measureFill.ts +89 -0
- package/src/smo/xform/operations.ts +403 -61
- package/src/smo/xform/selections.ts +75 -0
- package/src/smo/xform/undo.ts +9 -0
- package/src/styles/menus.css +26 -0
- package/src/ui/buttons/ribbon.ts +3 -1
- package/src/ui/components/buttons/sidebar.vue +15 -6
- package/src/ui/components/dialogs/beamGroups.vue +106 -0
- package/src/ui/components/dialogs/deleteSpecial.vue +38 -0
- package/src/ui/components/dialogs/dynamics.vue +16 -3
- package/src/ui/components/dialogs/fileUpload.vue +2 -2
- package/src/ui/components/dialogs/hairpin.vue +3 -3
- package/src/ui/components/dialogs/library.vue +3 -1
- package/src/ui/components/dialogs/newPart.vue +148 -184
- package/src/ui/components/dialogs/pasteSpecial.vue +49 -0
- package/src/ui/components/dialogs/recovery.vue +66 -0
- package/src/ui/components/dialogs/save.vue +11 -4
- package/src/ui/components/dialogs/scorePreferences.vue +23 -1
- package/src/ui/components/dialogs/slur.vue +6 -6
- package/src/ui/components/dialogs/tempo.vue +11 -3
- package/src/ui/components/dialogs/timeSignature.vue +5 -0
- package/src/ui/components/dialogs/unsavedChanges.vue +44 -0
- package/src/ui/components/dialogs/volta.vue +3 -3
- package/src/ui/dialogs/adapter.ts +181 -183
- package/src/ui/dialogs/addMeasure.ts +97 -97
- package/src/ui/dialogs/annotationVue.ts +56 -56
- package/src/ui/dialogs/audioSettings.ts +121 -123
- package/src/ui/dialogs/beamGroupsVue.ts +69 -0
- package/src/ui/dialogs/chordChangeVue.ts +46 -46
- package/src/ui/dialogs/clefChange.ts +53 -53
- package/src/ui/dialogs/createPartHelpers.ts +68 -0
- package/src/ui/dialogs/customTuplets.ts +95 -96
- package/src/ui/dialogs/customTupletsVue.ts +47 -47
- package/src/ui/dialogs/deleteSpecial.ts +57 -0
- package/src/ui/dialogs/dialog.ts +627 -620
- package/src/ui/dialogs/durations.ts +34 -34
- package/src/ui/dialogs/dynamicsVue.ts +87 -60
- package/src/ui/dialogs/factory.ts +196 -198
- package/src/ui/dialogs/fileDialogs.ts +286 -179
- package/src/ui/dialogs/fonts.ts +93 -93
- package/src/ui/dialogs/globalLayout.ts +40 -40
- package/src/ui/dialogs/gracenote.ts +31 -31
- package/src/ui/dialogs/hairpin.ts +108 -110
- package/src/ui/dialogs/hairpinVue.ts +51 -51
- package/src/ui/dialogs/instrument.ts +119 -112
- package/src/ui/dialogs/keySignature.ts +175 -176
- package/src/ui/dialogs/keySignatureVue.ts +47 -47
- package/src/ui/dialogs/library.ts +207 -207
- package/src/ui/dialogs/libraryVue.ts +62 -48
- package/src/ui/dialogs/lyricVue.ts +46 -46
- package/src/ui/dialogs/measureFormat.ts +78 -78
- package/src/ui/dialogs/microtones.ts +147 -147
- package/src/ui/dialogs/noteHead.ts +319 -319
- package/src/ui/dialogs/pageLayout.ts +61 -61
- package/src/ui/dialogs/partInfo.ts +60 -60
- package/src/ui/dialogs/pasteSpecial.ts +59 -0
- package/src/ui/dialogs/pedalMarking.ts +117 -117
- package/src/ui/dialogs/pedalMarkingVue.ts +73 -73
- package/src/ui/dialogs/pitch.ts +352 -352
- package/src/ui/dialogs/preferences.ts +1 -0
- package/src/ui/dialogs/recovery.ts +49 -0
- package/src/ui/dialogs/rehearsalMark.ts +64 -64
- package/src/ui/dialogs/rehearsalMarkVue.ts +57 -57
- package/src/ui/dialogs/scoreId.ts +35 -36
- package/src/ui/dialogs/scoreView.ts +42 -42
- package/src/ui/dialogs/slur.ts +308 -310
- package/src/ui/dialogs/slurVue.ts +91 -91
- package/src/ui/dialogs/staffGroup.ts +112 -112
- package/src/ui/dialogs/tabNote.ts +84 -84
- package/src/ui/dialogs/tabStave.ts +182 -182
- package/src/ui/dialogs/tempo.ts +261 -263
- package/src/ui/dialogs/tempoVue.ts +73 -73
- package/src/ui/dialogs/textBlockVue.ts +127 -127
- package/src/ui/dialogs/textBracket.ts +114 -116
- package/src/ui/dialogs/textBracketVue.ts +56 -56
- package/src/ui/dialogs/tie.ts +140 -142
- package/src/ui/dialogs/timeSignature.ts +65 -66
- package/src/ui/dialogs/transposeScore.ts +39 -39
- package/src/ui/dialogs/unsavedChanges.ts +43 -0
- package/src/ui/dialogs/volta.ts +120 -122
- package/src/ui/dialogs/voltaVue.ts +51 -51
- package/src/ui/fileio/fileInput.ts +12 -3
- package/src/ui/fileio/library.ts +110 -111
- package/src/ui/fileio/scoreArchive.ts +151 -0
- package/src/ui/fileio/xhrLoader.ts +26 -0
- package/src/ui/i18n/language.ts +1 -1
- package/src/ui/menus/beams.ts +181 -112
- package/src/ui/menus/edit.ts +143 -6
- package/src/ui/menus/file.ts +40 -4
- package/src/ui/menus/measure.ts +40 -1
- package/tests/autosave.ts +332 -0
- package/tests/beamDotted.ts +56 -0
- package/tests/beamGroups.ts +338 -0
- package/tests/createPart.ts +292 -0
- package/tests/deleteSpecial.ts +350 -0
- package/tests/dynamicsFontSize.ts +132 -0
- package/tests/keyDistanceTransposition.ts +351 -0
- package/tests/measureFill.ts +295 -0
- package/tests/movePart.ts +94 -0
- package/tests/multimeasureRest.ts +338 -0
- package/tests/pageDivisions.ts +156 -0
- package/tests/pasteIntoMeasure.ts +103 -0
- package/tests/pasteSpecial.ts +541 -0
- package/tests/promiseHelpersUsage.ts +142 -0
- package/tests/quickBeam.ts +126 -0
- package/tests/scoreArchive.ts +218 -0
- package/tests/scoreChangeState.ts +104 -0
- package/tests/selectVoice.ts +189 -0
- package/tests/staffLineGeometry.ts +179 -0
- package/tests/timeSignatureDisplay.ts +58 -0
- package/tests/voiceCopyPaste.ts +417 -0
- package/tools/smoosic-schema.json +37 -0
- package/typedoc.ts +1 -1
- package/types/src/application/exports.d.ts +453 -447
- package/types/src/common/promiseHelpers.d.ts +30 -30
- package/types/src/common/vex.d.ts +224 -224
- package/types/src/render/sui/NoteEntryCaret.d.ts +107 -107
- package/types/src/render/sui/autosave.d.ts +99 -0
- package/types/src/render/sui/scoreView.d.ts +23 -0
- package/types/src/render/sui/scoreViewOperations.d.ts +759 -639
- package/types/src/render/sui/svgHelpers.d.ts +88 -88
- package/types/src/render/sui/svgPageMap.d.ts +344 -344
- package/types/src/render/sui/textEdit.d.ts +96 -96
- package/types/src/render/sui/textRender.d.ts +199 -199
- package/types/src/render/vex/smoAdapter.d.ts +47 -47
- package/types/src/render/vex/vxMeasure.d.ts +97 -97
- package/types/src/render/vex/vxNote.d.ts +56 -56
- package/types/src/render/vex/vxSystem.d.ts +71 -71
- package/types/src/smo/data/measure.d.ts +30 -0
- package/types/src/smo/data/measureModifiers.d.ts +568 -513
- package/types/src/smo/data/music.d.ts +74 -32
- package/types/src/smo/data/note.d.ts +498 -498
- package/types/src/smo/data/noteModifiers.d.ts +615 -606
- package/types/src/smo/data/score.d.ts +476 -421
- package/types/src/smo/data/scoreModifiers.d.ts +30 -0
- package/types/src/smo/data/scoreText.d.ts +334 -334
- package/types/src/smo/data/systemStaff.d.ts +14 -0
- package/types/src/smo/xform/beamers.d.ts +23 -1
- package/types/src/smo/xform/copypaste.d.ts +138 -2
- package/types/src/smo/xform/measureFill.d.ts +21 -0
- package/types/src/smo/xform/operations.d.ts +245 -129
- package/types/src/smo/xform/selections.d.ts +154 -154
- package/types/src/smo/xform/undo.d.ts +142 -142
- package/types/src/ui/buttons/button.d.ts +100 -100
- package/types/src/ui/buttons/ribbon.d.ts +70 -70
- package/types/src/ui/common.d.ts +76 -76
- package/types/src/ui/components/dialogs/chordText.d.ts +28 -28
- package/types/src/ui/components/dialogs/textBlockAtomNode.d.ts +20 -20
- package/types/src/ui/components/dialogs/textGroupHtml.d.ts +29 -29
- package/types/src/ui/composable/draggable.d.ts +15 -15
- package/types/src/ui/dialogs/adapter.d.ts +120 -120
- package/types/src/ui/dialogs/annotationVue.d.ts +9 -9
- package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
- package/types/src/ui/dialogs/beamGroupsVue.d.ts +20 -0
- package/types/src/ui/dialogs/chordChangeVue.d.ts +8 -8
- package/types/src/ui/dialogs/createPartHelpers.d.ts +29 -0
- package/types/src/ui/dialogs/customTupletsVue.d.ts +9 -9
- package/types/src/ui/dialogs/deleteSpecial.d.ts +8 -0
- package/types/src/ui/dialogs/dialog.d.ts +203 -203
- package/types/src/ui/dialogs/dynamicsVue.d.ts +10 -10
- package/types/src/ui/dialogs/factory.d.ts +15 -15
- package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
- package/types/src/ui/dialogs/hairpin.d.ts +35 -35
- package/types/src/ui/dialogs/hairpinVue.d.ts +7 -7
- package/types/src/ui/dialogs/instrument.d.ts +3 -3
- package/types/src/ui/dialogs/keySignatureVue.d.ts +7 -7
- package/types/src/ui/dialogs/libraryVue.d.ts +15 -15
- package/types/src/ui/dialogs/lyricVue.d.ts +8 -8
- package/types/src/ui/dialogs/pasteSpecial.d.ts +8 -0
- package/types/src/ui/dialogs/pedalMarkingVue.d.ts +7 -7
- package/types/src/ui/dialogs/recovery.d.ts +8 -0
- package/types/src/ui/dialogs/rehearsalMark.d.ts +25 -25
- package/types/src/ui/dialogs/rehearsalMarkVue.d.ts +7 -7
- package/types/src/ui/dialogs/slur.d.ts +57 -57
- package/types/src/ui/dialogs/slurVue.d.ts +7 -7
- package/types/src/ui/dialogs/tempo.d.ts +50 -50
- package/types/src/ui/dialogs/tempoVue.d.ts +10 -10
- package/types/src/ui/dialogs/textBlockVue.d.ts +8 -8
- package/types/src/ui/dialogs/textBracket.d.ts +35 -35
- package/types/src/ui/dialogs/textBracketVue.d.ts +7 -7
- package/types/src/ui/dialogs/tie.d.ts +41 -41
- package/types/src/ui/dialogs/volta.d.ts +40 -40
- package/types/src/ui/dialogs/voltaVue.d.ts +7 -7
- package/types/src/ui/fileio/fileInput.d.ts +7 -1
- package/types/src/ui/fileio/library.d.ts +40 -40
- package/types/src/ui/fileio/scoreArchive.d.ts +55 -0
- package/types/src/ui/fileio/xhrLoader.d.ts +7 -0
- package/types/src/ui/menus/file.d.ts +8 -8
- package/types/src/ui/menus/language.d.ts +7 -7
- package/types/src/ui/menus/manager.d.ts +58 -58
- package/types/src/ui/menus/menu.d.ts +159 -159
- package/types/src/ui/menus/partSelection.d.ts +14 -14
- package/types/src/ui/menus/score.d.ts +8 -8
- package/types/src/ui/menus/staffModifier.d.ts +17 -17
- package/types/typedoc.d.ts +147 -147
- package/src/ui/dialogs/dynamics.ts +0 -143
- package/types/src/ui/dialogs/dynamics.d.ts +0 -37
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Data Model: Dynamics Dialog Cleanup and Font Size
|
|
2
|
+
|
|
3
|
+
No new persisted data, and no change to the file format.
|
|
4
|
+
|
|
5
|
+
## SmoDynamicText (existing, one addition)
|
|
6
|
+
|
|
7
|
+
| Field | Type | Default | Saved | Notes |
|
|
8
|
+
|-------|------|---------|-------|-------|
|
|
9
|
+
| `text` | string | `'mp'` | when not default | `pp p mp mf f ff sfz` |
|
|
10
|
+
| `yOffsetLine` | number | 11 | when not default | vertical position, in staff lines |
|
|
11
|
+
| `yOffsetPixels` | number | 0 | when not default | fine vertical offset |
|
|
12
|
+
| `xOffset` | number | 0 | when not default | horizontal offset |
|
|
13
|
+
| `fontSize` | number | 30 (`defaultNoteScale`) | when not default | **now editable in the dialog**; used by the renderer |
|
|
14
|
+
|
|
15
|
+
New static members (not persisted):
|
|
16
|
+
|
|
17
|
+
| Member | Value / behaviour |
|
|
18
|
+
|--------|-------------------|
|
|
19
|
+
| `SmoDynamicText.minFontSize` | 1 |
|
|
20
|
+
| `SmoDynamicText.maxFontSize` | 99 |
|
|
21
|
+
| `SmoDynamicText.isValidFontSize(value: number): boolean` | true if `value` is a whole number from `minFontSize` to `maxFontSize` inclusive; false for non-integers, `NaN`, infinities, and anything outside the range |
|
|
22
|
+
|
|
23
|
+
Saving and loading are unchanged: `serialize()` omits `fontSize` when it is 30, and the constructor starts from the defaults, so a note saved by an older version (no `fontSize`) loads with 30.
|
|
24
|
+
|
|
25
|
+
## Dialog state (local variables in `SuiDynamicModifierDialogVue`, not stored)
|
|
26
|
+
|
|
27
|
+
| Variable | Meaning |
|
|
28
|
+
|----------|---------|
|
|
29
|
+
| `modifier` | the `SmoDynamicText` being edited: `parameters.modifier`, already attached to the first selected note |
|
|
30
|
+
| `selections` | the notes the edits apply to: the selections of `tracker.modifierSelections` if a marking itself is selected on the score, otherwise `tracker.selections` |
|
|
31
|
+
|
|
32
|
+
## Edit flow (each change)
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
number field or dropdown changes
|
|
36
|
+
-> (fontSize only) ignore the value if SmoDynamicText.isValidFontSize(value) is false
|
|
37
|
+
-> set the field on `modifier`
|
|
38
|
+
-> for each selection: view.addDynamic(selection, modifier) // replaces the marking on that note, queues a redraw
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Session flow:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
open: view.groupUndo(true); view.undoTrackerMeasureSelections('Dynamics'); choose `selections`
|
|
45
|
+
OK: nothing to do (InstallDialog ends the undo group)
|
|
46
|
+
Cancel: view.undo()
|
|
47
|
+
Remove: view.removeDynamic(modifier) // removes it from every selected note
|
|
48
|
+
```
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Implementation Plan: Dynamics Dialog Cleanup and Font Size
|
|
2
|
+
|
|
3
|
+
**Branch**: `040-dynamics-dialog-cleanup` (work is on `main`; no feature branch was created) | **Date**: 2026-11-15 | **Spec**: [spec.md](spec.md)
|
|
4
|
+
|
|
5
|
+
**Input**: Feature specification from `/specs/040-dynamics-dialog-cleanup/spec.md`
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
Rewrite `SuiDynamicModifierDialogVue` in `src/ui/dialogs/dynamicsVue.ts` so it holds its own state in local variables and does its work in local functions, with no `SuiDynamicDialogAdapter`. Add a **Font Size** number field to the Vue component. Then delete `src/ui/dialogs/dynamics.ts` (the legacy dialog and its adapter) and everything that referred to it.
|
|
10
|
+
|
|
11
|
+
The model already has the font size: `SmoDynamicText.fontSize` (default 30) is saved, loaded and used by the renderer. The only model addition is the allowed range, as static members on `SmoDynamicText`, so the rule can be tested without the UI and shared with the dialog.
|
|
12
|
+
|
|
13
|
+
The legacy behaviour is copied rather than redesigned: one grouped undo session, an undo snapshot of the selected measures when the dialog opens, edits applied through `view.addDynamic` for every selected note, Cancel is one `view.undo()`, Remove is `view.removeDynamic`.
|
|
14
|
+
|
|
15
|
+
## Technical Context
|
|
16
|
+
|
|
17
|
+
**Language/Version**: TypeScript; Vue 3 single-file component for the dialog. Tests run with `ts-node`.
|
|
18
|
+
|
|
19
|
+
**Primary Dependencies**: None new. Reuses `InstallDialog`, `getModifierDialogPosition`, `numberInput.vue`, `selectComp`, `SuiScoreViewOperations.addDynamic/removeDynamic/undo/undoTrackerMeasureSelections/groupUndo`.
|
|
20
|
+
|
|
21
|
+
**Storage**: No change to the file format. `fontSize` is already one of `SmoDynamicText`'s persisted fields and is written only when it differs from the default (30). Old scores have no `fontSize` and load with 30, exactly as now.
|
|
22
|
+
|
|
23
|
+
**Testing**: Headless `ts-node` script `tests/dynamicsFontSize.ts` (npm script `test:dynamics-font-size`) for the model: the range rule, default, serialization round trip, old-score load, and applying a size through `SmoOperation.addDynamic`. A `.vue` file cannot be loaded by `ts-node`, so the dialog's wiring is checked by compilation (`tsc`), compiling the component with Vue's SFC compiler, a search that proves the legacy code is gone, and the manual steps in [quickstart.md](quickstart.md). The constitution says rendering and UI need not be tested.
|
|
24
|
+
|
|
25
|
+
**Target Platform**: Browser application and library.
|
|
26
|
+
|
|
27
|
+
**Project Type**: Single project.
|
|
28
|
+
|
|
29
|
+
**Performance Goals**: No change. Each edit calls `view.addDynamic` once per selected note; the renderer's replace queue merges those by staff and measure, so each measure is redrawn once per pass.
|
|
30
|
+
|
|
31
|
+
**Constraints**: Every existing control and behaviour of the dialog keeps working (spec FR-005). The dialog's registered name `SuiDynamicModifierDialog` is kept for the factory and the language list. The smo layer must not import UI code.
|
|
32
|
+
|
|
33
|
+
**Scale/Scope**: One dialog function rewritten, one Vue component edited, two small static members added to `SmoDynamicText`, one file deleted, a few references removed, one test file.
|
|
34
|
+
|
|
35
|
+
## Constitution Check
|
|
36
|
+
|
|
37
|
+
*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
|
|
38
|
+
|
|
39
|
+
| Principle | Assessment |
|
|
40
|
+
|-----------|------------|
|
|
41
|
+
| #1 Serialization | Pass. No new persisted field. A test saves and loads a score with a non-default size, and loads a note written without a size (a legacy score) and checks it gets 30. A default size is still not written. |
|
|
42
|
+
| #2 Editing and transformation logic regression tested | Pass. The range rule and the apply-to-selected-notes behaviour of `SmoOperation.addDynamic` with a size are headless tests. |
|
|
43
|
+
| #3 Rendering performance | Pass. No rendering change; the renderer already draws dynamics at `fontSize`. The replace queue still merges redraws per measure. |
|
|
44
|
+
| #4 Logical dependencies | Pass. The range rule is in `src/smo` with no UI imports. The dialog stays in `src/ui`. |
|
|
45
|
+
|
|
46
|
+
Re-check after Phase 1 design: still passes. No complexity violations.
|
|
47
|
+
|
|
48
|
+
## Project Structure
|
|
49
|
+
|
|
50
|
+
### Documentation (this feature)
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
specs/040-dynamics-dialog-cleanup/
|
|
54
|
+
├── plan.md # This file
|
|
55
|
+
├── research.md # Phase 0 output
|
|
56
|
+
├── data-model.md # Phase 1 output
|
|
57
|
+
├── quickstart.md # Phase 1 output
|
|
58
|
+
├── contracts/
|
|
59
|
+
│ └── dynamics-dialog.md # Phase 1 output
|
|
60
|
+
├── checklists/
|
|
61
|
+
│ └── requirements.md
|
|
62
|
+
└── tasks.md # Phase 2 output (/speckit-tasks - NOT created by /speckit-plan)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Source Code (repository root)
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
src/smo/data/noteModifiers.ts # SmoDynamicText: minFontSize, maxFontSize, isValidFontSize()
|
|
69
|
+
src/ui/dialogs/dynamicsVue.ts # REWRITTEN: local state and functions, no adapter, fontSize
|
|
70
|
+
src/ui/components/dialogs/dynamics.vue # Font Size number field; updateNumberCb takes 'fontSize'
|
|
71
|
+
src/ui/dialogs/dynamics.ts # DELETED (SuiDynamicDialogAdapter and SuiDynamicModifierDialog)
|
|
72
|
+
src/application/exports.ts # remove the dynamics.ts import, the export *, and the list entry
|
|
73
|
+
typedoc.ts # remove the export of dynamics
|
|
74
|
+
src/ui/i18n/language.ts # remove 'SuiDynamicModifierDialog' from allDialogs
|
|
75
|
+
src/ui/dialogs/annotationVue.ts # reword the comment that points at dynamics.ts
|
|
76
|
+
types/src/ui/dialogs/dynamics.d.ts # DELETED
|
|
77
|
+
types/src/application/exports.d.ts # remove the same three references
|
|
78
|
+
types/typedoc.d.ts # remove the export of dynamics
|
|
79
|
+
types/src/smo/data/noteModifiers.d.ts # the new static members
|
|
80
|
+
tests/dynamicsFontSize.ts # NEW
|
|
81
|
+
package.json # test:dynamics-font-size script
|
|
82
|
+
changes.md # changelog entry
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Structure Decision**: Single-project layout as it exists. The dialog function keeps the creation-function shape of the other Vue dialogs, and the new rule sits on the model class next to the field it constrains.
|
|
86
|
+
|
|
87
|
+
## Complexity Tracking
|
|
88
|
+
|
|
89
|
+
No constitution violations to justify.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Quickstart: Validating the Dynamics Dialog Cleanup
|
|
2
|
+
|
|
3
|
+
## 1. Headless checks
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
npm run test:dynamics-font-size
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Expected: every case in [contracts/dynamics-dialog.md](contracts/dynamics-dialog.md) (M, S and A cases) prints `PASS` and the script exits 0.
|
|
10
|
+
|
|
11
|
+
Also run suites that touch notes and serialization, to check nothing regressed:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
npm run test:score-archive
|
|
15
|
+
npm run test:paste-special
|
|
16
|
+
npm run test:voice-copy-paste
|
|
17
|
+
npm run test:quick-beam
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 2. Compile and search
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
npx tsc --noEmit -p tsconfig.json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Expected: no errors.
|
|
27
|
+
|
|
28
|
+
Then check the legacy dialog is gone (contract cases C1 to C4 and C8):
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
git ls-files src/ui/dialogs/dynamics.ts
|
|
32
|
+
git grep -n "SuiDynamicDialogAdapter\|dialogs/dynamics'" -- src tests types
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Expected: both print nothing.
|
|
36
|
+
|
|
37
|
+
Compile the component with Vue's own compiler (it is not covered by `tsc`):
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
node -e "const s=require('@vue/compiler-sfc'),f=require('fs');const {descriptor,errors}=s.parse(f.readFileSync('src/ui/components/dialogs/dynamics.vue','utf8'));console.log('parse errors',errors.length);s.compileScript(descriptor,{id:'x',inlineTemplate:true});console.log('ok')"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Expected: `parse errors 0` and `ok`.
|
|
44
|
+
|
|
45
|
+
## 3. Manual: font size (spec user story 1)
|
|
46
|
+
|
|
47
|
+
1. Open a score, select a note, and choose Text, then **Dynamics**. If the note had no marking, a default one is added.
|
|
48
|
+
2. In the dialog, Font Size shows 30. Press the up arrow a few times, or type 48.
|
|
49
|
+
3. Expected: the marking on the score gets bigger as you change it, and the dialog stays open.
|
|
50
|
+
4. Press OK. Expected: the marking stays at the new size.
|
|
51
|
+
5. Save the score, reload it. Expected: the marking is still the larger size.
|
|
52
|
+
6. Reopen the dialog and type 0, then 150. Expected: the field stays between 1 and 99 and the marking never gets an out-of-range size.
|
|
53
|
+
7. Select three notes, open the dialog, set Font Size to 20. Expected: all three markings change.
|
|
54
|
+
8. Change the size, then press Cancel. Expected: the markings return to their old size.
|
|
55
|
+
9. Open a score saved before this feature. Expected: the markings look the same as before.
|
|
56
|
+
|
|
57
|
+
## 4. Manual: everything else still works (user story 2)
|
|
58
|
+
|
|
59
|
+
1. Open the dialog on one note. Change the dynamic (for example to *ff*), Y Line, Y Offset Px and X Offset. Expected: each shows on the score at once.
|
|
60
|
+
2. Select several notes and repeat. Expected: all the selected markings change together.
|
|
61
|
+
3. Make several changes, press Cancel. Expected: every change is undone, on every selected note.
|
|
62
|
+
4. Make several changes, press OK, then choose Undo once. Expected: all the changes from that dialog are undone together.
|
|
63
|
+
5. Press Remove. Expected: the marking is gone from every selected note.
|
|
64
|
+
6. Click a dynamic marking on the score so the marking itself is selected, then open its properties. Expected: the dialog edits that marking.
|
|
65
|
+
7. Open the dialog. Expected: it appears next to the marking.
|
|
66
|
+
|
|
67
|
+
## 5. Manual: the application starts and the dialog opens by name
|
|
68
|
+
|
|
69
|
+
Build the application and open it. Expected: no console errors on load, and the Dynamics dialog opens from the Text menu and by selecting a marking (which goes through the dialog factory).
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Research: Dynamics Dialog Cleanup and Font Size
|
|
2
|
+
|
|
3
|
+
All unknowns from the Technical Context are resolved below. No `NEEDS CLARIFICATION` items remain.
|
|
4
|
+
|
|
5
|
+
## R1: What does the legacy adapter do that the dialog must keep?
|
|
6
|
+
|
|
7
|
+
**Finding** (`src/ui/dialogs/dynamics.ts`, used by `dynamicsVue.ts`):
|
|
8
|
+
|
|
9
|
+
1. `dynamicsVue.ts` calls `view.groupUndo(true)` and then builds the adapter.
|
|
10
|
+
2. The adapter constructor takes an undo snapshot of the selected measures: `view.undoTrackerMeasureSelections('Dynamics')`.
|
|
11
|
+
3. It picks which notes to edit: the selections of the selected modifiers (`tracker.modifierSelections`, when a marking itself is selected on the score), otherwise `tracker.selections`.
|
|
12
|
+
4. Each field setter sets the field on the modifier, then calls `view.addDynamic(selection, modifier)` for every one of those selections (the `syncModifiers` method; the `xOffset` setter repeats the same loop inline).
|
|
13
|
+
5. `cancel()` is `view.undo()`. `commit()` does nothing. `remove()` calls `view.removeDynamic(modifier)` once per selection.
|
|
14
|
+
6. `InstallDialog` calls `view.groupUndo(false)` after OK, and after Remove.
|
|
15
|
+
|
|
16
|
+
**Decision**: Copy these steps into `SuiDynamicModifierDialogVue` as local variables (`modifier`, `selections`) and local arrow functions (`syncModifiers`, the callbacks passed to the component). Same order: `groupUndo(true)`, then the snapshot, then pick the selections.
|
|
17
|
+
|
|
18
|
+
**Rationale**: The request is a restructuring plus one new field, and the spec's User Story 2 says nothing may change for the user. Copying the steps keeps the undo behaviour (one step for the whole dialog session, Cancel restores everything) exactly as it is.
|
|
19
|
+
|
|
20
|
+
**One simplification**: the adapter's `remove()` loops over the selections and calls `view.removeDynamic` each time, but `view.removeDynamic` already removes the marking from every selected note, so the second and later calls do nothing. The new Remove calls it once. The result on the score is the same.
|
|
21
|
+
|
|
22
|
+
**Alternatives considered**: A small shared helper for the "edit the marking on all the selected notes" loop (the annotation dialog has a similar loop). Rejected: the annotation dialog works on lyrics, not dynamics, and sharing would couple the two for no gain.
|
|
23
|
+
|
|
24
|
+
## R2: Where does the font size come from, and does the renderer honour it?
|
|
25
|
+
|
|
26
|
+
**Finding**: `SmoDynamicText` has `fontSize` (default `defaultNoteScale`, 30). It is in `defaults`, so it is in `persistArray` and is serialized when it differs from 30. The constructor merges the defaults first, so a note saved without it loads with 30. `renderDynamicsForNote` in `src/render/vex/vxMeasure.ts` passes `textObj.fontSize` to the glyph renderer, so a different size is drawn.
|
|
27
|
+
|
|
28
|
+
**Decision**: No model or renderer change to make the size work. The dialog only needs to set `modifier.fontSize` and call the same sync as the other fields.
|
|
29
|
+
|
|
30
|
+
**Rationale**: Confirms the spec's FR-003 and FR-004 need no migration: old scores keep 30.
|
|
31
|
+
|
|
32
|
+
## R3: The allowed range
|
|
33
|
+
|
|
34
|
+
**Finding**: `numberInput.vue` clamps typed and stepped values to `minValue`/`maxValue` props, but a callback could still be called with something else if the component is bypassed, and the spec requires that a bad size is never applied (FR-007).
|
|
35
|
+
|
|
36
|
+
**Decision**: Add `static minFontSize = 1`, `static maxFontSize = 99` and `static isValidFontSize(value: number): boolean` (a whole number from 1 to 99) to `SmoDynamicText`. The dialog uses the constants for the number field's `minValue`/`maxValue` and calls `isValidFontSize` in its callback before it changes the marking.
|
|
37
|
+
|
|
38
|
+
**Rationale**: One definition of the range, testable headless, used by both the field and the guard. 1 to 99 is the assumption recorded in the spec; the default of 30 is well inside it.
|
|
39
|
+
|
|
40
|
+
**Alternatives considered**: Putting the range in the Vue component only (not testable without the UI; two places to change); a wider range such as 6 to 200 (no evidence for it; can be changed in one place later).
|
|
41
|
+
|
|
42
|
+
## R4: What references the legacy dialog?
|
|
43
|
+
|
|
44
|
+
**Finding** (search of `src`, `types`, `tests`):
|
|
45
|
+
|
|
46
|
+
- `src/ui/dialogs/dynamics.ts` defines `SuiDynamicDialogAdapter` and `SuiDynamicModifierDialog`.
|
|
47
|
+
- `src/application/exports.ts` imports `SuiDynamicModifierDialog`, re-exports the whole module (`export * from '../ui/dialogs/dynamics'`), and lists it in the exported-names object.
|
|
48
|
+
- `src/ui/i18n/language.ts` lists `'SuiDynamicModifierDialog'` in `allDialogs` (the dialogs the translation editor shows).
|
|
49
|
+
- `src/ui/dialogs/annotationVue.ts` has a comment that mentions `SuiDynamicDialogAdapter` and `src/ui/dialogs/dynamics.ts`.
|
|
50
|
+
- `src/ui/menus/text.ts` passes the string `'SuiDynamicModifierDialog'` as the `ctor` field of the dialog parameters, and `src/ui/dialogs/factory.ts` opens the Vue dialog for a `SmoDynamicText` modifier. Both use the Vue dialog already.
|
|
51
|
+
- `typedoc.ts` at the repository root re-exports the module (found by the compiler after the file was deleted).
|
|
52
|
+
- The generated declarations in `types/` mirror these (`dynamics.d.ts`, `exports.d.ts`, `typedoc.d.ts`).
|
|
53
|
+
- `src/ui/i18n/language_*.json` and `.js` have saved translations under the ctor name `SuiDynamicModifierDialog`.
|
|
54
|
+
|
|
55
|
+
**Decision**:
|
|
56
|
+
- Delete `dynamics.ts` and `types/src/ui/dialogs/dynamics.d.ts`.
|
|
57
|
+
- Remove the three references in `exports.ts` and the matching ones in `types/src/application/exports.d.ts` and `types/typedoc.d.ts`.
|
|
58
|
+
- Remove `'SuiDynamicModifierDialog'` from `allDialogs` in `language.ts`.
|
|
59
|
+
- Reword the `annotationVue.ts` comment so it no longer names a file that does not exist.
|
|
60
|
+
- Keep the `ctor: 'SuiDynamicModifierDialog'` strings in `text.ts` and the factory (they are labels for the dialog parameters, not references to the class), and leave the saved translation files alone.
|
|
61
|
+
|
|
62
|
+
**Rationale on the translation list**: the translation editor looks each name up as a class (`eval`), and when the class is missing it logs a warning and skips it. The earlier conversion of the time signature dialog left such a stale entry. Removing the entry avoids a new warning. The translation files are data, they are generated by the editor, and the Vue dialogs use English labels, so they are not touched.
|
|
63
|
+
|
|
64
|
+
**Rationale on the library export**: `SuiDynamicModifierDialog` is a public export of the library build. Removing it is what the request asks for, and nothing in the application uses it. Only outside code that imports it by name is affected (the spec's Assumptions say this).
|
|
65
|
+
|
|
66
|
+
**Older spec folders**: `specs/004-vue-modifier-dialogs` and `specs/017-text-annotations` describe the old dialog. They are a record of earlier work and are not changed.
|
|
67
|
+
|
|
68
|
+
## R5: How is the dialog tested without a browser?
|
|
69
|
+
|
|
70
|
+
**Finding**: `tests/` scripts run under `ts-node` with no DOM and cannot import a `.vue` file. `dynamicsVue.ts` imports `dialog.ts` (which imports Vue and the DOM) and the `.vue` component, so it cannot be loaded either.
|
|
71
|
+
|
|
72
|
+
**Decision**: Test what can be tested headless: the model rule and the model behaviour the dialog depends on (a size applied through `SmoOperation.addDynamic` reaches every selected note, serializes, and loads). Check the dialog by `tsc`, by compiling `dynamics.vue` with `@vue/compiler-sfc` (as was done for the beam groups dialog), by a repository search that proves the legacy names are gone, and by the manual steps in the quickstart.
|
|
73
|
+
|
|
74
|
+
**Alternatives considered**: Moving the dialog logic into a plain TypeScript module so it can be tested (adds a layer, which is the opposite of the request); a headless browser test (the constitution says UI rendering need not be tested here, and those belong in the Demos repository).
|
|
75
|
+
|
|
76
|
+
## R6: Number field for the size
|
|
77
|
+
|
|
78
|
+
**Decision**: Use the existing `numberInputApp` in `dynamics.vue` with `:precision="0"`, `:minValue` and `:maxValue` from the new constants, in the same style as the other fields, placed with X Offset. The component's callback type for numbers gains `'fontSize'`. The user's uncommitted change to `dynamics.vue` (the callback returning `Promise<void>`) is kept.
|
|
79
|
+
|
|
80
|
+
**Rationale**: It matches the other three number fields and the font size fields in other dialogs, and needs no new component.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Feature Specification: Dynamics Dialog Cleanup and Font Size
|
|
2
|
+
|
|
3
|
+
**Feature Branch**: `040-dynamics-dialog-cleanup`
|
|
4
|
+
|
|
5
|
+
**Created**: 2026-11-15
|
|
6
|
+
|
|
7
|
+
**Status**: Draft
|
|
8
|
+
|
|
9
|
+
**Input**: User description: "src/ui/dynamicsVue.ts uses SuiDynamicDialogAdapter, which is a method from a legacy method of dialogs. We don't need the object, instead implement all the functions directly in SuiDynamicModifierDialogVue anonymous functions and local variables. Also, there is a font parameter in the underlying SmoDynamicText that is not exposed in the vue dialog. We should be able to set the font size also. Once the functionality is in dynamicsVue.ts, we can remove dynamics.ts from the dialogs directory."
|
|
10
|
+
|
|
11
|
+
## User Scenarios & Testing *(mandatory)*
|
|
12
|
+
|
|
13
|
+
### User Story 1 - Change the size of a dynamic marking (Priority: P1)
|
|
14
|
+
|
|
15
|
+
A user has put a dynamic marking such as *mf* under a note and finds it too small to read, or too large next to the notes. They select the note, open the Dynamics dialog, and change the **Font Size** field. The marking on the score changes size as they adjust it. They press OK and the new size stays.
|
|
16
|
+
|
|
17
|
+
**Why this priority**: This is the only change a musician will notice. Every dynamic marking has a size, but today the dialog gives no way to change it.
|
|
18
|
+
|
|
19
|
+
**Independent Test**: Select a note with a dynamic marking, open the Dynamics dialog, increase Font Size, and confirm the marking is drawn larger. Press OK, save the score, reopen it, and confirm the size is the same.
|
|
20
|
+
|
|
21
|
+
**Acceptance Scenarios**:
|
|
22
|
+
|
|
23
|
+
1. **Given** a note with a dynamic marking, **When** the user opens the Dynamics dialog, **Then** it shows a Font Size field set to the marking's current size.
|
|
24
|
+
2. **Given** the dialog is open, **When** the user changes Font Size, **Then** the marking is redrawn at the new size right away, without closing the dialog.
|
|
25
|
+
3. **Given** the user changed the size, **When** they press OK, **Then** the marking keeps the new size, and the size is saved with the score.
|
|
26
|
+
4. **Given** the user changed the size, **When** they press Cancel, **Then** the marking returns to its original size, along with any other change made in the dialog.
|
|
27
|
+
5. **Given** several notes are selected, **When** the user changes Font Size, **Then** the marking on every selected note changes to that size.
|
|
28
|
+
6. **Given** a score saved before this feature, **When** it is opened, **Then** its dynamic markings are drawn at the same size as before.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### User Story 2 - The Dynamics dialog keeps working as it does today (Priority: P1)
|
|
33
|
+
|
|
34
|
+
A user opens the Dynamics dialog to choose a different dynamic (for example *p* instead of *mf*), nudge it up or down, move it left or right, or remove it. All of this works exactly as before, including on a selection of several notes, Cancel, and Remove, and each change shows on the score as it is made.
|
|
35
|
+
|
|
36
|
+
**Why this priority**: The dialog is being rewritten internally, so the main risk is breaking something people already use. This story is what proves nothing was lost.
|
|
37
|
+
|
|
38
|
+
**Independent Test**: Open the dialog on one note and on several notes; change the dynamic, the Y line, the Y offset and the X offset; confirm each shows on the score at once. Press Cancel and confirm everything returns. Open it again and press Remove, and confirm the marking is gone from every selected note.
|
|
39
|
+
|
|
40
|
+
**Acceptance Scenarios**:
|
|
41
|
+
|
|
42
|
+
1. **Given** the dialog is open on one note, **When** the user changes the dynamic, Y Line, Y Offset or X Offset, **Then** the marking on the score updates as each is changed.
|
|
43
|
+
2. **Given** several notes are selected, **When** the user changes any of those fields, **Then** the markings on all of the selected notes change together.
|
|
44
|
+
3. **Given** the user has made changes, **When** they press Cancel, **Then** every change made in the dialog is undone, including on every selected note.
|
|
45
|
+
4. **Given** the user has made several changes and presses OK, **When** they then choose Undo once, **Then** all the changes made in that dialog are undone together.
|
|
46
|
+
5. **Given** the dialog is open, **When** the user presses Remove, **Then** the marking is removed from every selected note.
|
|
47
|
+
6. **Given** a dynamic marking has been selected on the score (rather than a note), **When** the user opens the dialog, **Then** it edits that marking, and the markings of any other selected notes, as before.
|
|
48
|
+
7. **Given** a note with no dynamic marking, **When** the user chooses Dynamics from the menu, **Then** a default marking is added and the dialog opens on it, as before.
|
|
49
|
+
8. **Given** the dialog opens, **When** it appears, **Then** it is placed next to the marking, as before.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### User Story 3 - The old dialog is gone (Priority: P2)
|
|
54
|
+
|
|
55
|
+
A developer looking at the dialogs no longer finds two dynamics dialogs. The Dynamics dialog is defined in one place, its logic written directly where the dialog is created, without the intermediate object that older dialogs used. The old, unused dialog is deleted.
|
|
56
|
+
|
|
57
|
+
**Why this priority**: It keeps the code small and removes a dialog nobody opens, but it changes nothing for the user.
|
|
58
|
+
|
|
59
|
+
**Independent Test**: Search the project for the old dialog and its helper object: neither is defined or referenced anywhere. The application builds, and the Dynamics dialog still opens from the menu and from the dialog factory.
|
|
60
|
+
|
|
61
|
+
**Acceptance Scenarios**:
|
|
62
|
+
|
|
63
|
+
1. **Given** the change is complete, **When** the project is searched, **Then** there is no remaining definition of, or reference to, the old Dynamics dialog or its adapter object.
|
|
64
|
+
2. **Given** the change is complete, **When** the project is built, **Then** it builds without errors.
|
|
65
|
+
3. **Given** the dialog is requested by its name (for example from the dialog factory), **When** it is created, **Then** the same Dynamics dialog opens.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### Edge Cases
|
|
70
|
+
|
|
71
|
+
- A Font Size that is not a sensible number (empty, zero or negative) is not accepted; the marking keeps its last valid size. [see Assumptions for the allowed range]
|
|
72
|
+
- The size field can be changed many times quickly; the marking ends at the last value, with no flicker to old values.
|
|
73
|
+
- Pressing Cancel after changing only the size restores the original size.
|
|
74
|
+
- Pressing Remove after changing the size removes the marking; Undo brings back the marking at its original size.
|
|
75
|
+
- A selection that contains notes with different dynamic markings: the dialog edits the marking on the first note, as it does today, and applies each change to all of the selected notes.
|
|
76
|
+
- A selection that contains notes with no marking: the menu adds one to each before the dialog opens, as it does today.
|
|
77
|
+
- Opening the dialog on a large selection stays responsive: each change redraws once, not once per selected note.
|
|
78
|
+
|
|
79
|
+
## Requirements *(mandatory)*
|
|
80
|
+
|
|
81
|
+
### Functional Requirements
|
|
82
|
+
|
|
83
|
+
- **FR-001**: The Dynamics dialog MUST show a **Font Size** field alongside Y Line, Y Offset and X Offset, set to the current size of the marking.
|
|
84
|
+
- **FR-002**: Changing Font Size MUST redraw the marking at the new size immediately, without closing the dialog, on every selected note.
|
|
85
|
+
- **FR-003**: The marking's size MUST be saved with the score and restored when the score is opened.
|
|
86
|
+
- **FR-004**: Scores saved before this feature MUST open with dynamic markings at the same size as before.
|
|
87
|
+
- **FR-005**: The dialog MUST keep every existing control and behaviour: choosing the dynamic text, Y Line, Y Offset, X Offset, applying changes to all selected notes, live redraw, Cancel, Remove, placement next to the marking, and undo of all of a dialog session's changes in one step.
|
|
88
|
+
- **FR-006**: Cancel MUST undo every change made in the dialog session, including the size.
|
|
89
|
+
- **FR-007**: A Font Size outside the allowed range MUST NOT be applied. The marking keeps its last valid size.
|
|
90
|
+
- **FR-008**: The Dynamics dialog MUST be implemented in one place, with its state and actions written directly in the function that creates the dialog. It MUST NOT depend on the adapter object used by the older style of dialog.
|
|
91
|
+
- **FR-009**: The old Dynamics dialog and its adapter object MUST be deleted, and nothing in the project may refer to them.
|
|
92
|
+
- **FR-010**: Everything that opens the Dynamics dialog (the Text menu choice and the dialog factory, by name) MUST keep working and open the same dialog.
|
|
93
|
+
- **FR-011**: The application MUST build after the change.
|
|
94
|
+
|
|
95
|
+
### Key Entities *(include if feature involves data)*
|
|
96
|
+
|
|
97
|
+
- **Dynamic marking**: Text such as *p* or *ff* attached to a note. Has the dynamic itself, a vertical position (line and pixel offset), a horizontal offset, and a font size. All of these are saved with the note.
|
|
98
|
+
- **Dynamics dialog**: The form that edits a dynamic marking on the selected notes. Holds the values being edited while it is open and applies each change to the score as it is made.
|
|
99
|
+
|
|
100
|
+
## Success Criteria *(mandatory)*
|
|
101
|
+
|
|
102
|
+
### Measurable Outcomes
|
|
103
|
+
|
|
104
|
+
- **SC-001**: A user can change the size of a dynamic marking in three actions or fewer: select the note, open the Dynamics dialog, change Font Size.
|
|
105
|
+
- **SC-002**: After a Font Size change, 100% of the selected notes' markings show the new size within one redraw, and the size is the same after saving and reopening the score.
|
|
106
|
+
- **SC-003**: Every behaviour in User Story 2 works as it did before the change: 0 behaviours lost, checked one by one.
|
|
107
|
+
- **SC-004**: After Cancel, 100% of the selected markings are back to their size, position and text from before the dialog opened.
|
|
108
|
+
- **SC-005**: Scores saved before this feature open with no visible change in any dynamic marking.
|
|
109
|
+
- **SC-006**: The project contains 0 definitions of, or references to, the old Dynamics dialog and its adapter object, and it builds without errors.
|
|
110
|
+
|
|
111
|
+
## Assumptions
|
|
112
|
+
|
|
113
|
+
- "Font Size" is the size already stored with each dynamic marking, and the score drawing already uses it. The feature exposes it; it does not change how it is used.
|
|
114
|
+
- The allowed range for Font Size is whole numbers from 1 to 99, shown in the dialog in the same way as the other number fields. This is a reasonable default and can be tuned. The marking's default size is unchanged.
|
|
115
|
+
- Font Size is applied to the marking only; the dynamic text, position and offsets are unchanged by it.
|
|
116
|
+
- The dialog's name as used by the dialog factory and the list of dialogs for translation stays the same, so existing callers and language files are unaffected.
|
|
117
|
+
- The old Dynamics dialog is a library export. Removing it removes it from the library's public list as well. No application code opens it (the menu and factory both use the newer dialog), so only third-party code that imported the old dialog by name would be affected; this is accepted, in line with the request to remove it.
|
|
118
|
+
- Other dialogs that mention the old adapter in a comment (for example the annotation dialog) are not changed except to fix the comment, so it no longer points at a file that does not exist.
|
|
119
|
+
- "Undo" behaviour of the dialog (one undo step for a dialog session) is kept exactly as it is today, whatever the mechanism.
|
|
120
|
+
- Text for the new field is in English, following the existing practice for dialog labels.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
description: "Task list for Dynamics Dialog Cleanup and Font Size"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tasks: Dynamics Dialog Cleanup and Font Size
|
|
7
|
+
|
|
8
|
+
**Input**: Design documents from `/specs/040-dynamics-dialog-cleanup/`
|
|
9
|
+
|
|
10
|
+
**Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md), [data-model.md](data-model.md), [contracts/dynamics-dialog.md](contracts/dynamics-dialog.md), [quickstart.md](quickstart.md)
|
|
11
|
+
|
|
12
|
+
**Tests**: Included for the model (the font size rule, serialization, applying to notes) in `tests/dynamicsFontSize.ts`. The dialog itself cannot be loaded headless (it imports a `.vue` file), so it is checked by compilation, by compiling the component with Vue's SFC compiler, by searches that prove the legacy code is gone, and by [quickstart.md](quickstart.md).
|
|
13
|
+
|
|
14
|
+
**Organization**: The rewrite of the dialog function without the adapter is the base for every story, so it is in the Foundational phase. Each story then adds its piece: the Font Size field (US1), proof that existing behaviour is kept (US2), and removal of the legacy dialog (US3).
|
|
15
|
+
|
|
16
|
+
**Existing uncommitted work**: `src/ui/components/dialogs/dynamics.vue` has an uncommitted change by the user (the `updateNumberCb` prop type is `Promise<void>`). Edit on top of it; do not revert it.
|
|
17
|
+
|
|
18
|
+
## Format: `[ID] [P?] [Story] Description`
|
|
19
|
+
|
|
20
|
+
- **[P]**: Can run in parallel (different files, no dependencies on unfinished tasks)
|
|
21
|
+
- **[Story]**: Which user story the task belongs to (US1 to US3)
|
|
22
|
+
|
|
23
|
+
## Phase 1: Setup
|
|
24
|
+
|
|
25
|
+
- [X] T001 Create `tests/dynamicsFontSize.ts` with the `check()`/failure-count harness and the dynamic-ctor registration used in `tests/quickBeam.ts` (`noteModifierDynamicCtorInit`, `measureModifierDynamicCtorInit`, `staffModifierDynamicCtorInit`, `scoreModifierDynamicCtorInit`), plus a `buildScore(noteCount: number)` helper that makes a default score (`SmoScore.getDefaultScore(SmoScore.defaults, null)`) whose first measure has `noteCount` quarter notes (clone the first note with `SmoNote.cloneWithDuration(proto, 4096)`, `noteType = 'n'`) and a `pick(score, tick)` helper returning `SmoSelection.noteSelection(score, 0, 0, 0, tick)!`. Register `"test:dynamics-font-size": "ts-node -P tests/tsconfig.json tests/dynamicsFontSize.ts"` in `package.json`
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Phase 2: Foundational (Blocking Prerequisites)
|
|
30
|
+
|
|
31
|
+
**Purpose**: The size rule on the model, and the dialog function rewritten without the adapter. See [research.md](research.md) R1 to R3 and [data-model.md](data-model.md).
|
|
32
|
+
|
|
33
|
+
- [X] T002 In `src/smo/data/noteModifiers.ts` add to `SmoDynamicText`: `static readonly minFontSize: number = 1`, `static readonly maxFontSize: number = 99`, and `static isValidFontSize(value: number): boolean` that is true only for a whole number (`Number.isInteger`) from `minFontSize` to `maxFontSize` inclusive, and false for anything else including non-numbers (check `typeof value === 'number'` first). Add a doc comment. Do not change `defaults`, `persistArray` or `serialize`
|
|
34
|
+
- [X] T003 Rewrite `src/ui/dialogs/dynamicsVue.ts` so it does not import `./dynamics` and has no adapter object. Keep the same export (`SuiDynamicModifierDialogVue(parameters: SuiDialogParams)`), imports of `SuiDialogParams`, `InstallDialog`, `getModifierDialogPosition`, `dynamicsComp`, `replaceVueRoot`, `modalContainerId`, and add imports of `SmoDynamicText` (from `'../../smo/data/noteModifiers'`) and `SmoSelection` (from `'../../smo/xform/selections'`). Inside the function, in this order, copy the legacy behaviour from [research.md](research.md) R1: `const view = parameters.view; const modifier = parameters.modifier as SmoDynamicText;`, `view.groupUndo(true)`, then `view.undoTrackerMeasureSelections('Dynamics')`, then build `const selections: SmoSelection[] = []` from `view.tracker.modifierSelections` (push each `ms.selection` that is set) and, if there are none, use `view.tracker.selections`. Define local functions: `syncModifiers = () => { selections.forEach((sel) => { view.addDynamic(sel, modifier); }); }`; `updateNumberCb = async (param: 'yOffsetLine' | 'yOffsetPixels' | 'xOffset', value: number) => { modifier[param] = value; syncModifiers(); }`; `updateTextCb = (value: string) => { modifier.text = value; syncModifiers(); }`; `commitCb = async () => {}`; `cancelCb = async () => { await view.undo(); }`; `removeCb = async () => { await view.removeDynamic(modifier); }`. Build `appParams` from `modifier.yOffsetLine`, `modifier.yOffsetPixels`, `modifier.xOffset`, `modifier.text` (replacing every `adapter.` read), keeping `domId`, `label: 'Dynamics Properties'`, `initialPosition`, and the callbacks. Keep the `InstallDialog` call as it is. Replace the doc comment: say the dialog keeps its state in local variables and that the marking is already attached to the score by the menu handler in `src/ui/menus/text.ts`
|
|
35
|
+
- [X] T004 Run `npx tsc --noEmit -p tsconfig.json` to confirm the foundation compiles. (`dynamics.ts` still exists at this point and nothing imports it from `dynamicsVue.ts` any more.)
|
|
36
|
+
|
|
37
|
+
**Checkpoint**: The dialog works exactly as before, with no adapter. No size field yet.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Phase 3: User Story 1 - Change the size of a dynamic marking (Priority: P1)
|
|
42
|
+
|
|
43
|
+
**Goal**: The Dynamics dialog has a Font Size field that redraws the marking live on every selected note, saves with the score, and rejects out-of-range values.
|
|
44
|
+
|
|
45
|
+
**Independent Test**: Run the M and S cases in `tests/dynamicsFontSize.ts`, then [quickstart.md](quickstart.md) section 3.
|
|
46
|
+
|
|
47
|
+
- [X] T005 [P] [US1] In `tests/dynamicsFontSize.ts` add the model cases from [contracts/dynamics-dialog.md](contracts/dynamics-dialog.md): M1 to M6 (default 30; `isValidFontSize` true for 1, 30, 99; false for 0, -5, 100, 1000, 12.5, `NaN`, `Infinity`, `-Infinity`, a string and `undefined` passed with a cast; the constants are 1 and 99) and S1 to S5 (a default-size marking serializes without `fontSize`; size 48 serializes with it; a score with one note at 48 and one at the default round trips through `JSON.stringify(score.serialize())` and `SmoScore.deserialize` with 48 and 30; a marking built from parameters with no `fontSize` has 30; setting 48 then back to 30 serializes without `fontSize`). Attach markings with `SmoOperation.addDynamic(pick(score, n), new SmoDynamicText({ ...SmoDynamicText.defaults, fontSize }))` and read them with `note.getModifiers('SmoDynamicText')`. Run `npm run test:dynamics-font-size`
|
|
48
|
+
- [X] T006 [P] [US1] In `src/ui/components/dialogs/dynamics.vue`: add `fontSize: number` to `Props`; widen the number callback's param type to `'yOffsetLine' | 'yOffsetPixels' | 'xOffset' | 'fontSize'` (keep the `Promise<void>` return type that is already there); and add a Font Size field after the X Offset row, in the same style: `<numberInputApp :domId="getId('font-size')" :initialValue="fontSize" :precision="0" label="Font Size" :minValue="SmoDynamicText.minFontSize" :maxValue="SmoDynamicText.maxFontSize" :changeCb="(value: number) => updateNumberCb('fontSize', value)" :inline="true" />` inside a `<div class="group"><div class="grow-row">`. `SmoDynamicText` is already imported in the component
|
|
49
|
+
- [X] T007 [US1] In `src/ui/dialogs/dynamicsVue.ts` add `'fontSize'` to the `param` union of `updateNumberCb`, and make the callback return early, changing nothing and not calling `syncModifiers`, when `param === 'fontSize'` and `!SmoDynamicText.isValidFontSize(value)`. Add `fontSize: modifier.fontSize` to `appParams`
|
|
50
|
+
- [X] T008 [US1] Compile the component and the project: run `npx tsc --noEmit -p tsconfig.json`, then the SFC check from [quickstart.md](quickstart.md) section 2 on `src/ui/components/dialogs/dynamics.vue` (expect `parse errors 0` and `ok`)
|
|
51
|
+
|
|
52
|
+
**Checkpoint**: User story 1 works end to end.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Phase 4: User Story 2 - The dialog keeps working as it does today (Priority: P1)
|
|
57
|
+
|
|
58
|
+
**Goal**: Show that nothing the dialog did before was lost in the rewrite.
|
|
59
|
+
|
|
60
|
+
**Independent Test**: Run the A cases in `tests/dynamicsFontSize.ts`, review the function against the list in T010, and run [quickstart.md](quickstart.md) section 4.
|
|
61
|
+
|
|
62
|
+
- [X] T009 [P] [US2] In `tests/dynamicsFontSize.ts` add the A cases: A1 (three notes: add the same marking to each with `SmoOperation.addDynamic`, change `fontSize` to 40 and add it to each again; every note has exactly one `SmoDynamicText`, of size 40), A2 (`SmoOperation.removeDynamic` on each selected note leaves none), A3 (a marking on one note leaves the others unchanged). Run `npm run test:dynamics-font-size`
|
|
63
|
+
- [X] T010 [US2] Read `src/ui/dialogs/dynamicsVue.ts` side by side with the legacy `src/ui/dialogs/dynamics.ts` (still present) and confirm each legacy behaviour has an equivalent in the new function, fixing any gap: (1) `groupUndo(true)` before the snapshot; (2) `undoTrackerMeasureSelections('Dynamics')` once; (3) selections come from `modifierSelections` first, else `tracker.selections`; (4) `yOffsetLine`, `yOffsetPixels`, `xOffset` and `text` each set the field and apply to every selection; (5) Cancel is `view.undo()`; (6) Remove calls `view.removeDynamic(modifier)`; (7) the same props reach the component; (8) the `initialPosition` still comes from `getModifierDialogPosition(view, parameters.modifier)`. Record the result as a short comment-free note in the PR or commit message, not in the code
|
|
64
|
+
|
|
65
|
+
**Checkpoint**: Every existing behaviour is accounted for.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Phase 5: User Story 3 - The old dialog is gone (Priority: P2)
|
|
70
|
+
|
|
71
|
+
**Goal**: The legacy dialog and its adapter are deleted and nothing refers to them.
|
|
72
|
+
|
|
73
|
+
**Independent Test**: Contract cases C1 to C8, and [quickstart.md](quickstart.md) section 2.
|
|
74
|
+
|
|
75
|
+
- [X] T011 [US3] Delete `src/ui/dialogs/dynamics.ts` (`git rm src/ui/dialogs/dynamics.ts`)
|
|
76
|
+
- [X] T012 [P] [US3] In `typedoc.ts` (repository root) remove `export * from './src/ui/dialogs/dynamics';`, and in `src/application/exports.ts` remove the `import { SuiDynamicModifierDialog } from '../ui/dialogs/dynamics';` line, the `export * from '../ui/dialogs/dynamics';` line, and `SuiDynamicModifierDialog,` from the exported-names list (it sits at the start of a line with `CheckboxDropdownComponent`; keep the rest of that line)
|
|
77
|
+
- [X] T013 [P] [US3] In `src/ui/i18n/language.ts` remove `'SuiDynamicModifierDialog',` from `allDialogs` (research R4). Do not edit the `language_*.json` or `.js` files
|
|
78
|
+
- [X] T014 [P] [US3] In `src/ui/dialogs/annotationVue.ts` reword the header comment so it no longer names `SuiDynamicDialogAdapter` or `src/ui/dialogs/dynamics.ts`: say the multi-selection propagation follows the pattern in `src/ui/dialogs/dynamicsVue.ts`
|
|
79
|
+
- [X] T015 [P] [US3] Update the declarations by hand (do not run `npm run types`; it rewrites many unrelated files): delete `types/src/ui/dialogs/dynamics.d.ts`; in `types/src/application/exports.d.ts` remove the `SuiDynamicModifierDialog` import, the `export * from '../ui/dialogs/dynamics';` line and the `SuiDynamicModifierDialog: typeof SuiDynamicModifierDialog;` member; in `types/typedoc.d.ts` remove `export * from './src/ui/dialogs/dynamics';`; in `types/src/smo/data/noteModifiers.d.ts` add the three new `SmoDynamicText` static members with their types (`static readonly minFontSize: number;`, `static readonly maxFontSize: number;`, `static isValidFontSize(value: number): boolean;`) with the doc comment from T002; check `types/src/ui/dialogs/dynamicsVue.d.ts` still matches the exported function
|
|
80
|
+
- [X] T016 [US3] Run the searches from [quickstart.md](quickstart.md) section 2 and the contract cases C1 to C4 and C8: `git ls-files src/ui/dialogs/dynamics.ts`, `git grep -n "SuiDynamicDialogAdapter\|dialogs/dynamics'" -- src tests types` (both print nothing), and `git grep -n "SuiDynamicModifierDialog\b" -- src types tests` (only the `ctor` strings in `src/ui/menus/text.ts` remain). Then run `npx tsc --noEmit -p tsconfig.json`
|
|
81
|
+
|
|
82
|
+
**Checkpoint**: All stories are done and the legacy code is gone.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Phase 6: Polish and Cross-Cutting Concerns
|
|
87
|
+
|
|
88
|
+
- [X] T017 [P] Add a `changes.md` entry (follow the entries at the top of the file) describing: the Dynamics dialog has a **Font Size** field (1 to 99, default 30) that changes the size of the marking on all selected notes; scores saved before open unchanged; and, for people using Smoosic as a library, that the old `SuiDynamicModifierDialog` and `SuiDynamicDialogAdapter` classes are removed (use `SuiDynamicModifierDialogVue`; the factory still opens it for a `SmoDynamicText`)
|
|
89
|
+
- [X] T018 Run `npx tsc --noEmit -p tsconfig.json`, then `npm run test:dynamics-font-size`, `npm run test:score-archive`, `npm run test:paste-special`, `npm run test:voice-copy-paste`, `npm run test:quick-beam`, `npm run test:measure-fill`. All must pass
|
|
90
|
+
- [ ] T019 Walk through [quickstart.md](quickstart.md) sections 3 to 5 by hand in the running application and note any difference from the expected results
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Dependencies and Execution Order
|
|
95
|
+
|
|
96
|
+
- Phase 1 (T001) first. Phase 2 (T002 to T004) blocks every story; T002 and T003 touch different files and can run in either order, T004 after both.
|
|
97
|
+
- US1 (T005 to T008): T005 and T006 are independent files; T007 needs T002, T003 and T006; T008 after T007.
|
|
98
|
+
- US2 (T009, T010) needs only Phase 2 and can run alongside US1. T010 must run before T011 deletes the file it compares against.
|
|
99
|
+
- US3 (T011 to T016): T011 after T010. T012 to T015 touch different files and can run in parallel after T011; T016 after all of them.
|
|
100
|
+
- Polish (T017 to T019) after the stories; T017 can start any time.
|
|
101
|
+
|
|
102
|
+
### Parallel opportunities
|
|
103
|
+
|
|
104
|
+
- T002 and T003 (different files).
|
|
105
|
+
- T005 and T006 (different files).
|
|
106
|
+
- T009 alongside US1 work.
|
|
107
|
+
- T012, T013, T014, T015 (different files).
|
|
108
|
+
- T017 with anything.
|
|
109
|
+
|
|
110
|
+
## Implementation Strategy
|
|
111
|
+
|
|
112
|
+
**MVP**: Phase 1, Phase 2, then US1 (T001 to T008): the dialog has no adapter and has a working Font Size field. US2 adds the model tests and the side-by-side review that prove nothing was lost, which should be done before the legacy file is deleted. US3 is the deletion and cleanup. Polish adds the changelog, the full test run and the manual walkthrough.
|
|
113
|
+
|
|
114
|
+
Run `npm run test:dynamics-font-size` after each phase.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Specification Quality Checklist: Delete Special for Note Attachments
|
|
2
|
+
|
|
3
|
+
**Purpose**: Validate specification completeness and quality before proceeding to planning
|
|
4
|
+
**Created**: 2026-11-16
|
|
5
|
+
**Feature**: [spec.md](../spec.md)
|
|
6
|
+
|
|
7
|
+
## Content Quality
|
|
8
|
+
|
|
9
|
+
- [X] No implementation details (languages, frameworks, APIs)
|
|
10
|
+
- [X] Focused on user value and business needs
|
|
11
|
+
- [X] Written for non-technical stakeholders
|
|
12
|
+
- [X] All mandatory sections completed
|
|
13
|
+
|
|
14
|
+
## Requirement Completeness
|
|
15
|
+
|
|
16
|
+
- [X] No [NEEDS CLARIFICATION] markers remain
|
|
17
|
+
- [X] Requirements are testable and unambiguous
|
|
18
|
+
- [X] Success criteria are measurable
|
|
19
|
+
- [X] Success criteria are technology-agnostic (no implementation details)
|
|
20
|
+
- [X] All acceptance scenarios are defined
|
|
21
|
+
- [X] Edge cases are identified
|
|
22
|
+
- [X] Scope is clearly bounded
|
|
23
|
+
- [X] Dependencies and assumptions identified
|
|
24
|
+
|
|
25
|
+
## Feature Readiness
|
|
26
|
+
|
|
27
|
+
- [X] All functional requirements have clear acceptance criteria
|
|
28
|
+
- [X] User scenarios cover primary flows
|
|
29
|
+
- [X] Feature meets measurable outcomes defined in Success Criteria
|
|
30
|
+
- [X] No implementation details leak into specification
|
|
31
|
+
|
|
32
|
+
## Notes
|
|
33
|
+
|
|
34
|
+
- Chords were added in the 2026-11-16 clarification session (the request had listed annotations but not chords); FR-007 and the lyrics/annotations/chords scenarios now cover them.
|
|
35
|
+
- Validated in one pass; no iterations needed.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Contract: Delete Special API
|
|
2
|
+
|
|
3
|
+
Library surface (`SmoOperation`, `SuiScoreViewOperations` and the dialog are exported from `src/application/exports.ts`).
|
|
4
|
+
|
|
5
|
+
## Types and constants (`src/smo/xform/operations.ts`)
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
DeleteAttributeKind = 'dynamics' | 'lyrics' | 'annotations' | 'chords' | 'articulations'
|
|
9
|
+
| 'ornaments' | 'graceNotes' | 'arpeggios' | 'microtones'
|
|
10
|
+
SmoOperation.deleteAttributeKinds: DeleteAttributeKind[] // all nine, in dialog order
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## `SmoOperation`
|
|
14
|
+
|
|
15
|
+
| Member | Signature | Behavior |
|
|
16
|
+
|--------|-----------|----------|
|
|
17
|
+
| `countNoteAttributes` | `(selections: SmoSelection[], kinds: DeleteAttributeKind[]) => number` | Total number of markings of the listed kinds on the notes of the selections (see the data model for how each kind is counted). Reads only. Skips selections with no note and ignores unknown kinds. Returns 0 for no kinds. |
|
|
18
|
+
| `deleteNoteAttributes` | `(selections: SmoSelection[], kinds: DeleteAttributeKind[]) => void` | Removes every marking of the listed kinds from the notes of the selections. Never changes pitches, durations, note types, ties or any other kind. Does nothing for no kinds. |
|
|
19
|
+
|
|
20
|
+
## `SuiScoreViewOperations`
|
|
21
|
+
|
|
22
|
+
| Member | Signature | Behavior |
|
|
23
|
+
|--------|-----------|----------|
|
|
24
|
+
| `deleteNoteAttributes` | `(kinds: DeleteAttributeKind[]) => Promise<void>` | Uses the tracker's current selections. Returns without any change, undo step or redraw when `kinds` is empty or `countNoteAttributes` is 0. Otherwise runs `SmoOperation.deleteNoteAttributes` through `modifyCurrentSelections('delete special', ...)`: one undo step, applied to the displayed score and the backing score, with the changed measures redrawn. |
|
|
25
|
+
|
|
26
|
+
## UI
|
|
27
|
+
|
|
28
|
+
| Item | Behavior |
|
|
29
|
+
|------|----------|
|
|
30
|
+
| Edit menu | "Delete Special..." follows "Paste Special..." and is always shown. |
|
|
31
|
+
| `SuiDeleteSpecialDialog(parameters)` | Opens the dialog. Nine toggles in the order dynamics, lyrics, annotations, chords, articulations, ornaments, grace notes, arpeggios, microtones, all off. Confirm is disabled until one is on, and calls `view.deleteNoteAttributes` with the ticked kinds. Cancel changes nothing. |
|
|
32
|
+
|
|
33
|
+
Labels: Dynamics, Lyrics, Annotations, Chords, Articulations, Ornaments, Grace Notes, Arpeggios, Microtones.
|
|
34
|
+
|
|
35
|
+
## Invariants (asserted by tests)
|
|
36
|
+
|
|
37
|
+
1. After `deleteNoteAttributes`, every selected note's pitches, `tickCount`, `noteType`, ties and markings of unticked kinds are identical to before.
|
|
38
|
+
2. No marking of a ticked kind remains on any selected note; markings on notes outside the selections are unchanged.
|
|
39
|
+
3. Removing `lyrics`, `annotations` or `chords` never removes either of the other two.
|
|
40
|
+
4. `countNoteAttributes` after a delete, with the same kinds and selections, is 0; before it, it equals the number of markings the test put there.
|
|
41
|
+
5. A score serialized after a delete and loaded again has none of the removed markings and the same notes otherwise.
|