diff --git a/src/lib/components/comments/CommentComposer.svelte b/src/lib/components/comments/CommentComposer.svelte index 154920bce6..10cab9ed09 100644 --- a/src/lib/components/comments/CommentComposer.svelte +++ b/src/lib/components/comments/CommentComposer.svelte @@ -101,7 +101,7 @@ : 'auto'} class="relative {embedded ? '' - : `rounded-2xl border border-gray-100/50 dark:border-gray-850/50 hover:border-gray-200 focus-within:border-gray-100/70 hover:dark:border-gray-800 focus-within:dark:border-gray-800/70 transition bg-white/5 dark:bg-gray-500/5 ps-3 pb-2.5 ${contextLabel || quote ? 'pt-1' : 'pt-2.5'}`} {($settings?.highContrastMode ?? + : `rounded-2xl border border-gray-100/50 dark:border-gray-850/50 hover:border-gray-200/70 focus-within:border-gray-100/70 hover:dark:border-gray-800/70 focus-within:dark:border-gray-800/70 transition bg-white/5 dark:bg-gray-500/5 ps-3 pb-2.5 ${contextLabel || quote ? 'pt-1' : 'pt-2.5'}`} {($settings?.highContrastMode ?? false) ? 'focus-within:outline focus-within:outline-2 focus-within:-outline-offset-2 focus-within:outline-blue-500' : ''}" diff --git a/src/lib/components/comments/CommentHighlights.svelte b/src/lib/components/comments/CommentHighlights.svelte index 161a6e3a5f..722a6bd6ca 100644 --- a/src/lib/components/comments/CommentHighlights.svelte +++ b/src/lib/components/comments/CommentHighlights.svelte @@ -21,6 +21,7 @@ import ProfileImage from '$lib/components/chat/Messages/ProfileImage.svelte'; import { WEBUI_API_BASE_URL } from '$lib/constants'; import CommentComposer from './CommentComposer.svelte'; + import CommentReplyComposer from './CommentReplyComposer.svelte'; import { scrollToComment } from '$lib/utils'; import XMark from '$lib/components/icons/XMark.svelte'; @@ -224,7 +225,7 @@ hovered = []; }; const leave = () => { - if (!$commentSelectionDraft) hide(); + if (!$commentSelectionDraft && !preview?.contains(document.activeElement)) hide(); }; const reveal = async (items: LocatedComment[], rect: DOMRect) => { referenceRect = rect; @@ -249,7 +250,7 @@ ); }; const move = (event: MouseEvent) => { - if ($commentSelectionDraft) return; + if ($commentSelectionDraft || preview?.contains(document.activeElement)) return; if (popup?.popper.contains(event.target as Node)) return; if (event.buttons || !window.getSelection()?.isCollapsed) { hide(); @@ -309,7 +310,11 @@ } return; } - if (event.key === 'Escape' && hovered.length) { + if ( + event.key === 'Escape' && + hovered.length && + !document.getElementById('suggestions-container') + ) { event.stopPropagation(); hide(); } @@ -322,7 +327,7 @@ } }; const scroll = (event: Event) => { - if ($commentSelectionDraft) { + if ($commentSelectionDraft || preview?.contains(document.activeElement)) { void popup?.popperInstance?.update(); return; } @@ -444,7 +449,7 @@ {/if} {#each hovered as { comment } (comment.id)} -