{
  "$schema": "https://pi-tui.ratstack.sh/schema/pattern.schema.json",
  "aka": [
    "Draft restoration"
  ],
  "animated": false,
  "apis": [
    {
      "name": "ctx.ui.getEditorText",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "ctx.ui.setEditorText",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "ctx.ui.setEditorComponent",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "CustomEditor",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/tui.md#handle-keyboard-input-and-focus"
    },
    {
      "name": "getEditorText",
      "url": null
    },
    {
      "name": "setEditorText",
      "url": null
    },
    {
      "name": "setEditorComponent",
      "url": null
    }
  ],
  "applicability": [
    "Use this when a command needs editor-driven submission without losing the current text."
  ],
  "category": "editors",
  "categoryLabel": "Editors and drafts",
  "consequences": [
    "Temporary submission does not discard the captured draft.",
    "Restoration needs a finally path and the source restores only nonempty text."
  ],
  "family": "lifecycle",
  "familyLabel": "Lifecycle",
  "id": "draft-return",
  "implementation": [
    "Restore the captured draft in a finally path.",
    "The source restores only a nonempty captured draft."
  ],
  "intent": "Restore the captured editor draft after a temporary submission.",
  "jsonUrl": "https://pi-tui.ratstack.sh/patterns/draft-return.json",
  "kind": "screen",
  "knownUses": [
    {
      "example": "boomerang-editor-restore",
      "moreRefs": 0,
      "refs": [
        {
          "file": "index.ts",
          "lines": "1318-1337",
          "sha": "1a5985b2",
          "url": "https://github.com/nicobailon/pi-boomerang/blob/1a5985b2d92cfa84ce1f470d100d02b368711a91/index.ts#L1318-L1337"
        }
      ],
      "repo": "pi-boomerang",
      "repoUrl": "https://github.com/nicobailon/pi-boomerang",
      "title": "Temporarily install an editor and restore draft after submission"
    }
  ],
  "linkedFrom": [
    {
      "how": "restores text after temporary submission",
      "id": "retry-buffer",
      "jsonUrl": "https://pi-tui.ratstack.sh/patterns/retry-buffer.json",
      "mdUrl": "https://pi-tui.ratstack.sh/patterns/retry-buffer.md",
      "name": "Retry Buffer",
      "url": "https://pi-tui.ratstack.sh/patterns/retry-buffer/"
    }
  ],
  "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/draft-return.md",
  "motivation": "Boomerang temporarily replaces editor text to submit a reload command while an unsent draft exists.",
  "name": "Draft Return",
  "participants": [
    {
      "name": "ctx.ui.getEditorText",
      "role": "Captures the current main-editor draft.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "ctx.ui.setEditorText",
      "role": "Replaces the main-editor text.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "ctx.ui.setEditorComponent",
      "role": "Installs the single custom editor factory.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "CustomEditor",
      "role": "Preserves application controls for editor replacements.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/tui.md#handle-keyboard-input-and-focus"
    },
    {
      "name": "Captured draft",
      "role": "Survives temporary editor-driven submission.",
      "url": null
    }
  ],
  "pi": "1.0.3",
  "related": [
    {
      "how": "separates draft from committed state",
      "id": "draft-fence",
      "jsonUrl": "https://pi-tui.ratstack.sh/patterns/draft-fence.json",
      "mdUrl": "https://pi-tui.ratstack.sh/patterns/draft-fence.md",
      "name": "Draft Fence",
      "url": "https://pi-tui.ratstack.sh/patterns/draft-fence/"
    }
  ],
  "sampleCode": {
    "code": "// Draft Return: restore a captured prompt after temporary editor submission.\nimport { CustomEditor } from \"@earendil-works/pi-coding-agent\";\nimport type { PatternStory } from \"../../../src/pattern.ts\";\n\nexport const story: PatternStory = {\n  id: \"draft-return\", title: \"Draft Return\", kind: \"screen\",\n  apis: [\"getEditorText\", \"setEditorText\", \"setEditorComponent\", \"CustomEditor\"],\n  states: [\n    { id: \"draft\", label: \"Existing draft\" },\n    { id: \"temporary\", label: \"Temporary submission\", steps: [{ type: \"action\", name: \"submit\" }] },\n    { id: \"restored\", label: \"Draft restored\", steps: [{ type: \"action\", name: \"finish\" }] },\n  ],\n  setup({ ui, theme, action }) {\n    // Lifecycle: draft -> temporary -> restored (success or failure).\n    let capturedDraft = \"\";\n    ui.setEditorText(\"Review the parser changes\\nand keep the public API small.\");\n    ui.setWidget(\"draft\", [theme.fg(\"accent\", \"Unsent prompt · editor owns the draft\")]);\n    action(\"submit\", () => {\n      capturedDraft = ui.getEditorText();\n      ui.setEditorComponent((tui, editorTheme, keys) => new CustomEditor(tui, editorTheme, keys));\n      ui.setEditorText(\"/reload\");\n      ui.setWidget(\"draft\", [theme.fg(\"warning\", \"Temporary command · draft captured\"),\n        theme.fg(\"muted\", \"Synthetic submission; no reload runs.\")]);\n    });\n    action(\"finish\", () => {\n      try {\n        // Synthetic failed submission; no live command or agent is invoked.\n        ui.setStatus(\"submit\", theme.fg(\"warning\", \"reload skipped\"));\n      } finally {\n        ui.setEditorComponent(undefined);\n        if (capturedDraft) ui.setEditorText(capturedDraft);\n        ui.setWidget(\"draft\", [theme.fg(\"success\", \"Original draft restored in finally\")]);\n      }\n    });\n  },\n};\n",
    "lang": "ts",
    "path": "stories/patterns/lifecycle/draft-return.ts"
  },
  "states": [
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Draft Return, Existing draft state, 40 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/draft-40-dark.bf920a739d3e.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Draft Return, Existing draft state, 40 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/draft-40-light.6b4ac5b4f9f1.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Draft Return, Existing draft state, 60 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/draft-60-dark.a7016488bcc8.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Draft Return, Existing draft state, 60 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/draft-60-light.4d036dd77597.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Draft Return, Existing draft state, 80 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/draft-80-dark.a1ac69abfecc.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Draft Return, Existing draft state, 80 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/draft-80-light.14dbff27b070.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Draft Return, Existing draft state, 120 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/draft-120-dark.4c718c59fbbd.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Draft Return, Existing draft state, 120 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/draft-120-light.3d6d36f86219.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Show a synthetic unsent prompt in the editor.",
      "id": "draft",
      "label": "Existing draft",
      "problems": []
    },
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Draft Return, Temporary submission state, 40 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/temporary-40-dark.4713d5dbfbfd.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Draft Return, Temporary submission state, 40 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/temporary-40-light.9202a5efd393.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Draft Return, Temporary submission state, 60 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/temporary-60-dark.e391ac232894.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Draft Return, Temporary submission state, 60 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/temporary-60-light.fc2886a2f751.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Draft Return, Temporary submission state, 80 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/temporary-80-dark.a2438f3fe1cf.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Draft Return, Temporary submission state, 80 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/temporary-80-light.3dc9fe2b3ce1.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Draft Return, Temporary submission state, 120 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/temporary-120-dark.15901e6fa62c.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Draft Return, Temporary submission state, 120 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/temporary-120-light.ad58d6f32bb9.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Show a temporary command replacing the captured text.",
      "id": "temporary",
      "label": "Temporary submission",
      "problems": []
    },
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Draft Return, Draft restored state, 40 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/restored-40-dark.904b8fd695c2.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Draft Return, Draft restored state, 40 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/restored-40-light.0e01af6583c8.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Draft Return, Draft restored state, 60 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/restored-60-dark.77cbaf60553e.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Draft Return, Draft restored state, 60 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/restored-60-light.f8922f41c42c.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Draft Return, Draft restored state, 80 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/restored-80-dark.1c6b0ce9c424.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Draft Return, Draft restored state, 80 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/restored-80-light.1a92fcb7572c.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Draft Return, Draft restored state, 120 columns, dark theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/restored-120-dark.ede1ffaa7828.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Draft Return, Draft restored state, 120 columns, light theme, 11 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": 484,
          "rows": 11,
          "still": "https://pi-tui.ratstack.sh/frames/draft-return/restored-120-light.c9b751d32a8d.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Restore the original nonempty draft after submission or failure.",
      "id": "restored",
      "label": "Draft restored",
      "problems": []
    }
  ],
  "structure": "capture draft -> temporary submit\nfinally -> restore captured text",
  "thumbnails": {
    "dark": {
      "animation": null,
      "src": "https://pi-tui.ratstack.sh/thumbs/draft-return/dark.37d2cb842060.webp"
    },
    "light": {
      "animation": null,
      "src": "https://pi-tui.ratstack.sh/thumbs/draft-return/light.a5f1406a0af0.webp"
    }
  },
  "url": "https://pi-tui.ratstack.sh/patterns/draft-return/",
  "widths": [
    40,
    60,
    80,
    120
  ]
}
