diff --git a/apps/desktop/src/app/chat/composer/directive-actions.test.tsx b/apps/desktop/src/app/chat/composer/directive-actions.test.tsx index 22e5f245d9..4491e8b97a 100644 --- a/apps/desktop/src/app/chat/composer/directive-actions.test.tsx +++ b/apps/desktop/src/app/chat/composer/directive-actions.test.tsx @@ -150,6 +150,11 @@ describe('ComposerDirectiveActions', () => { }) expect(pillValue()).toBe('https://example.com') + + const button = screen.getByRole('button') + fireEvent.pointerOut(button, { relatedTarget: button.firstElementChild }) + act(() => { vi.advanceTimersByTime(750) }) + expect(pillValue()).toBe('https://example.com') }) it('still hides shortly after the pointer leaves the pill for good', () => { @@ -162,9 +167,9 @@ describe('ComposerDirectiveActions', () => { fireEvent.pointerOut(chip, { relatedTarget: null }) fireEvent.mouseEnter(screen.getByRole('button').parentElement!) fireEvent.mouseLeave(screen.getByRole('button').parentElement!) - act(() => { - vi.advanceTimersByTime(500) - }) + act(() => { vi.advanceTimersByTime(300) }) + fireEvent.pointerOut(document.body, { relatedTarget: document.documentElement }) + act(() => { vi.advanceTimersByTime(200) }) expect(pillValue()).toBeNull() }) diff --git a/apps/desktop/src/app/chat/composer/directive-actions.tsx b/apps/desktop/src/app/chat/composer/directive-actions.tsx index 911972b6b2..07e46d0373 100644 --- a/apps/desktop/src/app/chat/composer/directive-actions.tsx +++ b/apps/desktop/src/app/chat/composer/directive-actions.tsx @@ -96,8 +96,10 @@ export function ComposerDirectiveActions({ editorRef }: { editorRef: RefObject