Found while fixing #1593.
Delete is the one irreversible action in the settings list, and the two container types are treated asymmetrically.
A folder whose choices value could not be read gets a specific warning before it is deleted (choiceService.ts:249-257):
QuickAdd couldn't read this folder's contents. Deleting it also deletes whatever is still stored under it in data.json.
A macro gets only the generic line (choiceService.ts:273):
Deleting this choice will also delete its macro commands.
That sentence is true but says nothing about the case that matters: macro.commands holds something QuickAdd could not read ({"0": {...}}, a string, a number). Since #1593 the macro builder tells the user about that state and refuses to overwrite it - and then the delete dialog, the one place it is about to be destroyed for good, says nothing.
Suggested shape
Reuse the predicate the builder already reads, so the two surfaces cannot disagree - exactly the argument the folder case makes:
isMacro && isUnreadableCommandList((choice as IMacroChoice).macro?.commands)
? "QuickAdd couldn't read this macro's commands. Deleting it also deletes whatever is still stored under it in data.json."
: ...
(isUnreadableCommandList lives in src/utils/macroUtils.ts.)
Also worth covering the case where the whole macro object is unreadable, which #1593 added handling for in the builder.
Found while fixing #1593.
Delete is the one irreversible action in the settings list, and the two container types are treated asymmetrically.
A folder whose
choicesvalue could not be read gets a specific warning before it is deleted (choiceService.ts:249-257):A macro gets only the generic line (
choiceService.ts:273):That sentence is true but says nothing about the case that matters:
macro.commandsholds something QuickAdd could not read ({"0": {...}}, a string, a number). Since #1593 the macro builder tells the user about that state and refuses to overwrite it - and then the delete dialog, the one place it is about to be destroyed for good, says nothing.Suggested shape
Reuse the predicate the builder already reads, so the two surfaces cannot disagree - exactly the argument the folder case makes:
(
isUnreadableCommandListlives insrc/utils/macroUtils.ts.)Also worth covering the case where the whole
macroobject is unreadable, which #1593 added handling for in the builder.