summaryrefslogtreecommitdiff
path: root/makima/frontend/src/routes/document-directives.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/routes/document-directives.tsx')
-rw-r--r--makima/frontend/src/routes/document-directives.tsx21
1 files changed, 9 insertions, 12 deletions
diff --git a/makima/frontend/src/routes/document-directives.tsx b/makima/frontend/src/routes/document-directives.tsx
index b89e841..63d0b96 100644
--- a/makima/frontend/src/routes/document-directives.tsx
+++ b/makima/frontend/src/routes/document-directives.tsx
@@ -1391,17 +1391,11 @@ function EditorShell({
);
}
- // Synthesise a directive-shaped object whose `goal` is the document body.
- // DocumentEditor was originally written against DirectiveWithSteps, so we
- // can keep its shape by overriding `goal` with `doc.body` and `title`
- // with the document's filename label. The steps panel still draws from
- // the real directive (passed through StepsBlockContextProvider).
+ // The contract title is the filename label; the contract body is the
+ // editor body. DocumentEditor takes these directly (no more synthesis
+ // hack) — `directive` is still passed for orchestrator state and the
+ // embedded steps panel via StepsBlockContextProvider.
const docTitle = `${fileLabel(doc, directive)}.md`;
- const directiveAsDocument = {
- ...directive,
- goal: doc.body,
- title: docTitle,
- };
return (
<div className="flex-1 flex flex-col h-full overflow-hidden">
@@ -1420,8 +1414,11 @@ function EditorShell({
// when the user switches documents, so the previous doc's body
// doesn't bleed into the new one.
key={doc.id}
- directive={directiveAsDocument}
- onUpdateGoal={onUpdateDocumentBody}
+ directive={directive}
+ documentId={doc.id}
+ title={docTitle}
+ body={doc.body}
+ onUpdateBody={onUpdateDocumentBody}
onCleanup={async () => {
await cleanup();
}}