Skip to content

feat: increase input auto-resize to 200px max#708

Open
hankkyy wants to merge 2 commits into
fathah:mainfrom
hankkyy:feat/auto-resize-input
Open

feat: increase input auto-resize to 200px max#708
hankkyy wants to merge 2 commits into
fathah:mainfrom
hankkyy:feat/auto-resize-input

Conversation

@hankkyy

@hankkyy hankkyy commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Feature

Increase the chat input textarea auto-resize cap from 120px (about 3 lines) to 200px (about 6 lines). Longer messages can be composed more comfortably before the scrollbar appears.

Changes

  • main.css: .chat-input max-height: 120px → 200px
  • ChatInput.tsx: handleInputChange JS max: 120px → 200px

The chat input already auto-resizes, but capped at 120px (~3 lines).
Bump to 200px (~6 lines) so longer messages are more comfortable to
compose before the scrollbar kicks in.
@greptile-apps

greptile-apps Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR increases the chat input textarea's auto-resize cap from 120px (~3 lines) to 200px (~6 lines) for a more comfortable composing experience. Both the CSS max-height and the inline JS height calculation in handleInputChange are updated, but a second height-capping site in the same file was missed.

  • main.css: max-height on .chat-input updated from 120px → 200px — correct and complete.
  • ChatInput.tsxhandleInputChange: JS cap updated from 120 → 200 — correct.
  • ChatInput.tsxautoResize (line 111): Still hardcodes 120px. This callback is invoked when restoring input history and when setText is called via the imperative handle, so those paths will cap the textarea at the old height while direct typing allows the full 200px.

Confidence Score: 4/5

Safe to merge after fixing the missed autoResize cap; the CSS change is correct and the only functional gap is inconsistent textarea height on history navigation and programmatic text injection.

The CSS and the primary typing path are updated correctly. The autoResize callback — used by input history navigation and the imperative setText handle — still clamps at the old 120px, so restoring a long message from history or having another component inject text will produce a shorter textarea than the user would expect after typing the same text directly.

src/renderer/src/screens/Chat/ChatInput.tsx — the autoResize callback at line 111 needs the same 120 → 200 update.

Important Files Changed

Filename Overview
src/renderer/src/screens/Chat/ChatInput.tsx Updated handleInputChange to 200px but missed the autoResize callback at line 111, which is still capped at 120px and is called on history navigation and programmatic setText.
src/renderer/src/assets/main.css CSS max-height for .chat-input correctly updated from 120px to 200px.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User interaction] --> B{How is text set?}
    B -->|Direct typing| C[handleInputChange]
    B -->|History nav ↑↓| D[applyHistoryText → autoResize]
    B -->|Programmatic setText| E[useImperativeHandle.setText → autoResize]
    C --> F[Math.min scrollHeight, 200px ✅]
    D --> G[Math.min scrollHeight, 120px ⚠️ stale]
    E --> G
    F --> H[CSS max-height: 200px]
    G --> I[CSS max-height: 200px — but JS already clamped at 120px]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User interaction] --> B{How is text set?}
    B -->|Direct typing| C[handleInputChange]
    B -->|History nav ↑↓| D[applyHistoryText → autoResize]
    B -->|Programmatic setText| E[useImperativeHandle.setText → autoResize]
    C --> F[Math.min scrollHeight, 200px ✅]
    D --> G[Math.min scrollHeight, 120px ⚠️ stale]
    E --> G
    F --> H[CSS max-height: 200px]
    G --> I[CSS max-height: 200px — but JS already clamped at 120px]
Loading

Comments Outside Diff (1)

  1. src/renderer/src/screens/Chat/ChatInput.tsx, line 107-112 (link)

    P1 The autoResize callback still uses the old 120px cap. This function is called when navigating input history (applyHistoryText) and when text is set programmatically via the setText imperative handle — so those paths will still clamp the textarea at 120px while direct typing now allows 200px, resulting in inconsistent height behavior.

Reviews (1): Last reviewed commit: "feat: increase input textarea max-height..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants