Skip to content

feat: warn as the task description fills up - #550

Merged
anoopcodehack merged 1 commit into
anoopcodehack:mainfrom
Mario-Mohar:feature/description-limit-warning
Sep 18, 2026
Merged

anoopcodehack merged 1 commit into
anoopcodehack:mainfrom
Mario-Mohar:feature/description-limit-warning

Conversation

@Mario-Mohar

Copy link
Copy Markdown
Contributor

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:

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 at all. The textarea has no maxLength, and description: { type: String, default: "" } in the Task model has no constraint either.

So the missing piece comes first: a DESCRIPTION_MAX_LENGTH next to the TITLE_MAX_LENGTH the title field already uses, and the same maxLength on 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: maxLength only 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 build in devboard/client.

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.
@anoopcodehack
anoopcodehack merged commit 1ee59d0 into anoopcodehack:main Sep 18, 2026
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.

Warn user when description approaches word limit 📝

2 participants