IMPLEMENT: auto-grow PromptInput up to 8 lines (#237)#240
Merged
DaveHudson merged 4 commits intomainfrom May 1, 2026
Merged
Conversation
Fixed the textarea in ChatPanel not growing as the user types multi-line prompts. The auto-grow useEffect had an empty dependency array so it only fired at mount; changing the dep to [input] makes it recalculate height on every keystroke. Also removed the conflicting max-h-32 Tailwind class (replaced by the inline-style cap) and replaced the hardcoded 160px ceiling with a computed value of lineHeight×8 + vertical padding so the limit correctly represents 8 lines regardless of font metrics. Files changed: - apps/desktop/src/renderer/src/components/chat/ChatPanel.tsx - apps/desktop/tests/components/chat/ChatPanel.test.tsx
Fix `./gh` typo in eligibility.test.ts (no such file; only github.ts exists). The import type was silently erased at runtime so tests passed, but tsc caught the error. Add a test asserting the textarea height shrinks back when input is cleared.
DaveHudson
commented
May 1, 2026
| // Auto-grow the textarea up to a cap so prompts with a few lines | ||
| // don't force the user to scroll a single-line input. | ||
| // Auto-grow the textarea up to 8 lines; content scrolls beyond that. | ||
| // biome-ignore lint/correctness/useExhaustiveDependencies: input is the intended trigger; the effect reads the DOM via textareaRef |
Collaborator
Author
There was a problem hiding this comment.
We do NOT want to biome-ignore, bad pattern.
Also why this useEffect? We have Tailwind & Shadcn, surely there are better options than this?
Collaborator
Author
There was a problem hiding this comment.
Fixed in bfa9866.
- Auto-grow is now CSS-only via Tailwind v4's
field-sizing-contentplus amax-h-[calc(8*1.25rem+1.25rem)]cap andoverflow-y-auto. Electron 35 = Chromium 134, sofield-sizing: contentis supported. The useEffect, the textareaRef, and the inline-style writes are all gone. - The other
biome-ignore(scroll-on-new-message) is also gone — extractedmessages.lengthto a const and depend on that, which satisfies useExhaustiveDependencies without a suppression. - Added a rule to
.sandcastle/CODING_STANDARDS.mdbanningbiome-ignore/@ts-ignore/eslint-disable. If a rule fires we fix the underlying code.
Tests: replaced the JSDOM scrollHeight / style.height assertions with className-contract checks, since height is now a pure CSS concern.
Drop the JS-driven textarea height effect and biome-ignore in favour of the CSS `field-sizing: content` property paired with a `max-h` cap and `overflow-y-auto`. Tailwind v4 ships the `field-sizing-content` utility and Electron 35 (Chromium 134) supports the property natively. Also collapse the scroll-on-new-message effect to depend on `messages.length` (extracted to a const so biome no longer flags the dependency) instead of suppressing useExhaustiveDependencies. Tests: replace JSDOM scrollHeight/style.height assertions with className contract checks — height is now a CSS concern, not observable behaviour in JSDOM. Add a CODING_STANDARDS rule banning biome-ignore / @ts-ignore / eslint-disable across the codebase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #237