Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ export const UserEditComposer: FC<UserEditComposerProps> = ({ cwd, gateway, sess
autoCapitalize="off"
autoCorrect="off"
className={cn(
'ui-prompt-input-editor__input max-h-48 w-full resize-none bg-transparent p-0 pr-7 text-[length:var(--conversation-text-font-size)] text-foreground/95 outline-none',
'ui-prompt-input-editor__input max-h-48 w-full resize-none overflow-y-auto bg-transparent p-0 pr-7 text-[length:var(--conversation-text-font-size)] text-foreground/95 outline-none',
'empty:before:content-[attr(data-placeholder)] empty:before:text-muted-foreground/60',
'**:data-ref-text:cursor-default',
expanded ? 'min-h-16' : 'min-h-[1.25rem]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,26 @@ describe('click-to-edit user message', () => {
expect(container.querySelector('[data-slot="aui_edit-composer-root"]')).toBeTruthy()
})
})

// A long previous prompt is capped at max-h-48 in the edit composer. Without
// an overflow rule the overflow is clipped with no way to scroll, hiding the
// tail of the prompt. The editor must scroll its own overflow (like the main
// composer's editor does).
it('keeps the edit composer editor scrollable when the prompt overflows the cap', async () => {
const { container } = render(<IncrementalHarness onEdit={async () => {}} />)

const bubble = await screen.findByRole('button', { name: 'Edit message' })

fireEvent.click(bubble)

const editor = await waitFor(() => {
const node = container.querySelector('[contenteditable="true"]')
expect(node).toBeTruthy()

return node as HTMLElement
})

expect(editor.className).toContain('max-h-48')
expect(editor.className).toContain('overflow-y-auto')
})
})
Loading