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.
Files changed (352) hide show
  1. package/build/smoosic.js +546 -125
  2. package/changes.md +85 -0
  3. package/package.json +23 -2
  4. package/release/smoosic.js +549 -128
  5. package/release/styles/menus.css +26 -0
  6. package/specs/022-text-reposition-on-resize/spec.md +1 -0
  7. package/specs/027-fix-bottom-modifier-lookup/checklists/requirements.md +38 -0
  8. package/specs/027-fix-bottom-modifier-lookup/contracts/division-lookup-contract.md +51 -0
  9. package/specs/027-fix-bottom-modifier-lookup/data-model.md +43 -0
  10. package/specs/027-fix-bottom-modifier-lookup/plan.md +77 -0
  11. package/specs/027-fix-bottom-modifier-lookup/quickstart.md +36 -0
  12. package/specs/027-fix-bottom-modifier-lookup/research.md +58 -0
  13. package/specs/027-fix-bottom-modifier-lookup/spec.md +105 -0
  14. package/specs/027-fix-bottom-modifier-lookup/tasks.md +167 -0
  15. package/specs/028-unsaved-changes-indicator/checklists/requirements.md +39 -0
  16. package/specs/028-unsaved-changes-indicator/contracts/score-change-contract.md +44 -0
  17. package/specs/028-unsaved-changes-indicator/data-model.md +64 -0
  18. package/specs/028-unsaved-changes-indicator/plan.md +96 -0
  19. package/specs/028-unsaved-changes-indicator/quickstart.md +54 -0
  20. package/specs/028-unsaved-changes-indicator/research.md +68 -0
  21. package/specs/028-unsaved-changes-indicator/spec.md +135 -0
  22. package/specs/028-unsaved-changes-indicator/tasks.md +173 -0
  23. package/specs/029-remove-promise-helpers/checklists/requirements.md +39 -0
  24. package/specs/029-remove-promise-helpers/contracts/public-api-contract.md +32 -0
  25. package/specs/029-remove-promise-helpers/data-model.md +45 -0
  26. package/specs/029-remove-promise-helpers/plan.md +86 -0
  27. package/specs/029-remove-promise-helpers/quickstart.md +53 -0
  28. package/specs/029-remove-promise-helpers/research.md +71 -0
  29. package/specs/029-remove-promise-helpers/spec.md +107 -0
  30. package/specs/029-remove-promise-helpers/tasks.md +164 -0
  31. package/specs/030-copy-paste-voices/checklists/requirements.md +39 -0
  32. package/specs/030-copy-paste-voices/contracts/voice-copy-paste-contract.md +47 -0
  33. package/specs/030-copy-paste-voices/data-model.md +63 -0
  34. package/specs/030-copy-paste-voices/plan.md +80 -0
  35. package/specs/030-copy-paste-voices/quickstart.md +50 -0
  36. package/specs/030-copy-paste-voices/research.md +80 -0
  37. package/specs/030-copy-paste-voices/spec.md +124 -0
  38. package/specs/030-copy-paste-voices/tasks.md +183 -0
  39. package/specs/031-select-voice/checklists/requirements.md +39 -0
  40. package/specs/031-select-voice/contracts/select-voice-contract.md +43 -0
  41. package/specs/031-select-voice/data-model.md +47 -0
  42. package/specs/031-select-voice/plan.md +79 -0
  43. package/specs/031-select-voice/quickstart.md +43 -0
  44. package/specs/031-select-voice/research.md +55 -0
  45. package/specs/031-select-voice/spec.md +113 -0
  46. package/specs/031-select-voice/tasks.md +171 -0
  47. package/specs/032-split-multimeasure-rests/checklists/requirements.md +40 -0
  48. package/specs/032-split-multimeasure-rests/contracts/grouping-contract.md +53 -0
  49. package/specs/032-split-multimeasure-rests/data-model.md +70 -0
  50. package/specs/032-split-multimeasure-rests/plan.md +81 -0
  51. package/specs/032-split-multimeasure-rests/quickstart.md +46 -0
  52. package/specs/032-split-multimeasure-rests/research.md +63 -0
  53. package/specs/032-split-multimeasure-rests/spec.md +127 -0
  54. package/specs/032-split-multimeasure-rests/tasks.md +174 -0
  55. package/specs/033-key-distance-transposition/checklists/requirements.md +35 -0
  56. package/specs/033-key-distance-transposition/contracts/spelling-api.md +36 -0
  57. package/specs/033-key-distance-transposition/data-model.md +49 -0
  58. package/specs/033-key-distance-transposition/plan.md +87 -0
  59. package/specs/033-key-distance-transposition/quickstart.md +40 -0
  60. package/specs/033-key-distance-transposition/research.md +82 -0
  61. package/specs/033-key-distance-transposition/spec.md +132 -0
  62. package/specs/033-key-distance-transposition/tasks.md +139 -0
  63. package/specs/034-smz-compressed-scores/checklists/requirements.md +35 -0
  64. package/specs/034-smz-compressed-scores/contracts/archive-api.md +30 -0
  65. package/specs/034-smz-compressed-scores/data-model.md +48 -0
  66. package/specs/034-smz-compressed-scores/plan.md +89 -0
  67. package/specs/034-smz-compressed-scores/quickstart.md +44 -0
  68. package/specs/034-smz-compressed-scores/research.md +86 -0
  69. package/specs/034-smz-compressed-scores/spec.md +137 -0
  70. package/specs/034-smz-compressed-scores/tasks.md +148 -0
  71. package/specs/035-paste-special/checklists/requirements.md +35 -0
  72. package/specs/035-paste-special/contracts/paste-special-api.md +50 -0
  73. package/specs/035-paste-special/data-model.md +47 -0
  74. package/specs/035-paste-special/plan.md +83 -0
  75. package/specs/035-paste-special/quickstart.md +51 -0
  76. package/specs/035-paste-special/research.md +97 -0
  77. package/specs/035-paste-special/spec.md +170 -0
  78. package/specs/035-paste-special/tasks.md +149 -0
  79. package/specs/036-autosave-recovery/checklists/requirements.md +36 -0
  80. package/specs/036-autosave-recovery/contracts/autosave-api.md +111 -0
  81. package/specs/036-autosave-recovery/data-model.md +70 -0
  82. package/specs/036-autosave-recovery/plan.md +87 -0
  83. package/specs/036-autosave-recovery/quickstart.md +65 -0
  84. package/specs/036-autosave-recovery/research.md +105 -0
  85. package/specs/036-autosave-recovery/spec.md +143 -0
  86. package/specs/036-autosave-recovery/tasks.md +165 -0
  87. package/specs/037-fix-new-part-dialog/checklists/requirements.md +38 -0
  88. package/specs/037-fix-new-part-dialog/contracts/create-part-api.md +84 -0
  89. package/specs/037-fix-new-part-dialog/data-model.md +68 -0
  90. package/specs/037-fix-new-part-dialog/plan.md +83 -0
  91. package/specs/037-fix-new-part-dialog/quickstart.md +58 -0
  92. package/specs/037-fix-new-part-dialog/research.md +86 -0
  93. package/specs/037-fix-new-part-dialog/spec.md +144 -0
  94. package/specs/037-fix-new-part-dialog/tasks.md +174 -0
  95. package/specs/038-per-measure-beam-groups/checklists/requirements.md +36 -0
  96. package/specs/038-per-measure-beam-groups/contracts/beam-groups-api.md +74 -0
  97. package/specs/038-per-measure-beam-groups/data-model.md +75 -0
  98. package/specs/038-per-measure-beam-groups/plan.md +84 -0
  99. package/specs/038-per-measure-beam-groups/quickstart.md +53 -0
  100. package/specs/038-per-measure-beam-groups/research.md +72 -0
  101. package/specs/038-per-measure-beam-groups/spec.md +146 -0
  102. package/specs/038-per-measure-beam-groups/tasks.md +132 -0
  103. package/specs/039-measure-fill-submenu/checklists/requirements.md +35 -0
  104. package/specs/039-measure-fill-submenu/contracts/measure-fill-api.md +56 -0
  105. package/specs/039-measure-fill-submenu/data-model.md +79 -0
  106. package/specs/039-measure-fill-submenu/plan.md +81 -0
  107. package/specs/039-measure-fill-submenu/quickstart.md +62 -0
  108. package/specs/039-measure-fill-submenu/research.md +68 -0
  109. package/specs/039-measure-fill-submenu/spec.md +153 -0
  110. package/specs/039-measure-fill-submenu/tasks.md +121 -0
  111. package/specs/040-dynamics-dialog-cleanup/checklists/requirements.md +36 -0
  112. package/specs/040-dynamics-dialog-cleanup/contracts/dynamics-dialog.md +52 -0
  113. package/specs/040-dynamics-dialog-cleanup/data-model.md +48 -0
  114. package/specs/040-dynamics-dialog-cleanup/plan.md +89 -0
  115. package/specs/040-dynamics-dialog-cleanup/quickstart.md +69 -0
  116. package/specs/040-dynamics-dialog-cleanup/research.md +80 -0
  117. package/specs/040-dynamics-dialog-cleanup/spec.md +120 -0
  118. package/specs/040-dynamics-dialog-cleanup/tasks.md +114 -0
  119. package/specs/041-delete-special/checklists/requirements.md +35 -0
  120. package/specs/041-delete-special/contracts/delete-special-api.md +41 -0
  121. package/specs/041-delete-special/data-model.md +40 -0
  122. package/specs/041-delete-special/plan.md +93 -0
  123. package/specs/041-delete-special/quickstart.md +41 -0
  124. package/specs/041-delete-special/research.md +75 -0
  125. package/specs/041-delete-special/spec.md +136 -0
  126. package/specs/041-delete-special/tasks.md +106 -0
  127. package/src/application/application.ts +475 -459
  128. package/src/application/exports.ts +401 -395
  129. package/src/application/generateVexTests.ts +2 -2
  130. package/src/common/promiseHelpers.ts +2 -2
  131. package/src/render/audio/samples.ts +117 -118
  132. package/src/render/sui/NoteEntryCaret.ts +117 -16
  133. package/src/render/sui/autosave.ts +265 -0
  134. package/src/render/sui/formatter.ts +12 -2
  135. package/src/render/sui/pageDivisions.ts +58 -0
  136. package/src/render/sui/renderState.ts +469 -464
  137. package/src/render/sui/scoreChangeState.ts +67 -0
  138. package/src/render/sui/scoreView.ts +77 -2
  139. package/src/render/sui/scoreViewOperations.ts +363 -37
  140. package/src/render/sui/staffLineGeometry.ts +82 -0
  141. package/src/render/sui/svgPageMap.ts +16 -17
  142. package/src/render/sui/textEdit.ts +310 -311
  143. package/src/render/sui/tracker.ts +40 -0
  144. package/src/render/vex/vxMeasure.ts +22 -8
  145. package/src/render/vex/vxNote.ts +5 -5
  146. package/src/smo/data/measure.ts +58 -1
  147. package/src/smo/data/measureModifiers.ts +81 -1
  148. package/src/smo/data/music.ts +169 -359
  149. package/src/smo/data/note.ts +1 -1
  150. package/src/smo/data/noteModifiers.ts +12 -0
  151. package/src/smo/data/score.ts +167 -2
  152. package/src/smo/data/scoreModifiers.ts +46 -1
  153. package/src/smo/data/systemStaff.ts +43 -0
  154. package/src/smo/xform/beamers.ts +80 -6
  155. package/src/smo/xform/copypaste.ts +511 -51
  156. package/src/smo/xform/measureFill.ts +89 -0
  157. package/src/smo/xform/operations.ts +403 -61
  158. package/src/smo/xform/selections.ts +75 -0
  159. package/src/smo/xform/undo.ts +9 -0
  160. package/src/styles/menus.css +26 -0
  161. package/src/ui/buttons/ribbon.ts +3 -1
  162. package/src/ui/components/buttons/sidebar.vue +15 -6
  163. package/src/ui/components/dialogs/beamGroups.vue +106 -0
  164. package/src/ui/components/dialogs/deleteSpecial.vue +38 -0
  165. package/src/ui/components/dialogs/dynamics.vue +16 -3
  166. package/src/ui/components/dialogs/fileUpload.vue +2 -2
  167. package/src/ui/components/dialogs/hairpin.vue +3 -3
  168. package/src/ui/components/dialogs/library.vue +3 -1
  169. package/src/ui/components/dialogs/newPart.vue +148 -184
  170. package/src/ui/components/dialogs/pasteSpecial.vue +49 -0
  171. package/src/ui/components/dialogs/recovery.vue +66 -0
  172. package/src/ui/components/dialogs/save.vue +11 -4
  173. package/src/ui/components/dialogs/scorePreferences.vue +23 -1
  174. package/src/ui/components/dialogs/slur.vue +6 -6
  175. package/src/ui/components/dialogs/tempo.vue +11 -3
  176. package/src/ui/components/dialogs/timeSignature.vue +5 -0
  177. package/src/ui/components/dialogs/unsavedChanges.vue +44 -0
  178. package/src/ui/components/dialogs/volta.vue +3 -3
  179. package/src/ui/dialogs/adapter.ts +181 -183
  180. package/src/ui/dialogs/addMeasure.ts +97 -97
  181. package/src/ui/dialogs/annotationVue.ts +56 -56
  182. package/src/ui/dialogs/audioSettings.ts +121 -123
  183. package/src/ui/dialogs/beamGroupsVue.ts +69 -0
  184. package/src/ui/dialogs/chordChangeVue.ts +46 -46
  185. package/src/ui/dialogs/clefChange.ts +53 -53
  186. package/src/ui/dialogs/createPartHelpers.ts +68 -0
  187. package/src/ui/dialogs/customTuplets.ts +95 -96
  188. package/src/ui/dialogs/customTupletsVue.ts +47 -47
  189. package/src/ui/dialogs/deleteSpecial.ts +57 -0
  190. package/src/ui/dialogs/dialog.ts +627 -620
  191. package/src/ui/dialogs/durations.ts +34 -34
  192. package/src/ui/dialogs/dynamicsVue.ts +87 -60
  193. package/src/ui/dialogs/factory.ts +196 -198
  194. package/src/ui/dialogs/fileDialogs.ts +286 -179
  195. package/src/ui/dialogs/fonts.ts +93 -93
  196. package/src/ui/dialogs/globalLayout.ts +40 -40
  197. package/src/ui/dialogs/gracenote.ts +31 -31
  198. package/src/ui/dialogs/hairpin.ts +108 -110
  199. package/src/ui/dialogs/hairpinVue.ts +51 -51
  200. package/src/ui/dialogs/instrument.ts +119 -112
  201. package/src/ui/dialogs/keySignature.ts +175 -176
  202. package/src/ui/dialogs/keySignatureVue.ts +47 -47
  203. package/src/ui/dialogs/library.ts +207 -207
  204. package/src/ui/dialogs/libraryVue.ts +62 -48
  205. package/src/ui/dialogs/lyricVue.ts +46 -46
  206. package/src/ui/dialogs/measureFormat.ts +78 -78
  207. package/src/ui/dialogs/microtones.ts +147 -147
  208. package/src/ui/dialogs/noteHead.ts +319 -319
  209. package/src/ui/dialogs/pageLayout.ts +61 -61
  210. package/src/ui/dialogs/partInfo.ts +60 -60
  211. package/src/ui/dialogs/pasteSpecial.ts +59 -0
  212. package/src/ui/dialogs/pedalMarking.ts +117 -117
  213. package/src/ui/dialogs/pedalMarkingVue.ts +73 -73
  214. package/src/ui/dialogs/pitch.ts +352 -352
  215. package/src/ui/dialogs/preferences.ts +1 -0
  216. package/src/ui/dialogs/recovery.ts +49 -0
  217. package/src/ui/dialogs/rehearsalMark.ts +64 -64
  218. package/src/ui/dialogs/rehearsalMarkVue.ts +57 -57
  219. package/src/ui/dialogs/scoreId.ts +35 -36
  220. package/src/ui/dialogs/scoreView.ts +42 -42
  221. package/src/ui/dialogs/slur.ts +308 -310
  222. package/src/ui/dialogs/slurVue.ts +91 -91
  223. package/src/ui/dialogs/staffGroup.ts +112 -112
  224. package/src/ui/dialogs/tabNote.ts +84 -84
  225. package/src/ui/dialogs/tabStave.ts +182 -182
  226. package/src/ui/dialogs/tempo.ts +261 -263
  227. package/src/ui/dialogs/tempoVue.ts +73 -73
  228. package/src/ui/dialogs/textBlockVue.ts +127 -127
  229. package/src/ui/dialogs/textBracket.ts +114 -116
  230. package/src/ui/dialogs/textBracketVue.ts +56 -56
  231. package/src/ui/dialogs/tie.ts +140 -142
  232. package/src/ui/dialogs/timeSignature.ts +65 -66
  233. package/src/ui/dialogs/transposeScore.ts +39 -39
  234. package/src/ui/dialogs/unsavedChanges.ts +43 -0
  235. package/src/ui/dialogs/volta.ts +120 -122
  236. package/src/ui/dialogs/voltaVue.ts +51 -51
  237. package/src/ui/fileio/fileInput.ts +12 -3
  238. package/src/ui/fileio/library.ts +110 -111
  239. package/src/ui/fileio/scoreArchive.ts +151 -0
  240. package/src/ui/fileio/xhrLoader.ts +26 -0
  241. package/src/ui/i18n/language.ts +1 -1
  242. package/src/ui/menus/beams.ts +181 -112
  243. package/src/ui/menus/edit.ts +143 -6
  244. package/src/ui/menus/file.ts +40 -4
  245. package/src/ui/menus/measure.ts +40 -1
  246. package/tests/autosave.ts +332 -0
  247. package/tests/beamDotted.ts +56 -0
  248. package/tests/beamGroups.ts +338 -0
  249. package/tests/createPart.ts +292 -0
  250. package/tests/deleteSpecial.ts +350 -0
  251. package/tests/dynamicsFontSize.ts +132 -0
  252. package/tests/keyDistanceTransposition.ts +351 -0
  253. package/tests/measureFill.ts +295 -0
  254. package/tests/movePart.ts +94 -0
  255. package/tests/multimeasureRest.ts +338 -0
  256. package/tests/pageDivisions.ts +156 -0
  257. package/tests/pasteIntoMeasure.ts +103 -0
  258. package/tests/pasteSpecial.ts +541 -0
  259. package/tests/promiseHelpersUsage.ts +142 -0
  260. package/tests/quickBeam.ts +126 -0
  261. package/tests/scoreArchive.ts +218 -0
  262. package/tests/scoreChangeState.ts +104 -0
  263. package/tests/selectVoice.ts +189 -0
  264. package/tests/staffLineGeometry.ts +179 -0
  265. package/tests/timeSignatureDisplay.ts +58 -0
  266. package/tests/voiceCopyPaste.ts +417 -0
  267. package/tools/smoosic-schema.json +37 -0
  268. package/typedoc.ts +1 -1
  269. package/types/src/application/exports.d.ts +453 -447
  270. package/types/src/common/promiseHelpers.d.ts +30 -30
  271. package/types/src/common/vex.d.ts +224 -224
  272. package/types/src/render/sui/NoteEntryCaret.d.ts +107 -107
  273. package/types/src/render/sui/autosave.d.ts +99 -0
  274. package/types/src/render/sui/scoreView.d.ts +23 -0
  275. package/types/src/render/sui/scoreViewOperations.d.ts +759 -639
  276. package/types/src/render/sui/svgHelpers.d.ts +88 -88
  277. package/types/src/render/sui/svgPageMap.d.ts +344 -344
  278. package/types/src/render/sui/textEdit.d.ts +96 -96
  279. package/types/src/render/sui/textRender.d.ts +199 -199
  280. package/types/src/render/vex/smoAdapter.d.ts +47 -47
  281. package/types/src/render/vex/vxMeasure.d.ts +97 -97
  282. package/types/src/render/vex/vxNote.d.ts +56 -56
  283. package/types/src/render/vex/vxSystem.d.ts +71 -71
  284. package/types/src/smo/data/measure.d.ts +30 -0
  285. package/types/src/smo/data/measureModifiers.d.ts +568 -513
  286. package/types/src/smo/data/music.d.ts +74 -32
  287. package/types/src/smo/data/note.d.ts +498 -498
  288. package/types/src/smo/data/noteModifiers.d.ts +615 -606
  289. package/types/src/smo/data/score.d.ts +476 -421
  290. package/types/src/smo/data/scoreModifiers.d.ts +30 -0
  291. package/types/src/smo/data/scoreText.d.ts +334 -334
  292. package/types/src/smo/data/systemStaff.d.ts +14 -0
  293. package/types/src/smo/xform/beamers.d.ts +23 -1
  294. package/types/src/smo/xform/copypaste.d.ts +138 -2
  295. package/types/src/smo/xform/measureFill.d.ts +21 -0
  296. package/types/src/smo/xform/operations.d.ts +245 -129
  297. package/types/src/smo/xform/selections.d.ts +154 -154
  298. package/types/src/smo/xform/undo.d.ts +142 -142
  299. package/types/src/ui/buttons/button.d.ts +100 -100
  300. package/types/src/ui/buttons/ribbon.d.ts +70 -70
  301. package/types/src/ui/common.d.ts +76 -76
  302. package/types/src/ui/components/dialogs/chordText.d.ts +28 -28
  303. package/types/src/ui/components/dialogs/textBlockAtomNode.d.ts +20 -20
  304. package/types/src/ui/components/dialogs/textGroupHtml.d.ts +29 -29
  305. package/types/src/ui/composable/draggable.d.ts +15 -15
  306. package/types/src/ui/dialogs/adapter.d.ts +120 -120
  307. package/types/src/ui/dialogs/annotationVue.d.ts +9 -9
  308. package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
  309. package/types/src/ui/dialogs/beamGroupsVue.d.ts +20 -0
  310. package/types/src/ui/dialogs/chordChangeVue.d.ts +8 -8
  311. package/types/src/ui/dialogs/createPartHelpers.d.ts +29 -0
  312. package/types/src/ui/dialogs/customTupletsVue.d.ts +9 -9
  313. package/types/src/ui/dialogs/deleteSpecial.d.ts +8 -0
  314. package/types/src/ui/dialogs/dialog.d.ts +203 -203
  315. package/types/src/ui/dialogs/dynamicsVue.d.ts +10 -10
  316. package/types/src/ui/dialogs/factory.d.ts +15 -15
  317. package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
  318. package/types/src/ui/dialogs/hairpin.d.ts +35 -35
  319. package/types/src/ui/dialogs/hairpinVue.d.ts +7 -7
  320. package/types/src/ui/dialogs/instrument.d.ts +3 -3
  321. package/types/src/ui/dialogs/keySignatureVue.d.ts +7 -7
  322. package/types/src/ui/dialogs/libraryVue.d.ts +15 -15
  323. package/types/src/ui/dialogs/lyricVue.d.ts +8 -8
  324. package/types/src/ui/dialogs/pasteSpecial.d.ts +8 -0
  325. package/types/src/ui/dialogs/pedalMarkingVue.d.ts +7 -7
  326. package/types/src/ui/dialogs/recovery.d.ts +8 -0
  327. package/types/src/ui/dialogs/rehearsalMark.d.ts +25 -25
  328. package/types/src/ui/dialogs/rehearsalMarkVue.d.ts +7 -7
  329. package/types/src/ui/dialogs/slur.d.ts +57 -57
  330. package/types/src/ui/dialogs/slurVue.d.ts +7 -7
  331. package/types/src/ui/dialogs/tempo.d.ts +50 -50
  332. package/types/src/ui/dialogs/tempoVue.d.ts +10 -10
  333. package/types/src/ui/dialogs/textBlockVue.d.ts +8 -8
  334. package/types/src/ui/dialogs/textBracket.d.ts +35 -35
  335. package/types/src/ui/dialogs/textBracketVue.d.ts +7 -7
  336. package/types/src/ui/dialogs/tie.d.ts +41 -41
  337. package/types/src/ui/dialogs/volta.d.ts +40 -40
  338. package/types/src/ui/dialogs/voltaVue.d.ts +7 -7
  339. package/types/src/ui/fileio/fileInput.d.ts +7 -1
  340. package/types/src/ui/fileio/library.d.ts +40 -40
  341. package/types/src/ui/fileio/scoreArchive.d.ts +55 -0
  342. package/types/src/ui/fileio/xhrLoader.d.ts +7 -0
  343. package/types/src/ui/menus/file.d.ts +8 -8
  344. package/types/src/ui/menus/language.d.ts +7 -7
  345. package/types/src/ui/menus/manager.d.ts +58 -58
  346. package/types/src/ui/menus/menu.d.ts +159 -159
  347. package/types/src/ui/menus/partSelection.d.ts +14 -14
  348. package/types/src/ui/menus/score.d.ts +8 -8
  349. package/types/src/ui/menus/staffModifier.d.ts +17 -17
  350. package/types/typedoc.d.ts +147 -147
  351. package/src/ui/dialogs/dynamics.ts +0 -143
  352. package/types/src/ui/dialogs/dynamics.d.ts +0 -37
@@ -0,0 +1,40 @@
1
+ # Data Model: Delete Special for Note Attachments
2
+
3
+ No new stored data. These are the in-memory types and the exact rule for each kind.
4
+
5
+ ## `DeleteAttributeKind` (`src/smo/xform/operations.ts`)
6
+
7
+ ```text
8
+ 'dynamics' | 'lyrics' | 'annotations' | 'chords' | 'articulations'
9
+ | 'ornaments' | 'graceNotes' | 'arpeggios' | 'microtones'
10
+ ```
11
+
12
+ `SmoOperation.deleteAttributeKinds: DeleteAttributeKind[]` lists all nine, in this order. The dialog and the tests use it, so there is one list.
13
+
14
+ ## What each kind removes from a `SmoNote`
15
+
16
+ | Kind | Count (how many markings) | Clear |
17
+ |------|---------------------------|-------|
18
+ | `dynamics` | `textModifiers` of type `SmoDynamicText` | remove them from `textModifiers` |
19
+ | `lyrics` | `textModifiers` of type `SmoLyric` with parser `lyric` | remove them (every verse) |
20
+ | `annotations` | `SmoLyric` with parser `annotation` | remove them |
21
+ | `chords` | `SmoLyric` with parser `chord` | remove them |
22
+ | `articulations` | `articulations.length` | `articulations = []` |
23
+ | `ornaments` | `ornaments.length` | `ornaments = []` |
24
+ | `graceNotes` | `graceNotes.length` | `graceNotes = []` |
25
+ | `arpeggios` | 1 if `arpeggio` is set, else 0 | `arpeggio = undefined` |
26
+ | `microtones` | `tones.length` | `tones = []` |
27
+
28
+ Everything else in `textModifiers` (other kinds, and other parsers) is kept in its original order. The note's `pitches`, `tickCount`, `noteType`, ties, beam and voice fields are never read or written.
29
+
30
+ ## Rules
31
+
32
+ 1. **Isolation**: clearing one kind changes none of the other eight. In particular the three `SmoLyric` kinds are separated by `parser` only.
33
+ 2. **Idempotence**: a second delete with the same kinds counts 0 and changes nothing.
34
+ 3. **Scope**: only the notes of the selections passed in are read or changed. A selection without a note (`selection.note` is null) is skipped.
35
+ 4. **Empty kinds**: an empty list counts 0 and removes nothing.
36
+ 5. **Unknown kinds** in the list (a library caller passing a bad string) are ignored; the known ones in the same list still apply.
37
+
38
+ ## State transitions
39
+
40
+ `note with markings` --delete(kinds)--> `same note without markings of those kinds`. The score is then the same as one that was built without them; saving and reloading gives that note.
@@ -0,0 +1,93 @@
1
+ # Implementation Plan: Delete Special for Note Attachments
2
+
3
+ **Branch**: `041-delete-special` (work is on `main`; no feature branch was created) | **Date**: 2026-11-16 | **Spec**: [spec.md](spec.md)
4
+
5
+ **Input**: Feature specification from `/specs/041-delete-special/spec.md`
6
+
7
+ ## Summary
8
+
9
+ Add **Delete Special...** to the Edit menu. It opens a dialog with nine unticked checkboxes (dynamics, lyrics, annotations, chords, articulations, ornaments, grace notes, arpeggios, microtones). On confirm, the ticked kinds are removed from every selected note, as one undo step. Nothing else about the notes changes.
10
+
11
+ The work is in three small layers, the same layers Paste Special uses:
12
+
13
+ 1. **Model** (`src/smo/xform/operations.ts`): a kind type, the list of kinds, and two static functions on `SmoOperation`: one that counts the markings of the chosen kinds on some selections, and one that removes them. No UI imports, so it can be tested headless.
14
+ 2. **View** (`scoreViewOperations.ts`): `deleteNoteAttributes(kinds)` does nothing if no kind is chosen or the selected notes have none of them; otherwise it runs the removal through `modifyCurrentSelections`, which takes the undo snapshot, edits the displayed score and the backing score, redraws the changed measures, and is one undo step.
15
+ 3. **UI**: a small Vue dialog (`deleteSpecial.vue`) and creation function (`deleteSpecial.ts`) modelled on Paste Special, and a menu entry next to Paste Special.
16
+
17
+ No file format change: nothing new is stored. The result of a delete is an ordinary note with fewer attachments.
18
+
19
+ ## Technical Context
20
+
21
+ **Language/Version**: TypeScript; Vue 3 single-file component for the dialog. Tests run with `ts-node`.
22
+
23
+ **Primary Dependencies**: None new. Reuses `InstallDialog`, `dialogContainer.vue`, `toggle.vue`, `SuiScoreViewOperations.modifyCurrentSelections`, `SmoLyric.parsers`.
24
+
25
+ **Storage**: No change. Removed markings are simply absent from the next save.
26
+
27
+ **Testing**: Headless `ts-node` script `tests/deleteSpecial.ts` (npm script `test:delete-special`): each kind, mixed kinds, lyrics/annotations/chords independence, notes without the kinds, selections across measures, staves and voices, rests, the count function, and a serialize and reload of the result. The view's undo wiring is `modifyCurrentSelections`, already shared with other edits; it is checked by `tsc` and the manual steps in [quickstart.md](quickstart.md), since `scoreViewOperations` needs the DOM. A `.vue` file cannot be loaded by `ts-node`, so the component is checked by compiling it with `@vue/compiler-sfc`. The constitution says rendering and UI need not be tested.
28
+
29
+ **Target Platform**: Browser application and library.
30
+
31
+ **Project Type**: Single project.
32
+
33
+ **Performance Goals**: One pass over the selected notes; one redraw of the changed measures. A 16-measure selection is the same cost as any other edit of that size.
34
+
35
+ **Constraints**: Only the nine kinds are removable, and each means exactly its name (spec FR-005 to FR-011). The smo layer must not import UI code.
36
+
37
+ **Scale/Scope**: Two static functions and a type in `operations.ts`, one view method, one dialog function, one Vue component, one menu option, a few export lines, one test file.
38
+
39
+ ## Constitution Check
40
+
41
+ *GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
42
+
43
+ | Principle | Assessment |
44
+ |-----------|------------|
45
+ | #1 Serialization | Pass. No new persisted field. A test serializes and reloads a score after a delete and checks the removed markings are gone and the rest is identical. Scores saved before this feature need no handling. |
46
+ | #2 Editing and transformation logic regression tested | Pass. `SmoOperation.deleteNoteAttributes` and `countNoteAttributes` are headless-tested for every kind and for the cases in the spec. |
47
+ | #3 Rendering performance | Pass. The edit goes through `modifyCurrentSelections`, which redraws only the changed measures once. |
48
+ | #4 Logical dependencies | Pass. The removal logic is in `src/smo/xform` with no UI imports. The dialog and menu are in `src/ui`. |
49
+
50
+ Re-check after Phase 1 design: still passes. No complexity violations.
51
+
52
+ ## Project Structure
53
+
54
+ ### Documentation (this feature)
55
+
56
+ ```text
57
+ specs/041-delete-special/
58
+ ├── plan.md # This file
59
+ ├── research.md # Phase 0 output
60
+ ├── data-model.md # Phase 1 output
61
+ ├── quickstart.md # Phase 1 output
62
+ ├── contracts/
63
+ │ └── delete-special-api.md # Phase 1 output
64
+ ├── checklists/
65
+ │ └── requirements.md
66
+ └── tasks.md # Phase 2 output (/speckit-tasks - NOT created by /speckit-plan)
67
+ ```
68
+
69
+ ### Source Code (repository root)
70
+
71
+ ```text
72
+ src/smo/xform/operations.ts # DeleteAttributeKind, SmoOperation.deleteAttributeKinds, countNoteAttributes(), deleteNoteAttributes()
73
+ src/render/sui/scoreViewOperations.ts # deleteNoteAttributes(kinds)
74
+ src/ui/dialogs/deleteSpecial.ts # NEW: SuiDeleteSpecialDialog
75
+ src/ui/components/dialogs/deleteSpecial.vue # NEW: nine toggles, confirm enabled once one is on
76
+ src/ui/menus/edit.ts # "Delete Special..." option after Paste Special
77
+ src/application/exports.ts # import, export * and list entry for the dialog
78
+ typedoc.ts # export of the new dialog module
79
+ types/src/smo/xform/operations.d.ts # hand-edited declarations
80
+ types/src/render/sui/scoreViewOperations.d.ts # hand-edited declaration
81
+ types/src/ui/dialogs/deleteSpecial.d.ts # NEW declaration
82
+ types/src/application/exports.d.ts # the same three references
83
+ types/typedoc.d.ts # the new export
84
+ tests/deleteSpecial.ts # NEW
85
+ package.json # test:delete-special script
86
+ changes.md # changelog entry
87
+ ```
88
+
89
+ **Structure Decision**: Single-project layout as it exists. The removal logic sits with the other selection operations in `SmoOperation`; the dialog copies the shape of `SuiPasteSpecialDialog`, which the Edit menu already uses.
90
+
91
+ ## Complexity Tracking
92
+
93
+ No constitution violations to justify.
@@ -0,0 +1,41 @@
1
+ # Quickstart: Delete Special
2
+
3
+ Validation guide. Details of the types are in the [contract](contracts/delete-special-api.md) and the [data model](data-model.md).
4
+
5
+ ## 1. Automated checks
6
+
7
+ ```text
8
+ npx tsc --noEmit -p .
9
+ npm run test:delete-special
10
+ ```
11
+
12
+ Expected: no compiler errors, and every check in `tests/deleteSpecial.ts` prints `PASS`. The checks cover:
13
+
14
+ - D1-D9: each kind on its own removes that kind's markings and leaves the other eight (and the pitches and durations) alone.
15
+ - L1-L3: lyrics (two verses), annotations and chords on one note; deleting each one alone leaves the other two.
16
+ - M1: several kinds ticked at once.
17
+ - N1-N2: a note with none of the ticked kinds is unchanged; deleting a second time counts 0.
18
+ - S1-S4: a selection of one note, of a run, across measures and staves, and one that stops inside a measure; unselected notes keep their markings.
19
+ - R1: rests with a dynamic and an annotation.
20
+ - C1-C3: `countNoteAttributes` for no kinds, for unknown kinds, and equal to what was added.
21
+ - P1: serialize (full form) and reload after a delete; the markings are gone and the notes are the same.
22
+
23
+ ## 2. The dialog component compiles
24
+
25
+ Compile `src/ui/components/dialogs/deleteSpecial.vue` with `@vue/compiler-sfc` (parse errors 0, compiles).
26
+
27
+ ## 3. Search proves the wiring
28
+
29
+ - `SuiDeleteSpecialDialog` is imported in `src/ui/menus/edit.ts` and exported from `src/application/exports.ts` and `typedoc.ts`.
30
+ - `deleteNoteAttributes` is declared in `types/src/render/sui/scoreViewOperations.d.ts` and `types/src/smo/xform/operations.d.ts`.
31
+
32
+ ## 4. Manual walkthrough (in the running app)
33
+
34
+ 1. Open a score. Give four notes in a measure a dynamic, a lyric, an annotation, a chord symbol, an articulation and an ornament. Add a grace note, an arpeggio and a microtone to some of them.
35
+ 2. Select the whole measure. Choose **Edit > Delete Special...**. The nine boxes are unticked and the confirm button is disabled.
36
+ 3. Tick **Dynamics** only and confirm. The dynamics disappear; everything else is still there. Press Undo: the dynamics return.
37
+ 4. Open the dialog again, tick **Lyrics** and confirm. The lyrics go; the annotation and chord symbol stay. Repeat for **Annotations** and for **Chords**, undoing each time.
38
+ 5. Tick **Grace Notes**, **Arpeggios** and **Microtones** together and confirm. All three are gone, the measure is redrawn with correct spacing, and the notes' pitches and rhythm are unchanged. One Undo restores all three.
39
+ 6. Open the dialog, tick a kind and Cancel. Nothing changes. Open it, tick a kind the selection does not have, and confirm: nothing changes and Undo still undoes your previous edit, not a no-op.
40
+ 7. Select two measures in two staves and delete **Dynamics**. Both staves lose them in the selected measures only.
41
+ 8. Save the score and reopen it. The deleted markings are still gone.
@@ -0,0 +1,75 @@
1
+ # Research: Delete Special for Note Attachments
2
+
3
+ All unknowns from the Technical Context are resolved below. No `NEEDS CLARIFICATION` items remain.
4
+
5
+ ## R1: Where each kind lives on a note
6
+
7
+ **Finding** (`src/smo/data/note.ts`, `src/smo/xform/copypaste.ts`):
8
+
9
+ | Kind | Stored as | Existing way to clear it |
10
+ |------|-----------|--------------------------|
11
+ | dynamics | `note.textModifiers` entries whose `attrs.type` is `SmoDynamicText` | none for all at once; Paste Special filters the list |
12
+ | lyrics | `textModifiers` entries of type `SmoLyric` with `parser === SmoLyric.parsers.lyric` (one per verse) | Paste Special's `removeLyricsOfParser` (file-private) |
13
+ | annotations | `SmoLyric` with `parser === SmoLyric.parsers.annotation` | `note.removeAllAnnotations()` |
14
+ | chords | `SmoLyric` with `parser === SmoLyric.parsers.chord` | `removeLyricsOfParser` (file-private) |
15
+ | articulations | `note.articulations` | `note.clearArticulations()` |
16
+ | ornaments | `note.ornaments` | none; Paste Special assigns `[]` |
17
+ | grace notes | `note.graceNotes` | `removeGraceNote(offset)` one at a time |
18
+ | arpeggios | `note.arpeggio` (one, or `undefined`) | `addRemoveArpeggio('none')` sets `undefined` |
19
+ | microtones | `note.tones` | `note.removeMicrotone()` sets `[]` |
20
+
21
+ Lyrics, annotations and chords share one list and one class, told apart by `parser`. Each must be filtered by parser, so one never removes another.
22
+
23
+ **Decision**: A small table in `operations.ts`, one entry per kind, each with a `count(note)` and a `clear(note)`. It writes the same fields the existing methods write.
24
+
25
+ **Rationale**: The nine rules are in one place, are easy to test, and each is one line. Paste Special has an equivalent table for its six kinds, but it also pastes, and it is file-private; sharing it would couple a delete to the paste code. The three text kinds use the same parser filter either way.
26
+
27
+ **Alternatives considered**: Adding `clearDynamics()`, `clearLyrics()` and so on to `SmoNote` (more public API and declaration churn for one caller); reusing `pasteAttributeHandlers` (private, has `paste`, covers six kinds only).
28
+
29
+ ## R2: How the edit is applied, undone and redrawn
30
+
31
+ **Finding**: `SuiScoreViewOperations.modifyCurrentSelections(label, actor)` takes the undo snapshot of the selected measures (`undoTrackerMeasureSelections`), runs the actor on the displayed score and on the backing score (`storeScore`, through the equivalent selections), re-renders the changed measures and waits. `addRemoveArpeggio`, `setNoteHead` and `setBeamGroups` use it. It is one undo step.
32
+
33
+ **Decision**: `deleteNoteAttributes(kinds)` calls `modifyCurrentSelections('delete special', (score, selections) => SmoOperation.deleteNoteAttributes(selections, kinds))`.
34
+
35
+ **Rationale**: Same path as the other note edits, so undo, the backing score and redraw behave as users already expect. Selections are the tracker's current selections, which always include the note under the cursor, and rests are selections like notes.
36
+
37
+ ## R3: "No undo step when nothing changes"
38
+
39
+ **Finding**: `modifyCurrentSelections` takes its snapshot before it runs the actor, so a no-op would still leave an undo step.
40
+
41
+ **Decision**: Before calling it, the view method checks `SmoOperation.countNoteAttributes(selections, kinds)`. If no kind is ticked or the count is 0, it returns without touching the score, the undo stack or the renderer.
42
+
43
+ **Rationale**: Meets spec FR-014 and the edge case for notes with none of the ticked kinds, with a read-only pre-pass that costs one loop.
44
+
45
+ ## R4: Grace notes, arpeggios and microtones when removed
46
+
47
+ **Finding**: Grace notes take no time in the measure, so removing them does not change durations or ticks. Arpeggio and microtone are display and sound properties of the note. The renderer rebuilds the changed measures from the note data.
48
+
49
+ **Decision**: No special handling beyond clearing the fields. The measure redraw in `modifyCurrentSelections` picks up spacing changes.
50
+
51
+ **Rationale**: Matches spec FR-015 and the edge case on grace notes.
52
+
53
+ ## R5: Dialog
54
+
55
+ **Finding**: `pasteSpecial.vue` is a `dialogContainer` with a `toggle` per kind and an `enable` flag that turns confirm on once something is chosen; `SuiPasteSpecialDialog` builds a reactive `selected` record and calls the view on commit. `toggle` takes `domId`, `label`, `initialValue` and `changeCb`.
56
+
57
+ **Decision**: Copy that shape for `deleteSpecial.vue` and `SuiDeleteSpecialDialog`, with nine toggles, all off, and no replace/add toggle. The kind labels come from one record in the dialog file. Confirm is disabled until a kind is on. Cancel does nothing.
58
+
59
+ **Rationale**: The same look and keyboard behaviour as Paste Special, and the least new code. Because nothing is changed until confirm, cancel needs no undo.
60
+
61
+ **Alternatives considered**: Extending `pasteSpecial.vue` with a "delete" mode (mixes two commands, and the replace toggle has no meaning for delete).
62
+
63
+ ## R6: Menu placement
64
+
65
+ **Decision**: Add `deleteSpecialMenuOption` to `src/ui/menus/edit.ts`, right after `pasteSpecialMenuOption` in the exported option list, with `display` always true. Its dialog parameters follow Paste Special (`ctor: 'SuiDeleteSpecialDialog'`, `id: 'deleteSpecial'`, `modifier: null`).
66
+
67
+ **Rationale**: The spec says to place it next to Paste Special and that the command is always available (a selection always exists).
68
+
69
+ ## R7: Exports and declarations
70
+
71
+ **Decision**: Export the new dialog from `src/application/exports.ts` the way `SuiPasteSpecialDialog` is (import, `export *`, list entry) and from the root `typedoc.ts`. Hand-edit the declarations in `types/` for the new and changed members; `npm run types` is not used because it rewrites unrelated files. `SuiDeleteSpecialDialog` is not added to the translation `allDialogs` list: Paste Special is not in it either, and the Vue dialogs use English labels.
72
+
73
+ ## R8: Tests
74
+
75
+ **Decision**: `tests/deleteSpecial.ts` builds scores with the same helpers as `tests/pasteSpecial.ts` (default score, quarter notes, the dynamic-constructor registration) and checks the cases in [quickstart.md](quickstart.md) against `SmoOperation` directly. A save and reload uses the full-form serializer, as in `tests/dynamicsFontSize.ts`.
@@ -0,0 +1,136 @@
1
+ # Feature Specification: Delete Special for Note Attachments
2
+
3
+ **Feature Branch**: `041-delete-special`
4
+
5
+ **Created**: 2026-11-16
6
+
7
+ **Status**: Draft
8
+
9
+ **Input**: User description: "create a 'delete special' similar to paste special. You can delete specific SmoNote modifiers attached to notes: dynamics, lyrics, annotations, articulations, ornaments, grace notes, arpeggios, microtones."
10
+
11
+ ## Clarifications
12
+
13
+ ### Session 2026-11-16
14
+
15
+ - Q: Should Delete Special also remove chord symbols and annotations? → A: Yes, include both. Annotations were already in the list; chord symbols are added as a ninth kind, matching Paste Special. Lyrics, annotations and chord symbols are three separate checkboxes.
16
+
17
+ ## User Scenarios & Testing *(mandatory)*
18
+
19
+ ### User Story 1 - Remove only chosen kinds of markings from the selected notes (Priority: P1)
20
+
21
+ A composer or arranger has a passage with dynamics, lyrics, articulations and other markings on its notes, and wants to strip some of them (for example, all the dynamics and articulations, to start again) without touching the music itself. They select the notes, choose **Delete Special...** from the Edit menu, and a dialog lists the kinds of markings that can be removed, each with a checkbox. They tick the kinds they want gone and confirm. Those markings disappear from every selected note. The pitches, rhythms and rests, and every kind that was not ticked, are exactly as before.
22
+
23
+ **Why this priority**: This is the whole point of the feature. Today the only way to clear markings is to remove them one note and one kind at a time, or to delete the notes and re-enter them.
24
+
25
+ **Independent Test**: In a measure of four notes, give each note a dynamic, a lyric and an articulation. Select the whole measure, open Delete Special, tick only Dynamics, and confirm. No note has a dynamic any more; every note still has its lyric and articulation, and the pitches and durations are unchanged.
26
+
27
+ **Acceptance Scenarios**:
28
+
29
+ 1. **Given** selected notes that carry markings, **When** the user chooses Delete Special from the Edit menu, **Then** a dialog appears with a checkbox for each of: dynamics, lyrics, annotations, chords, articulations, ornaments, grace notes, arpeggios and microtones, none of them ticked.
30
+ 2. **Given** the dialog is open, **When** the user ticks one or more kinds and confirms, **Then** every marking of those kinds is removed from every selected note, and nothing else about the notes changes.
31
+ 3. **Given** the dialog is open, **When** the user ticks nothing and confirms, **Then** the score is not changed (and no undo step is recorded).
32
+ 4. **Given** the dialog is open, **When** the user cancels, **Then** the score is not changed.
33
+ 5. **Given** a Delete Special that removed markings, **When** the user chooses Undo once, **Then** all the removed markings are restored together.
34
+
35
+ ---
36
+
37
+ ### User Story 2 - The right markings are removed, and only those (Priority: P1)
38
+
39
+ Several of the kinds are stored in similar ways (lyrics, annotations and chords are all text attached to a note; a grace note is a small note attached to a note). The user needs each checkbox to mean exactly what its name says, so that removing one kind never removes another.
40
+
41
+ **Why this priority**: A delete that takes more than it says is data loss, so this is as important as the command itself.
42
+
43
+ **Independent Test**: Give one note a lyric in two verses, an annotation, and a chord symbol. Delete only Lyrics. Both verses' lyrics are gone; the annotation and the chord symbol remain. Repeat with only Annotations: the annotation is gone; the lyrics and chord symbol remain.
44
+
45
+ **Acceptance Scenarios**:
46
+
47
+ 1. **Given** a note with lyrics in several verses, an annotation and a chord symbol, **When** the user deletes Lyrics, **Then** the lyrics of every verse are removed and the annotation and chord symbol remain.
48
+ 2. **Given** the same note, **When** the user deletes Annotations, **Then** the annotation is removed and the lyrics and chord symbol remain.
49
+ 3. **Given** the same note, **When** the user deletes Chords, **Then** the chord symbol is removed and the lyrics and annotation remain.
50
+ 4. **Given** a note with a dynamic, several articulations and several ornaments, **When** the user deletes Articulations, **Then** all the articulations are removed and the dynamic and ornaments remain; likewise for Ornaments and Dynamics.
51
+ 5. **Given** a note with grace notes, **When** the user deletes Grace Notes, **Then** all of the note's grace notes are removed and the note's own pitches and duration are unchanged.
52
+ 6. **Given** a note with an arpeggio, **When** the user deletes Arpeggios, **Then** the arpeggio is removed.
53
+ 7. **Given** a note (or a chord) with microtones, **When** the user deletes Microtones, **Then** all the microtones are removed and the note keeps its pitches, as they were before the microtone was applied.
54
+ 8. **Given** a note that has none of the ticked kinds, **When** the user confirms, **Then** that note is unchanged and no error is shown.
55
+
56
+ ---
57
+
58
+ ### User Story 3 - Work on any selection, in any number of staves and voices (Priority: P2)
59
+
60
+ The user may select one note, a run of notes, several measures, or notes in several staves. Delete Special applies to everything that is selected, and to nothing outside the selection.
61
+
62
+ **Why this priority**: It makes the command useful on whole passages, and keeps it safe.
63
+
64
+ **Independent Test**: In a two-staff score with dynamics throughout, select measures 2 and 3 in both staves, delete Dynamics. Measures 2 and 3 of both staves have no dynamics; measures 1 and 4 still have theirs.
65
+
66
+ **Acceptance Scenarios**:
67
+
68
+ 1. **Given** a selection of one note, **When** the user deletes a kind, **Then** only that note is affected.
69
+ 2. **Given** a selection spanning several measures and several staves, **When** the user deletes a kind, **Then** every selected note in every selected staff and measure is affected, and no unselected note is.
70
+ 3. **Given** a measure with more than one voice and a selection in that measure, **When** the user deletes a kind, **Then** the notes of the selected voices are affected, in the same way an ordinary edit applies to a selection.
71
+ 4. **Given** selected rests that carry markings (such as a dynamic or an annotation), **When** the user deletes those kinds, **Then** the markings are removed from the rests too.
72
+ 5. **Given** a Delete Special on a large selection (16 measures), **When** it is confirmed, **Then** the score redraws once the change is complete, with no error, and a single Undo restores everything.
73
+
74
+ ---
75
+
76
+ ### Edge Cases
77
+
78
+ - What happens when nothing is selected? The command always has at least the note under the cursor, so a selection exists. If there is truly none, the command does nothing and reports nothing.
79
+ - What if the selected notes carry none of the ticked kinds? Nothing changes, there is no error, and (as for nothing ticked) no undo step is left behind that restores identical content.
80
+ - What if grace notes are removed from a note in a crowded measure? The measure's note durations do not change (grace notes take no time), and the measure redraws so the spacing is correct.
81
+ - What if the notes are in a part or a staff that is hidden or is a transposing instrument? The command works the same; transposition does not matter because markings are removed, not changed.
82
+ - What if a note's microtone is removed but the note is part of a chord? All microtones on the note's pitches are removed; the pitches themselves stay.
83
+ - Is a tie, slur, hairpin, tuplet, beam or other note-to-note thing removed? No. Only the nine kinds listed are available, and the other things attached to notes are untouched.
84
+ - What if the user opens Delete Special while playing audio? It behaves like the other Edit menu commands and dialogs.
85
+
86
+ ## Requirements *(mandatory)*
87
+
88
+ ### Functional Requirements
89
+
90
+ - **FR-001**: The Edit menu MUST offer a **Delete Special...** command, next to Paste Special, that opens a dialog.
91
+ - **FR-002**: The dialog MUST list exactly these kinds of marking, each with a checkbox: dynamics, lyrics, annotations, chords, articulations, ornaments, grace notes, arpeggios, microtones.
92
+ - **FR-003**: No checkbox MUST be ticked when the dialog opens, so a delete always reflects an explicit choice. The dialog does not need to remember its choices between uses.
93
+ - **FR-004**: On confirm, the system MUST remove every marking of each ticked kind from every selected note, and MUST NOT change any selected note's pitches, durations, rests, ties, tuplets, beams, voices, or any marking of an unticked kind.
94
+ - **FR-005**: **Lyrics** MUST mean the sung text of every verse. It MUST NOT include annotations or chord symbols.
95
+ - **FR-006**: **Annotations** MUST mean the free-text annotations on the note. It MUST NOT include lyrics or chord symbols.
96
+ - **FR-007**: **Chords** MUST mean the chord symbols on the note. It MUST NOT include lyrics or annotations. Only a ticked Chords box removes chord symbols.
97
+ - **FR-008**: **Dynamics**, **articulations** and **ornaments** MUST mean all of the note's markings of that kind.
98
+ - **FR-009**: **Grace notes** MUST mean all the grace notes attached to the note.
99
+ - **FR-010**: **Arpeggios** MUST mean the note's arpeggio marking.
100
+ - **FR-011**: **Microtones** MUST mean all the microtone adjustments on the note's pitches; the pitches themselves are kept.
101
+ - **FR-012**: The command MUST apply to exactly the current selection (one note, a run of notes, several measures, several staves) and to no note outside it. Markings on rests in the selection MUST be treated the same as markings on notes.
102
+ - **FR-013**: The whole command MUST be a single undoable step; one Undo MUST restore every removed marking.
103
+ - **FR-014**: Confirming with no kind ticked, or cancelling the dialog, MUST leave the score unchanged and MUST NOT add an undo step.
104
+ - **FR-015**: The score MUST redraw correctly after the delete, including the spacing of measures that lose grace notes, accidentals or lyrics.
105
+ - **FR-016**: A saved score MUST not contain the removed markings; saving and reopening after a Delete Special MUST give the same notes without them.
106
+ - **FR-017**: Automated tests MUST cover each of the nine kinds, a mix of kinds in one delete, kinds left alone when unticked, each of lyrics, annotations and chords removed on its own leaving the other two, notes with none of the ticked kinds, multi-measure and multi-staff selections, selections that stop inside a measure, rests, single-step undo, and a save and reload of the result.
107
+
108
+ ### Key Entities
109
+
110
+ - **Marking kind**: One of dynamics, lyrics, annotations, chords, articulations, ornaments, grace notes, arpeggios, microtones. The user chooses which kinds to delete.
111
+ - **Selected notes**: The notes (and rests) the user has selected on the score. Delete Special acts on these and on no others.
112
+ - **Note marking**: Anything in the nine kinds attached to a note, such as a dynamic, a verse of lyrics, an annotation, a chord symbol, an articulation, an ornament, a grace note, an arpeggio or a microtone.
113
+
114
+ ## Success Criteria *(mandatory)*
115
+
116
+ ### Measurable Outcomes
117
+
118
+ - **SC-001**: A user can clear a kind of marking from a whole passage in no more than 4 actions (select, open Delete Special, tick, confirm), with no per-note editing.
119
+ - **SC-002**: In every test case, 100% of pitches, durations, rests, ties, tuplets and unticked markings of the selected notes are identical before and after a Delete Special.
120
+ - **SC-003**: In every test case, 100% of markings of the ticked kinds on selected notes are gone, and 100% of markings on unselected notes are unchanged.
121
+ - **SC-004**: Deleting any one of lyrics, annotations or chords never removes either of the other two, in 100% of tested cases.
122
+ - **SC-005**: One Undo returns the score to exactly its state before the delete in 100% of tested cases.
123
+ - **SC-006**: Deleting from a 16-measure selection completes without any visible delay beyond that of a normal edit of the same size.
124
+ - **SC-007**: A score saved after a Delete Special, then reopened, has none of the deleted markings and is otherwise identical, in 100% of tested cases.
125
+
126
+ ## Assumptions
127
+
128
+ - The list of kinds is the one in the request plus **chords**, added in the clarification session, so the dialog offers the same six kinds as Paste Special (dynamics, lyrics, annotations, chords, articulations, ornaments) plus grace notes, arpeggios and microtones.
129
+ - The command works on the current selection, as the other editing commands do. It does not ask for a range or offer "whole score".
130
+ - There is no add or replace mode, unlike Paste Special; the command only removes.
131
+ - Like Paste Special, no checkbox is pre-ticked, and the dialog is a small modal dialog with the kinds as checkboxes, OK and Cancel.
132
+ - The command is always offered in the Edit menu (the selection always has at least the note under the cursor).
133
+ - "Annotations" means the free-text note annotations; "lyrics" means sung text by verse; "dynamics", "articulations" and "ornaments" are those attached to notes, as in Paste Special.
134
+ - Removing markings does not change how the notes sound apart from what the markings themselves affect (for example an arpeggio, a grace note or a microtone).
135
+ - Ties, slurs, hairpins, tuplets, beams, tab information, and anything attached to measures or staves rather than notes are out of scope.
136
+ - This feature does not change Paste Special, Copy or Paste.
@@ -0,0 +1,106 @@
1
+ ---
2
+
3
+ description: "Task list for Delete Special for Note Attachments"
4
+ ---
5
+
6
+ # Tasks: Delete Special for Note Attachments
7
+
8
+ **Input**: Design documents from `/specs/041-delete-special/`
9
+
10
+ **Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md), [data-model.md](data-model.md), [contracts/delete-special-api.md](contracts/delete-special-api.md), [quickstart.md](quickstart.md)
11
+
12
+ **Tests**: Included (spec FR-017 requires them) for the model, in `tests/deleteSpecial.ts`. The view method and the dialog cannot be loaded headless (they import the DOM and a `.vue` file), so they are checked by compilation, by compiling the component with Vue's SFC compiler, by searches, and by [quickstart.md](quickstart.md).
13
+
14
+ **Organization**: The removal logic is the base for every story, so it is in the Foundational phase. Each story then adds its piece: the command and dialog a user can reach (US1), proof that each kind removes exactly what its name says (US2), and proof that the selection is respected (US3).
15
+
16
+ ## Format: `[ID] [P?] [Story] Description`
17
+
18
+ - **[P]**: Can run in parallel (different files, no dependencies on unfinished tasks)
19
+ - **[Story]**: Which user story the task belongs to (US1 to US3)
20
+
21
+ ## Phase 1: Setup
22
+
23
+ - [X] T001 Create `tests/deleteSpecial.ts` with the `check()`/failure-count harness and the dynamic-constructor registration used in `tests/pasteSpecial.ts` (`noteModifierDynamicCtorInit`, `measureModifierDynamicCtorInit`, `staffModifierDynamicCtorInit`, `scoreModifierDynamicCtorInit`), plus helpers: `buildScore(measures: number, staves: number)` (default score via `SmoScore.getDefaultScore(SmoScore.defaults, null)`, four quarter notes per measure, extra measures and staves added as in `tests/pasteSpecial.ts`), `pick(score, staff, measure, tick)` returning a `SmoSelection.noteSelection`, and `decorate(note)` that gives a note one of every kind: a `SmoDynamicText`, `SmoLyric` lyrics for verses 0 and 1, a `SmoLyric` annotation, a `SmoLyric` chord (parsers from `SmoLyric.parsers`), an articulation, an ornament, a grace note, an arpeggio (`SmoArpeggio`) and a microtone (`SmoMicrotone`). The file ends with `process.exit(failures ? 1 : 0)` like the other tests. Register `"test:delete-special": "ts-node -P tests/tsconfig.json tests/deleteSpecial.ts"` in `package.json` next to `test:dynamics-font-size`
24
+
25
+ ---
26
+
27
+ ## Phase 2: Foundational (Blocking Prerequisites)
28
+
29
+ **Purpose**: The removal logic on the model and the view method that applies it. See [research.md](research.md) R1 to R4 and [data-model.md](data-model.md).
30
+
31
+ - [X] T002 In `src/smo/xform/operations.ts` add and export `type DeleteAttributeKind = 'dynamics' | 'lyrics' | 'annotations' | 'chords' | 'articulations' | 'ornaments' | 'graceNotes' | 'arpeggios' | 'microtones'`. Add a file-private table `deleteAttributeHandlers: Record<DeleteAttributeKind, { count: (note: SmoNote) => number, clear: (note: SmoNote) => void }>` built exactly as the data-model table (lyrics, annotations and chords filter `note.textModifiers` for `attrs.type === 'SmoLyric'` and the matching `SmoLyric.parsers` value; dynamics filter on `attrs.type === 'SmoDynamicText'`; the rest set the array field to `[]` or `arpeggio` to `undefined`). In `class SmoOperation` add `static readonly deleteAttributeKinds: DeleteAttributeKind[]` (all nine in the data-model order), `static countNoteAttributes(selections: SmoSelection[], kinds: DeleteAttributeKind[]): number` (read only; skips selections with no `note`; ignores kinds that are not in the table) and `static deleteNoteAttributes(selections: SmoSelection[], kinds: DeleteAttributeKind[]): void` (clears each known kind on each selection's note). Import `SmoLyric` and `SmoDynamicText` if not already imported
32
+ - [X] T003 In `src/render/sui/scoreViewOperations.ts`, next to `pasteAttributes`, add `async deleteNoteAttributes(kinds: DeleteAttributeKind[]): Promise<void>`: return at once if `kinds.length < 1` or `SmoOperation.countNoteAttributes(this.tracker.selections, kinds) < 1`; otherwise `await this.modifyCurrentSelections('delete special', (score, selections) => { SmoOperation.deleteNoteAttributes(selections, kinds); })`. Add a doc comment saying it is one undo step and that it changes nothing else about the notes. Import `DeleteAttributeKind` from `../../smo/xform/operations`
33
+ - [X] T004 Run `npx tsc --noEmit -p tsconfig.json` to confirm the foundation compiles
34
+
35
+ **Checkpoint**: A library caller can delete the nine kinds from selections and from the view.
36
+
37
+ ---
38
+
39
+ ## Phase 3: User Story 1 - Remove only chosen kinds of markings from the selected notes (Priority: P1)
40
+
41
+ **Goal**: **Edit > Delete Special...** opens a dialog with nine unticked boxes; confirming removes the ticked kinds from the selected notes in one undo step; nothing ticked or Cancel changes nothing.
42
+
43
+ **Independent Test**: Run the D cases in `tests/deleteSpecial.ts`, then [quickstart.md](quickstart.md) section 4 steps 1 to 3 and 6.
44
+
45
+ - [X] T005 [P] [US1] In `tests/deleteSpecial.ts` add the D cases: D1 to D9, one per kind. For each, `decorate` four notes, select all four, call `SmoOperation.deleteNoteAttributes(selections, [kind])`, and check that kind's count is 0 on every note, that the other eight kinds' counts and values are unchanged (compare each note's serialized markings before and after, except the one kind), and that `pitches`, `tickCount` and `noteType` are unchanged. Add C1 (`countNoteAttributes` with `[]` is 0 and `deleteNoteAttributes` with `[]` changes nothing), C2 (a list with an unknown string, `['bogus' as any, 'dynamics']`, still removes the dynamics and does not throw) and C3 (before a delete the count equals the number of markings `decorate` added; after, it is 0)
46
+ - [X] T006 [P] [US1] Create `src/ui/components/dialogs/deleteSpecial.vue` modelled on `pasteSpecial.vue`: props `domId`, `label`, `kinds: { id: string, label: string }[]`, `selected: Record<string, boolean>`, `commitCb`, `cancelCb`; a `toggle` per kind with `:initialValue="false"` and `:changeCb="(value: boolean) => { selected[kind.id] = value }"`; `dialogContainer` with `:enable="canDelete"` where `canDelete` is `props.kinds.some((kind) => selected[kind.id] === true)`. No replace toggle
47
+ - [X] T007 [US1] Create `src/ui/dialogs/deleteSpecial.ts` modelled on `pasteSpecial.ts`: export `SuiDeleteSpecialDialog = async (parameters: SuiDialogParams) => {...}` with a labels record (`dynamics: 'Dynamics'`, `lyrics: 'Lyrics'`, `annotations: 'Annotations'`, `chords: 'Chords'`, `articulations: 'Articulations'`, `ornaments: 'Ornaments'`, `graceNotes: 'Grace Notes'`, `arpeggios: 'Arpeggios'`, `microtones: 'Microtones'`) typed `Record<DeleteAttributeKind, string>`, a reactive `selected` record with every `SmoOperation.deleteAttributeKinds` entry set to false, `commitCb` calling `parameters.view.deleteNoteAttributes(SmoOperation.deleteAttributeKinds.filter((kind) => selected[kind]))`, a no-op `cancelCb`, `label: 'Delete Special'`, and `InstallDialog({ app: deleteSpecialApp, appParams, root: rootId, dialogParams: parameters, commitCb, cancelCb })` (depends on T006)
48
+ - [X] T008 [US1] In `src/ui/menus/edit.ts` import `SuiDeleteSpecialDialog`, add `deleteSpecialMenuOption: SuiConfiguredMenuOption` after `pasteSpecialMenuOption` (handler opens the dialog with the same parameters as Paste Special but `ctor: 'SuiDeleteSpecialDialog'` and `id: 'deleteSpecial'`; `display: () => true`; `menuChoice: { icon: '', text: 'Delete Special...', value: 'deleteSpecialAction' }`), and insert it into `SuiEditMenuOptions` right after `pasteSpecialMenuOption` (depends on T007)
49
+ - [X] T009 [P] [US1] In `src/application/exports.ts` add `import { SuiDeleteSpecialDialog } from '../ui/dialogs/deleteSpecial';`, `export * from '../ui/dialogs/deleteSpecial';` after the pasteSpecial export, and `SuiDeleteSpecialDialog` to the exported-names object next to `SuiPasteSpecialDialog`. In root `typedoc.ts` add `export * from './src/ui/dialogs/deleteSpecial';` in sorted position (after `./src/ui/dialogs/dialog`)
50
+ - [X] T010 [P] [US1] Update the declarations by hand (do not run `npm run types`; it rewrites many unrelated files): create `types/src/ui/dialogs/deleteSpecial.d.ts` in the style of `pasteSpecial.d.ts`; in `types/src/smo/xform/operations.d.ts` add the `DeleteAttributeKind` type, `deleteAttributeKinds`, `countNoteAttributes` and `deleteNoteAttributes`; in `types/src/render/sui/scoreViewOperations.d.ts` add `deleteNoteAttributes(kinds: DeleteAttributeKind[]): Promise<void>` and its import; in `types/src/application/exports.d.ts` add the `export *` line and the `SuiDeleteSpecialDialog` member next to the Paste Special ones; in `types/typedoc.d.ts` add the export
51
+ - [X] T011 [US1] Run `npx tsc --noEmit -p tsconfig.json`, `npm run test:delete-special`, and the SFC check from [quickstart.md](quickstart.md) section 2 on `src/ui/components/dialogs/deleteSpecial.vue` (expect parse errors 0 and a successful compile)
52
+
53
+ **Checkpoint**: User story 1 works end to end; the command is in the Edit menu.
54
+
55
+ ---
56
+
57
+ ## Phase 4: User Story 2 - The right markings are removed, and only those (Priority: P1)
58
+
59
+ **Goal**: Show that lyrics, annotations and chords never remove each other, and that every kind removes exactly what its name says.
60
+
61
+ **Independent Test**: Run the L, M and N cases in `tests/deleteSpecial.ts`, then [quickstart.md](quickstart.md) section 4 step 4.
62
+
63
+ - [X] T012 [US2] In `tests/deleteSpecial.ts` add the L cases on one note with lyrics in verses 0 and 1, an annotation and a chord: L1 deleting `['lyrics']` removes both verses and leaves the annotation and the chord; L2 deleting `['annotations']` leaves both lyrics and the chord; L3 deleting `['chords']` leaves both lyrics and the annotation. Add M1 (all nine kinds in one call leave the note with no markings and the same pitches and duration), M2 (three kinds, `['dynamics', 'ornaments', 'microtones']`, leave the other six untouched), N1 (a note with none of the ticked kinds is deep-equal in its serialized form before and after, no exception) and N2 (a second identical delete counts 0 and changes nothing)
64
+
65
+ **Checkpoint**: Each checkbox means exactly its name.
66
+
67
+ ---
68
+
69
+ ## Phase 5: User Story 3 - Work on any selection, in any number of staves and voices (Priority: P2)
70
+
71
+ **Goal**: The delete applies to exactly the selected notes, across measures, staves and voices, rests included, and the result survives a save.
72
+
73
+ **Independent Test**: Run the S, R and P cases in `tests/deleteSpecial.ts`, then [quickstart.md](quickstart.md) section 4 steps 7 and 8.
74
+
75
+ - [X] T013 [US3] In `tests/deleteSpecial.ts` add the S cases on a 4-measure, 2-staff score with every note decorated: S1 a single-note selection changes only that note; S2 a run of notes that stops inside a measure changes exactly those notes; S3 measures 2 and 3 of both staves selected, deleting dynamics leaves measures 1 and 4 of both staves with theirs; S4 a second voice in a measure (add a voice as in `tests/voiceCopyPaste.ts`) with only voice 1's notes selected leaves voice 2's markings. Add R1 (rests given a dynamic and an annotation lose them when selected, and stay rests with the same duration). Add P1 (decorate, delete `['graceNotes', 'dynamics']`, serialize the score with `{ skipStaves: false, useDictionary: false, preserveStaffIds: false }`, load it with `SmoScore.deserialize`, and check the reloaded notes have none of those two kinds and still have the other seven, with the same pitches and durations)
76
+
77
+ **Checkpoint**: All stories are done.
78
+
79
+ ---
80
+
81
+ ## Phase 6: Polish and Cross-Cutting Concerns
82
+
83
+ - [X] T014 [P] Add a `changes.md` entry at the top (follow the entries there, dated 11-16-2026) describing: the Edit menu has a new **Delete Special...** that removes the chosen kinds of marking (dynamics, lyrics, annotations, chords, articulations, ornaments, grace notes, arpeggios, microtones) from the selected notes; nothing is ticked at first; the notes' pitches and rhythms are not changed; lyrics, annotations and chords are separate choices; it is one undo step; and, for library users, `SmoOperation.deleteNoteAttributes`, `countNoteAttributes` and `deleteAttributeKinds`, `SuiScoreViewOperations.deleteNoteAttributes`, and `SuiDeleteSpecialDialog`
84
+ - [X] T015 Run `npx tsc --noEmit -p tsconfig.json`, then `npm run test:delete-special`, `npm run test:paste-special`, `npm run test:voice-copy-paste`, `npm run test:dynamics-font-size`, `npm run test:score-archive`, `npm run test:quick-beam`, `npm run test:measure-fill` and `npm run test:beam-groups`; all must pass. Run `git grep -n "SuiDeleteSpecialDialog" -- src types typedoc.ts` and confirm the dialog is in the menu, exports, typedoc and declarations
85
+ - [ ] T016 Walk through [quickstart.md](quickstart.md) section 4 by hand in the running application and note any difference from the expected results
86
+
87
+ ---
88
+
89
+ ## Dependencies and Execution Order
90
+
91
+ - Phase 1 (T001) first. Phase 2 (T002 to T004) blocks every story: T003 needs T002; T004 after both.
92
+ - US1 (T005 to T011): T005 and T006 are independent files; T007 needs T006; T008 needs T007; T009 and T010 are independent files and only need the names from T002, T003 and T007; T011 after all of them.
93
+ - US2 (T012) and US3 (T013) are tests only, need only Phase 2, and edit the same test file as T005, so run them after T005 (not in parallel with it).
94
+ - Polish (T014 to T016) after the stories; T014 can start any time.
95
+
96
+ ### Parallel opportunities
97
+
98
+ - T005 and T006 (different files).
99
+ - T009 and T010 (different files).
100
+ - T014 with anything.
101
+
102
+ ## Implementation Strategy
103
+
104
+ **MVP**: Phase 1, Phase 2, then US1 (T001 to T011): the Edit menu has Delete Special, the dialog works, and each kind is tested on its own. US2 and US3 add the tests that prove no kind takes another with it and that the selection is respected; they should be done before the feature is considered finished, since a delete that removes too much is data loss.
105
+
106
+ Run `npm run test:delete-special` after each phase.