Skip to content

Commit 7cc8db9

Browse files
limeburstclaude
andcommitted
control-plane: Fix TextModel disposed error by conditionally rendering DiffEditor
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b1e91ac commit 7cc8db9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

control-plane/src/components/Editor.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export default function Editor({
7979

8080
return (
8181
<div className={`flex flex-col h-full ${showSaveButton ? 'gap-4' : ''}`}>
82-
<div className="flex-1 min-h-0 relative">
83-
<div className={showDiff ? "absolute inset-0" : "hidden"}>
82+
<div className="flex-1 min-h-0">
83+
{showDiff ? (
8484
<DiffEditor
8585
original={contents}
8686
modified={value}
@@ -103,8 +103,7 @@ export default function Editor({
103103
readOnly: true,
104104
}}
105105
/>
106-
</div>
107-
<div className={showDiff ? "hidden" : "h-full"}>
106+
) : (
108107
<MonacoEditor
109108
value={value}
110109
height="100%"
@@ -119,7 +118,7 @@ export default function Editor({
119118
scrollBeyondLastLine: false,
120119
}}
121120
/>
122-
</div>
121+
)}
123122
</div>
124123
{showSaveButton && (
125124
<div className="flex gap-2">

0 commit comments

Comments
 (0)