Skip to main content

reposition_new_tasks

Function reposition_new_tasks 

Source
pub fn reposition_new_tasks(
    queue: &mut QueueFile,
    new_task_ids: &[String],
    insert_at: usize,
)
Expand description

Repositions newly added tasks to the specified insertion index in the queue.

This function extracts tasks identified by new_task_ids from their current positions and splices them into the queue at insert_at, preserving the relative order of existing tasks and the new tasks themselves.

The insert_at index is clamped to queue.tasks.len() to prevent out-of-bounds errors.