Skip to content

Commit 6c84d7b

Browse files
committed
Add Inline Diff Panel Click Outside to Close Functionality
- Implemented a feature to close the inline diff panel when clicking outside of it, enhancing user interaction by allowing access to other UI elements without manual closure. - This addition improves the overall usability of the inline diff feature, ensuring a smoother experience when navigating the application.
1 parent b2cef29 commit 6c84d7b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎renderer.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,14 @@ document.addEventListener('DOMContentLoaded', () => {
10121012
inlineDiffReject.addEventListener('click', () => closeInlineDiff('reject'));
10131013
inlineDiffAccept.addEventListener('click', () => closeInlineDiff('accept'));
10141014

1015+
// Close panel when clicking outside of it (allows clicking tabs, sidebar, etc.)
1016+
document.addEventListener('mousedown', (e) => {
1017+
if (inlineDiffPanel.classList.contains('hidden')) return;
1018+
if (!inlineDiffPanel.contains(e.target)) {
1019+
closeInlineDiff('reject');
1020+
}
1021+
});
1022+
10151023
// Keyboard shortcuts for inline diff
10161024
document.addEventListener('keydown', (e) => {
10171025
if (inlineDiffPanel.classList.contains('hidden')) return;

0 commit comments

Comments
 (0)