Character or token count is shown when approaching input limits
Why it matters
When the app enforces an input length limit via a maxLength attribute or server-side truncation, users have no way to see how close they are to the ceiling until their prompt is silently cut off or rejected. Long prompts — the exact high-intent content that benefits most from an AI — are the most likely to hit this limit, and silent truncation produces degraded or confusing responses that the user attributes to model quality rather than input handling. A visible counter at the threshold eliminates that failure mode entirely.
Severity rationale
Low because the limit is usually large, but silent truncation of long prompts is especially damaging when it does occur.
Remediation
In src/components/chat/ChatInput.tsx, render a character counter once the user crosses eighty percent of the configured maxLength, and swap it to a destructive color at ninety-five percent so the warning escalates as the limit approaches.
{maxLength && input.length > maxLength * 0.8 && (
<span className={cn("text-xs", input.length > maxLength * 0.95 ? "text-destructive" : "text-muted-foreground")}>
{input.length} / {maxLength}
</span>
)}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI Chat Visibility Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-chat-visibility·automated