feat: warn as the task description fills up - #550
Merged
anoopcodehack merged 1 commit intoSep 18, 2026
Merged
anoopcodehack merged 1 commit into
anoopcodehack merged 1 commit into
Conversation
Closes anoopcodehack#512. The issue asks for a colour warning as the description approaches its limit. Three things stood in the way of writing that as described: `descCount` does not exist. The count was computed inline, and twice in a row, once for the number and once for the plural of "word". The counter shows words, not characters, while the issue formats `{descCount}/300` as if it were characters. And there was no limit to approach. The textarea had no `maxLength`, and `description: { type: String, default: "" }` in the Task model has no constraint either. So this adds the missing piece first: a `DESCRIPTION_MAX_LENGTH` next to the `TITLE_MAX_LENGTH` the title already uses, and the same `maxLength` on the field. 500 rather than the 300 from the issue, because the AI button asks Gemini for "2-3 sentences" and that lands around 150 to 400 characters. At 300 the field would cut off the text the button had just produced. The word count stays where it was. Next to it sits the character budget, in the theme's muted colour, yellow from 80 percent and red from 92 percent. Both thresholds are fractions of the constant, so they follow if the budget is ever changed. Note that `maxLength` only limits typing and pasting. The AI generator writes into the field programmatically, so a longer answer still lands there and shows over budget in red rather than being silently cut.
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.
Closes #512.
The issue asks for a colour warning as the description approaches its limit. Three things stood in the way of writing it exactly as described:
descCountdoes not exist. The count was computed inline, and twice in a row, once for the number and once for the plural of "word".The counter shows words, not characters, while the issue formats
{descCount}/300as if it were characters.And there was no limit to approach at all. The textarea has no
maxLength, anddescription: { type: String, default: "" }in the Task model has no constraint either.So the missing piece comes first: a
DESCRIPTION_MAX_LENGTHnext to theTITLE_MAX_LENGTHthe title field already uses, and the samemaxLengthon the textarea. I went with 500 rather than the 300 from the issue, because the AI button asks Gemini for "2-3 sentences" and that lands around 150 to 400 characters. At 300 the field would cut off the text the button had just produced. Happy to drop it to 300 if you prefer the number from the ticket.The word count stays where it was. The character budget sits next to it in the muted theme colour, turns yellow at 80 percent and red at 92 percent. Both thresholds are fractions of the constant so they follow along if the budget is ever changed.
One note:
maxLengthonly limits typing and pasting. The AI generator writes into the field programmatically, so a longer answer still lands there in full and shows over budget in red instead of being silently cut.Checked with
npm run buildindevboard/client.