Skip to content

fix(max): constrain AI chat composer height#4

Open
lordspline wants to merge 2 commits into
masterfrom
capy/fix-composer-scroll-overflow
Open

fix(max): constrain AI chat composer height#4
lordspline wants to merge 2 commits into
masterfrom
capy/fix-composer-scroll-overflow

Conversation

@lordspline

@lordspline lordspline commented Jun 17, 2026

Copy link
Copy Markdown

Problem

PostHog AI chat composer can grow too tall when a long prompt is pasted, which can leave the send and queue controls unreachable in constrained viewports.

Fixes PostHog#62461

Changes

  • Cap the Max composer content to the available dynamic viewport.
  • Let queued messages scroll instead of pushing the input controls out of reach.
  • Cap the chat textarea with Max-specific styling so it still auto-grows below the cap and scrolls internally above it.
  • Add component coverage for long pasted content, Enter vs Shift+Enter submission behavior, and disabled/loading controls.

How did you test this code?

Agent-authored verification:

  • pnpm --filter=@posthog/frontend format
  • hogli test frontend/src/scenes/max/components/QuestionInput.test.tsx
  • pnpm --filter=@posthog/frontend typegen:write to generate ignored local Kea type files before type checking
  • pnpm --filter=@posthog/frontend typescript:check
  • Browser verification against local PostHog: pasted a 100-line prompt in the main scene, thread view on a laptop viewport, thread view on a narrow viewport, side panel on desktop and narrow viewports, and an extra very-short viewport; confirmed the textarea scrolls internally and the send control remains visible/reachable. Also recorded a paste, internal-scroll, and send flow.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

Not needed for this UI bug fix.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Captain Capy implemented this from a human-directed bug report. I reproduced and measured the composer in the main scene, side panel, laptop, narrow, and very-short viewport cases before changing the layout.

I chose a Max-specific viewport cap rather than changing the shared LemonTextArea API, after checking the queued-message block, slash-command autocomplete, and hands-free surface. The goal is to preserve existing textarea autosize, keyboard behavior, focus, labeling, shared-thread behavior, and autocomplete anchoring while preventing the composer from consuming the viewport.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@lordspline lordspline added the capy Generated by capy.ai label Jun 17, 2026 — with Capy AI
@capy-ai capy-ai Bot changed the title fix(ai): constrain composer height for long prompts fix(max): constrain AI chat composer height Jun 17, 2026
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI chat input box blocks access to send button on long messages

1 participant