Remove 1000-char chat input limit and allow expanding textarea (fixes #2399) #6
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.
Purpose
Remove the hard-coded 1000 character limit on the chat question input and let the textarea grow (up to a visual cap) so longer prompts are supported. This addresses scenarios requiring large context prompts and fixes issue Azure-Samples#2399.
Screenshots of entering long text- it will scroll internally in the text field once it gets fairly large:
Does this introduce a breaking change?
When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.
Does this require changes to learn.microsoft.com docs?
The tutorial flow / screenshots are unaffected (input just allows longer text). No doc changes required.
Type of change
What was changed
app/frontend/src/components/QuestionInput/QuestionInput.tsx
: Removed the 1000-char guard; enabledautoAdjustHeight
.app/frontend/src/components/QuestionInput/QuestionInput.module.css
: Replaced fixed height withmin-height
, adjusted line-height, and added amax-height
+ scroll to prevent runaway growth.Rationale
Users reported the 1000 character constraint was limiting legitimate use cases (issue Azure-Samples#2399). Modern chat prompts can exceed that length without harming backend processing; the UI now gracefully handles larger inputs.
Code quality checklist
python -m pytest
) except for unrelated existing test flakiness (none introduced by this change).python -m pytest --cov
to verify 100% coverage of added lines (N/A: trivial logic removal)python -m mypy
(or ensured CI will) to check for type errors (no TS/py typing impact beyond deletion)Additional notes
An optional future enhancement could add a soft warning or token estimate for very large prompts instead of a hard cap.