Expand description
Drag-and-drop operations: moving/promoting/tearing-off blocks and tabs.
Functions§
- move_
block_ to_ tab - Move a block from one tab to another.
Removes the block from
source_tab_id.blockidsand adds it todest_tab_id.blockids. Updatesblock.parentorefto point to the destination tab. Ifauto_close_sourceis true, deletes the source tab when it becomes empty (only if the workspace has other tabs). - move_
tab_ to_ workspace - Move a tab from one workspace to another. Removes the tab from the source workspace’s tabids/pinnedtabids and adds it to the destination workspace’s tabids at the specified index. The tab is always added as unpinned in the destination. If the tab was the active tab in the source workspace, a new active tab is chosen.
- promote_
block_ to_ tab - Promote a block to a new tab.
Removes the block from
source_tab_id, creates a new tab inws_id, and adds the block to the new tab. Returns the new Tab. Ifauto_close_sourceis true, deletes the source tab when it becomes empty. - restore_
torn_ off_ tab - Move a tab back from a tear-off workspace into a destination workspace.
Unlike
move_tab_to_workspace, this skips the “last tab” guard because tear-off workspaces always contain exactly one tab — and after the move the source workspace has zero tabs and is deleted. - tear_
off_ block - Tear off a block into a new workspace.
Removes the block from
source_tab_id, creates a new workspace with a single tab containing the block. Returns the new workspace. Ifauto_close_sourceis true, deletes the source tab when it becomes empty. - tear_
off_ tab - Tear off a tab into a new workspace. Removes the tab from the source workspace and creates a new workspace containing just that tab. Returns the new workspace. The source workspace must have more than one tab.