Skip to content
Open
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
5 changes: 5 additions & 0 deletions frontend/src/scenes/max/components/QuestionInput.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
animation-delay: calc(var(--index) * 25ms);
}

.QuestionInput__Textarea {
max-height: clamp(6rem, calc(100vh - 12rem), 16rem);
overflow-y: auto !important;
}

@keyframes QuestionInput__QuestionSuggestion__slide-in-fade-down {
from {
opacity: 0;
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/scenes/max/components/QuestionInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jest.mock(
{ virtual: true }
)

describe('QuestionInput slash command autocomplete', () => {
describe('QuestionInput', () => {
let maxLogicInstance: ReturnType<typeof maxLogic.build>
let threadLogicInstance: ReturnType<typeof maxThreadLogic.build>

Expand Down Expand Up @@ -61,6 +61,12 @@ describe('QuestionInput slash command autocomplete', () => {

const slashCommandItem = (): HTMLElement | null => screen.queryByText('/init')

it('keeps long prompts scrollable inside the textarea', () => {
const input = screen.getByRole('textbox')

expect(input).toHaveClass('QuestionInput__Textarea')
})

it('reopens the popover after Escape dismisses it and a fresh slash is typed', async () => {
const input = screen.getByRole('textbox') as HTMLTextAreaElement

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/max/components/QuestionInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ export const QuestionInput = React.forwardRef<HTMLDivElement, QuestionInputProps
minRows={1}
maxRows={10}
className={cn(
'!border-none !bg-transparent min-h-16 py-2 pl-2 resize-none',
'QuestionInput__Textarea !border-none !bg-transparent min-h-16 py-2 pl-2 resize-none',
handsFreeFlagEnabled ? 'pr-20' : 'pr-12'
)}
hideFocus
Expand Down