Delete a branch
cellucid_history_branch_delete.RdMove a branch's own steps (those no other branch starts from) to Recently deleted, where they can be restored; with with_sub_branches, the branches that start from it too. Main and locked branches cannot be deleted.
Arguments
- viewer
A viewer
cellucid_view()orcellucid_serve()returned.- branch
A branch by its name or its id (history_summary lists them). Text (at least 1 character). Required.
- tracker
A tracker by its name or its id (history_summary lists them); the tracker in use when left out. Text (at least 1 character). Left out unless given (the viewer then chooses as its own control does).
- with_sub_branches
Also delete every branch that starts from it.
TRUEorFALSE. DefaultFALSE, the viewer's own.
Value
A cellucid_action_request, at once and invisibly: the action is sent now, or when the viewer's channel opens.
cellucid_action_result(request) returns its outcome: a list of absorbed_by (The branch that keeps its shared steps), branches (The branches deleted), head (The step shown now), journal (Its Recently deleted entry), kept_views (Kept views elsewhere made from it (they keep their picture)), replays (Trackers replayed from it), results (Results computed on them), steps (Steps moved to Recently deleted).
Details
The viewer's action history.branch.delete (History). It moves the viewer's history, as the person's Undo, Redo or a click on a step does: it makes no step of the history.
When an agent (Claude, ChatGPT) runs it, the viewer asks the person first (deletes-saved); from R it is not asked.
See also
cellucid_act() sends any action by its type, and cellucid_action_result()
collects its answer.
Examples
if (interactive() && requireNamespace("SeuratObject", quietly = TRUE)) {
data("pbmc_small", package = "SeuratObject")
viewer <- cellucid_view(SeuratObject::UpdateSeuratObject(pbmc_small))
request <- cellucid_history_branch_delete(viewer, branch = "Main")
print(request)
# cellucid_action_result(request) waits for its outcome.
cellucid_stop(viewer)
}