From 4f86b97e8d08cb6a67a98e91fc41882fb3c0f67b Mon Sep 17 00:00:00 2001 From: lucaronin Date: Sat, 2 May 2026 20:41:08 +0200 Subject: [PATCH] fix(ai): cap agent composer height --- src/components/AiPanel.test.tsx | 12 ++++++++++++ src/components/AiPanelChrome.tsx | 4 +++- src/components/InlineWikilinkInput.tsx | 4 ++++ src/components/InlineWikilinkParts.tsx | 5 ++++- src/components/WikilinkChatInput.tsx | 7 +++++++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/components/AiPanel.test.tsx b/src/components/AiPanel.test.tsx index aaae70e2..1b62c223 100644 --- a/src/components/AiPanel.test.tsx +++ b/src/components/AiPanel.test.tsx @@ -197,6 +197,18 @@ describe('AiPanel', () => { expect(screen.getByTestId('ai-panel')).toBeTruthy() }) + it('caps long AI agent drafts inside a scrollable composer while keeping send visible', () => { + render() + + const editor = screen.getByTestId('agent-input') + editor.textContent = Array.from({ length: 40 }, (_, index) => `Line ${index + 1}`).join('\n') + fireEvent.input(editor) + + expect(editor).toHaveClass('max-h-[160px]', 'overflow-y-auto', 'overscroll-contain') + expect(editor).toHaveStyle({ maxHeight: '160px', overflowY: 'auto' }) + expect(screen.getByTestId('agent-send')).toBeVisible() + }) + it('calls onClose when close button is clicked', () => { const onClose = vi.fn() render() diff --git a/src/components/AiPanelChrome.tsx b/src/components/AiPanelChrome.tsx index c6284926..fcf4cbc7 100644 --- a/src/components/AiPanelChrome.tsx +++ b/src/components/AiPanelChrome.tsx @@ -369,7 +369,7 @@ export function AiPanelComposer({ style={{ padding: '8px 12px' }} >
-
+