fix(editor): dispose compose DiffEditor models after widget reset (#1828)

Closing the compose or git diff dialog threw a Monaco console error
because the library disposed TextModels while DiffEditorWidget still
held them.
This commit is contained in:
Anso
2026-08-13 10:32:26 -04:00
committed by GitHub
parent f5178889eb
commit 93a5ba9f21
5 changed files with 132 additions and 6 deletions
@@ -1,5 +1,5 @@
import { useState, Suspense } from 'react';
import { DiffEditor } from '@/lib/monacoLoader';
import { SafeDiffEditor } from '@/lib/SafeDiffEditor';
import { AlertTriangle, Loader2 } from 'lucide-react';
import { Modal, ModalHeader, ModalFooter, ConfirmModal } from '@/components/ui/modal';
import { Tabs, TabsList, TabsTrigger, TabsHighlight, TabsHighlightItem } from '@/components/ui/tabs';
@@ -120,7 +120,7 @@ export function GitSourceDiffDialog({
<div className="px-6 pb-4 pt-3">
<div className="h-[55vh] border border-glass-border rounded-md overflow-hidden">
<Suspense fallback={<div className="w-full h-full" aria-busy="true" />}>
<DiffEditor
<SafeDiffEditor
height="100%"
language={effectiveTab === 'compose' ? 'yaml' : 'ini'}
theme={isDarkMode ? 'vs-dark' : 'vs'}