{
  "$schema": "https://pi-tui.ratstack.sh/schema/pattern.schema.json",
  "aka": [
    "Foldable tree"
  ],
  "animated": false,
  "apis": [
    {
      "name": "ctx.ui.custom",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/tui.md#use-custom-screens-and-overlays"
    },
    {
      "name": "pi.appendEntry",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#state-management"
    },
    {
      "name": "ctx.sessionManager.getEntries",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#state-management"
    },
    {
      "name": "TreeSelectorComponent",
      "url": null
    },
    {
      "name": "TreeSelectorComponent.getTreeList",
      "url": null
    },
    {
      "name": "setKeybindings",
      "url": null
    },
    {
      "name": "truncateToWidth",
      "url": null
    }
  ],
  "applicability": [
    "Use this when reopening a tree should preserve its compact view."
  ],
  "category": "lists",
  "categoryLabel": "Lists and pickers",
  "consequences": [
    "A reopened tree retains its compact view.",
    "Saved identifiers must be checked against the current nodes."
  ],
  "family": "structural",
  "familyLabel": "Structural",
  "id": "branch-fold",
  "implementation": [
    "Discard fold identifiers that no longer name a tree node.",
    "Check navigation capability before changing the session."
  ],
  "intent": "Retain validated fold identifiers while navigating a session tree.",
  "jsonUrl": "https://pi-tui.ratstack.sh/patterns/branch-fold.json",
  "kind": "component",
  "knownUses": [
    {
      "example": "anycopy-tree-fold-state",
      "moreRefs": 0,
      "refs": [
        {
          "file": "extensions/anycopy/index.ts",
          "lines": "971-1035",
          "sha": "17cce138",
          "url": "https://github.com/nicobailon/dot314/blob/17cce138f3f687211d0485d204408a9650953c61/extensions/anycopy/index.ts#L971-L1035"
        }
      ],
      "repo": "dot314",
      "repoUrl": "https://github.com/nicobailon/dot314",
      "title": "Persist fold state while reusing a session-tree selector"
    }
  ],
  "linkedFrom": [
    {
      "how": "uses saved fold identifiers",
      "id": "session-memento",
      "jsonUrl": "https://pi-tui.ratstack.sh/patterns/session-memento.json",
      "mdUrl": "https://pi-tui.ratstack.sh/patterns/session-memento.md",
      "name": "Session Memento",
      "url": "https://pi-tui.ratstack.sh/patterns/session-memento/"
    }
  ],
  "links": {
    "agentGuide": "https://pi-tui.ratstack.sh/llms.txt",
    "index": "https://pi-tui.ratstack.sh/patterns.md",
    "skill": "https://pi-tui.ratstack.sh/skills/build-pi-tui-component.md"
  },
  "mdUrl": "https://pi-tui.ratstack.sh/patterns/branch-fold.md",
  "motivation": "Dot314's anycopy selector reopens a session tree with saved fold identifiers.",
  "name": "Branch Fold",
  "participants": [
    {
      "name": "ctx.ui.custom",
      "role": "Mounts one interaction and resolves through done.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/tui.md#use-custom-screens-and-overlays"
    },
    {
      "name": "pi.appendEntry",
      "role": "Persists typed custom data outside model context.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#state-management"
    },
    {
      "name": "ctx.sessionManager.getEntries",
      "role": "Reads session-file entries for deliberate reconstruction.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#state-management"
    },
    {
      "name": "Fold identifiers",
      "role": "Name hidden branches after validation against current nodes.",
      "url": null
    }
  ],
  "pi": "1.0.3",
  "related": [
    {
      "how": "persists the fold identifiers",
      "id": "session-memento",
      "jsonUrl": "https://pi-tui.ratstack.sh/patterns/session-memento.json",
      "mdUrl": "https://pi-tui.ratstack.sh/patterns/session-memento.md",
      "name": "Session Memento",
      "url": "https://pi-tui.ratstack.sh/patterns/session-memento/"
    }
  ],
  "sampleCode": {
    "code": "// Branch Fold: restore validated fold identifiers in a synthetic session tree.\nimport { TreeSelectorComponent, type SessionTreeNode } from \"@earendil-works/pi-coding-agent\";\nimport { getKeybindings, setKeybindings, truncateToWidth, type Component } from \"@earendil-works/pi-tui\";\nimport type { PatternStory } from \"../../../src/pattern.ts\";\n\nexport const story: PatternStory = {\n  id: \"branch-fold\", title: \"Branch Fold\", kind: \"component\",\n  apis: [\"TreeSelectorComponent\", \"TreeSelectorComponent.getTreeList\", \"setKeybindings\", \"truncateToWidth\"],\n  rows: 24,\n  states: [\n    { id: \"expanded\", label: \"Expanded tree\" },\n    { id: \"folded\", label: \"Folded branch\", steps: [{ type: \"action\", name: \"fold\" }] },\n    { id: \"reopened\", label: \"Restored folds\", steps: [{ type: \"action\", name: \"reopen\" }] },\n  ],\n  setup({ theme, tui, action, keybindings }) {\n    // TreeSelector reads Pi\\'s shared key registry, not constructor bindings.\n    const previousBindings = getKeybindings();\n    setKeybindings(keybindings);\n    const node = (id: string, parentId: string | null, text: string, children: SessionTreeNode[] = []): SessionTreeNode => ({\n      entry: { type: \"message\", id, parentId, timestamp: \"2026-01-01T00:00:00Z\",\n        message: { role: \"user\", content: text, timestamp: 1767225600000 } },\n      children,\n    });\n    const tree = [node(\"draft\", null, \"Sketch the task list\", [\n      node(\"preview\", \"draft\", \"Render a preview\", [\n        node(\"dark\", \"preview\", \"Review the dark theme\"),\n        node(\"light\", \"preview\", \"Review the light theme\"),\n      ]),\n      node(\"checks\", \"draft\", \"Check the sample code\"),\n    ])];\n    const index = new Set<string>();\n    const visit = (nodes: SessionTreeNode[]) => nodes.forEach(n => { index.add(n.entry.id); visit(n.children); });\n    visit(tree);\n    // In a real extension these IDs come from appendEntry/getEntries.\n    // This UI-only harness has no session-file APIs; saved data is a fixture.\n    let savedFoldIds: readonly string[] = [];\n    let caption = \"Expanded · selected preview branch\";\n    const makeSelector = (selectedId: string) => new TreeSelectorComponent(tree, \"checks\", 12,\n      id => { caption = \"Selected \" + id + \" · navigation not available in this fixture\"; tui.requestRender(); },\n      () => {}, undefined, selectedId, \"all\");\n    let selector = makeSelector(\"preview\");\n    action(\"fold\", () => {\n      const selected = selector.getTreeList().getSelectedNode();\n      if (!selected) return;\n      selector.handleInput(\"\\x1b[1;5D\"); // Pi's default fold-or-up binding.\n      savedFoldIds = [selected.entry.id];\n      caption = \"Saved fold: \" + selected.entry.id;\n      tui.requestRender();\n    });\n    action(\"reopen\", () => {\n      const restoredIds = [...savedFoldIds, \"removed-node\"].filter(id => index.has(id));\n      selector = makeSelector(\"preview\");\n      for (const id of restoredIds) {\n        selector = makeSelector(id);\n        selector.handleInput(\"\\x1b[1;5D\");\n      }\n      caption = \"Restored preview · 1 stale ID dropped\";\n      tui.requestRender();\n    });\n    const component = {\n      dispose() { setKeybindings(previousBindings); },\n      invalidate() { selector.invalidate(); },\n      handleInput(data: string) { selector.handleInput(data); tui.requestRender(); },\n      render(width: number) {\n        return [...selector.render(width), theme.fg(\"muted\", truncateToWidth(caption, width))];\n      },\n    } satisfies Component & { dispose(): void };\n    return component;\n  },\n};\n",
    "lang": "ts",
    "path": "stories/patterns/structural/branch-fold.ts"
  },
  "states": [
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Branch Fold, Expanded tree state, 40 columns, dark theme, 20 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 880,
          "rows": 20,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/expanded-40-dark.c18c948248e5.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Branch Fold, Expanded tree state, 40 columns, light theme, 20 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 880,
          "rows": 20,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/expanded-40-light.1b7be750bd07.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Branch Fold, Expanded tree state, 60 columns, dark theme, 20 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 880,
          "rows": 20,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/expanded-60-dark.d78772677d7d.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Branch Fold, Expanded tree state, 60 columns, light theme, 20 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 880,
          "rows": 20,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/expanded-60-light.219456327f48.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Branch Fold, Expanded tree state, 80 columns, dark theme, 20 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 880,
          "rows": 20,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/expanded-80-dark.0335e705c004.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Branch Fold, Expanded tree state, 80 columns, light theme, 20 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 880,
          "rows": 20,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/expanded-80-light.e0ebb123be73.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Branch Fold, Expanded tree state, 120 columns, dark theme, 20 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 880,
          "rows": 20,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/expanded-120-dark.428dcd286d7c.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Branch Fold, Expanded tree state, 120 columns, light theme, 20 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 880,
          "rows": 20,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/expanded-120-light.70755ac606d3.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Show several synthetic branches with the selected node.",
      "id": "expanded",
      "label": "Expanded tree",
      "problems": []
    },
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Branch Fold, Folded branch state, 40 columns, dark theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/folded-40-dark.1d60b1b8cf81.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Branch Fold, Folded branch state, 40 columns, light theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/folded-40-light.7f148fca7455.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Branch Fold, Folded branch state, 60 columns, dark theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/folded-60-dark.1de7ce8bf2a5.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Branch Fold, Folded branch state, 60 columns, light theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/folded-60-light.8e6da0e2421f.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Branch Fold, Folded branch state, 80 columns, dark theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/folded-80-dark.e109273a1520.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Branch Fold, Folded branch state, 80 columns, light theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/folded-80-light.8c2f581f9bc1.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Branch Fold, Folded branch state, 120 columns, dark theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/folded-120-dark.4503759637c0.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Branch Fold, Folded branch state, 120 columns, light theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/folded-120-light.e070910f4938.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Hide descendants while leaving the branch visible.",
      "id": "folded",
      "label": "Folded branch",
      "problems": []
    },
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Branch Fold, Restored folds state, 40 columns, dark theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/reopened-40-dark.f2fdb3167ef7.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Branch Fold, Restored folds state, 40 columns, light theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/reopened-40-light.08ea3e740b85.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Branch Fold, Restored folds state, 60 columns, dark theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/reopened-60-dark.c7fde4e9bd01.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Branch Fold, Restored folds state, 60 columns, light theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/reopened-60-light.36082cdb5ed7.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Branch Fold, Restored folds state, 80 columns, dark theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/reopened-80-dark.d0a4a0c8d865.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Branch Fold, Restored folds state, 80 columns, light theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/reopened-80-light.06fc62dad143.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Branch Fold, Restored folds state, 120 columns, dark theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/reopened-120-dark.dc063a97e9f6.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Branch Fold, Restored folds state, 120 columns, light theme, 18 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 792,
          "rows": 18,
          "still": "https://pi-tui.ratstack.sh/frames/branch-fold/reopened-120-light.6bff65366ce8.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Reopen from saved fold IDs and omit an invalid saved ID.",
      "id": "reopened",
      "label": "Restored folds",
      "problems": []
    }
  ],
  "structure": "tree + valid fold IDs\n      -> visible branches",
  "thumbnails": {
    "dark": {
      "animation": null,
      "src": "https://pi-tui.ratstack.sh/thumbs/branch-fold/dark.8a23b63f2734.webp"
    },
    "light": {
      "animation": null,
      "src": "https://pi-tui.ratstack.sh/thumbs/branch-fold/light.36be11ee2ca5.webp"
    }
  },
  "url": "https://pi-tui.ratstack.sh/patterns/branch-fold/",
  "widths": [
    40,
    60,
    80,
    120
  ]
}
