Skip to content

obsidian/Workspace

Mock of Obsidian’s Workspace, which manages the app’s leaves, splits and layout.

Class Description
Workspace Mock of Obsidian’s Workspace. Leaves live in a real layout tree, as in Obsidian: tab groups inside the root split, the two sidebars, and the popout windows under Workspace.floatingSplit. Methods that create a leaf place it where Obsidian would and make it active, lookups and iterators walk the tree, and every layout change runs through Workspace.onLayoutChange into Workspace.updateLayout, which re-picks an active leaf and re-populates an emptied root split. The layout-ready state is driven by the test through Workspace.setLayoutReady__, and it is load-bearing: exactly as in Obsidian, Workspace.updateLayout and Workspace.activeLeafEvents do nothing until it is set, so active-leaf-change, file-open and layout-change do not fire in a workspace that was never made ready. Nothing is rendered, and leaves are always treated as visible.