Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/renderer/components/AllChangesDiffModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ export const AllChangesDiffModal: React.FC<AllChangesDiffModalProps> = ({
const editorRefs = useRef<Map<string, monaco.editor.IStandaloneDiffEditor>>(new Map());
const changeDisposables = useRef<Map<string, monaco.IDisposable>>(new Map());

// Close on escape key
useEffect(() => {
if (!open) return;
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Escape') onClose();
};
document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}, [open, onClose]);

const updateFileData = (filePath: string, updater: (data: FileDiffData) => FileDiffData) => {
setFileData((prev) => {
const existing = prev.get(filePath);
Expand Down
10 changes: 10 additions & 0 deletions src/renderer/components/ChangesDiffModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ export const ChangesDiffModal: React.FC<ChangesDiffModalProps> = ({
const [isSaving, setIsSaving] = useState(false);
const [saveError, setSaveError] = useState<string | null>(null);

// Close on escape key
useEffect(() => {
if (!open) return;
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Escape') onClose();
};
document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}, [open, onClose]);

// Load file data when selected file changes
useEffect(() => {
if (!open || !selected || !safeTaskPath) {
Expand Down