MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / applySortOrderPlan

Function applySortOrderPlan

src/bases/sortOrderUtils.ts:699–714  ·  view source on GitHub ↗
(
	draggedPath: string,
	plan: SortOrderPlan,
	plugin: TaskNotesPlugin,
	options: { includeDragged?: boolean } = {}
)

Source from the content-addressed store, hash-verified

697 * Apply a previously prepared sort-order plan using the configured mapping.
698 */
699export async function applySortOrderPlan(
700 draggedPath: string,
701 plan: SortOrderPlan,
702 plugin: TaskNotesPlugin,
703 options: { includeDragged?: boolean } = {}
704): Promise<void> {
705 if (!plan.sortOrder) return;
706
707 for (const write of plan.additionalWrites) {
708 await writeSortOrder(write.path, write.sortOrder, plugin);
709 }
710
711 if (options.includeDragged !== false) {
712 await writeSortOrder(draggedPath, plan.sortOrder, plugin);
713 }
714}
715
716/**
717 * Per-task promise queue that serializes async drop operations on the same file.

Callers 3

handleTaskDropMethod · 0.90
handleSortOrderDropMethod · 0.90

Calls 1

writeSortOrderFunction · 0.85

Tested by

no test coverage detected