Skip to content

fix(max): constrain chat textarea height#30

Open
lordspline wants to merge 1 commit into
masterfrom
capy/constrain-chat-textarea-height
Open

fix(max): constrain chat textarea height#30
lordspline wants to merge 1 commit into
masterfrom
capy/constrain-chat-textarea-height

Conversation

@lordspline

@lordspline lordspline commented Jun 19, 2026

Copy link
Copy Markdown

Problem

Long messages in the PostHog AI agent chat cause the input box to grow beyond 100% of the viewport height, making the send button inaccessible.

Changes

  • Added QuestionInput__textarea class to the AI chat input component
  • Constrained textarea max-height to min(40vh, 20rem) with vertical overflow scrolling
  • Added test to verify the constrained scrolling styles are applied

How did you test this code?

Ran automated tests in QuestionInput.test.tsx—all tests pass, including new test that verifies the textarea renders with constrained scrolling styles.

Open POST-103 POST-103


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

…ed offscreen on long messages

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 19, 2026 — with Capy AI
@capy-ai

capy-ai Bot commented Jun 19, 2026

Copy link
Copy Markdown

🎨 Visual QA — fix(max): constrain chat textarea height

Surface: Max AI chat (/ai) — textarea on QuestionInput
Tested: desktop 1280×900 and narrow 375×812, empty state and long-text state (12 lines)


Empty state — no visible change (✅ expected)

Desktop empty


Long text — desktop 1280×900

Before (master): textarea grows to ~10 rows with no height cap, send button stays on-screen due to maxRows={10} already limiting it.
After (PR): max-height: min(40vh, 20rem) kicks in — textarea is capped at 20rem (320px), vertical scrollbar appears, send button always visible.

Desktop long text comparison


Long text — narrow 375×812

The constraint matters most here: min(40vh=150px, 20rem=320px)150px cap, so at mobile-viewport heights the textarea scrolls well within the visible area.

Narrow long text comparison


Summary

Empty Long text (desktop) Long text (narrow)
Send button accessible ✅ both ✅ both ✅ both
Textarea height capped ✅ after only ✅ after only
Scrollbar appears ✅ after only ✅ after only
Layout breaks ❌ none ❌ none

Result: ✅ Looks correct. The constraint applies cleanly, the send button remains reachable, and empty state is unaffected. No layout regressions observed at either viewport.

Screenshots captured against live local dev stack on master + PR CSS applied via Vite HMR.

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.

1 participant