obsidian/WorkspaceLeaf
Mock of Obsidian’s WorkspaceLeaf, the layout node that hosts a single view.
Classes
Section titled “Classes”| Class | Description |
|---|---|
| WorkspaceLeaf | Mock of Obsidian’s WorkspaceLeaf. The leaf keeps its opened file, ephemeral state, group and pinned flag in memory so a test can read them back. It sits in the workspace’s layout tree, and WorkspaceLeaf.detach removes it from there. As in Obsidian its WorkspaceLeaf.view is REAL and never null: the leaf is born holding WorkspaceLeaf._empty, the “New tab” page, and WorkspaceLeaf.setViewState builds the view its type names through App.viewRegistry. So the view state is not stored — WorkspaceLeaf.getViewState derives it from the view, exactly as the app does. |