feat: allow dissolving a block

This commit is contained in:
Carlos Valente
2025-05-16 21:01:24 +02:00
committed by arc-alex
parent 9edff55bd5
commit a1505606cf
7 changed files with 140 additions and 3 deletions
@@ -214,6 +214,22 @@ export async function applyDelay(delayId: EntryId) {
notifyChanges({ timer: true, external: true });
}
/**
* Deletes a block from the rundown and moves all its children to the top level
*/
export async function dissolveBlock(blockId: EntryId) {
const scopedMutation = cache.mutateCache(cache.dissolveBlock);
const { newRundown } = await scopedMutation({ blockId });
// notify runtime that rundown has changed
updateRuntimeOnChange();
// we dont need to modify the timer since the grouping does not affect the runtime
notifyChanges({ external: true });
return newRundown;
}
/**
* swaps two events
* @param {string} from - id of event from