{
  "site": "at://did:plc:ngokl2gnmpbvuvrfckja3g7p/site.standard.publication/3m3frizuz2c2v",
  "$type": "site.standard.document",
  "title": "obsidian plugin open options",
  "content": {
    "$type": "pub.leaflet.content",
    "pages": [
      {
        "$type": "pub.leaflet.pages.linearDocument",
        "blocks": [
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "Yes. Plugin views can open in three places:"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 19,
                    "byteStart": 0
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "1. Main editor area (the center pane):"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.code",
              "language": "typescript",
              "plaintext": "await this.app.workspace.getLeaf(true).setViewState({\n  type: 'my-plugin-view',\n  active: true,\n});"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 13,
                    "byteStart": 0
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#code"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "getLeaf(true) creates a new leaf in the main editor area, not the sidebar. This is how plugins like Canvas, Cards View, and Kanban work -- they take over the center pane."
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 10,
                    "byteStart": 0
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "2. Sidebar (left or right):"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.code",
              "language": "typescript",
              "plaintext": "await this.app.workspace.getRightLeaf(false).setViewState({\n  type: 'my-plugin-view',\n  active: true,\n});"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 15,
                    "byteStart": 0
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "3. A new window (popout):"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.code",
              "language": "typescript",
              "plaintext": "await this.app.workspace.openPopoutLeaf().setViewState({\n  type: 'my-plugin-view',\n  active: true,\n});"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "The key difference is which leaf you target:"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 53,
                    "byteStart": 40
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#code"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 101,
                    "byteStart": 87
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#code"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 163,
                    "byteStart": 144
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#code"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 202,
                    "byteStart": 184
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#code"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 238,
                    "byteStart": 222
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#code"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "| Method | Where |\n|--------|-------|\n| getLeaf(true) | Main editor area (new tab) |\n| getLeaf(false) | Main editor area (replaces current) |\n| getRightLeaf(false) | Right sidebar |\n| getLeftLeaf(false) | Left sidebar |\n| openPopoutLeaf() | Separate window |"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "So your plugin view doesn't have to be in the sidebar at all. Most \"full\" plugin views (Canvas, Kanban, Excalidraw) live in the main editor area as a tab alongside markdown files."
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          }
        ]
      }
    ]
  },
  "updatedAt": "2026-04-27T02:02:24.559Z",
  "publishedAt": "2026-04-27T02:02:24.559Z",
  "textContent": "Yes. Plugin views can open in three places:\n\n1. Main editor area (the center pane):\n\nawait this.app.workspace.getLeaf(true).setViewState({\n  type: 'my-plugin-view',\n  active: true,\n});\n\ngetLeaf(true) creates a new leaf in the main editor area, not the sidebar. This is how plugins like Canvas, Cards View, and Kanban work -- they take over the center pane.\n\n2. Sidebar (left or right):\n\nawait this.app.workspace.getRightLeaf(false).setViewState({\n  type: 'my-plugin-view',\n  active: true,\n});\n\n3. A new window (popout):\n\nawait this.app.workspace.openPopoutLeaf().setViewState({\n  type: 'my-plugin-view',\n  active: true,\n});\n\nThe key difference is which leaf you target:\n\n| Method | Where |\n|--------|-------|\n| getLeaf(true) | Main editor area (new tab) |\n| getLeaf(false) | Main editor area (replaces current) |\n| getRightLeaf(false) | Right sidebar |\n| getLeftLeaf(false) | Left sidebar |\n| openPopoutLeaf() | Separate window |\n\nSo your plugin view doesn't have to be in the sidebar at all. Most \"full\" plugin views (Canvas, Kanban, Excalidraw) live in the main editor area as a tab alongside markdown files."
}