feat(quantic): Add a character limit to the follow-up question input#7908
feat(quantic): Add a character limit to the follow-up question input#7908mmitiche wants to merge 5 commits into
Conversation
…t with a live character counter
🦋 Changeset detectedLatest commit: 9dc8103 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
Adds a 300-character limit UX to QuanticGeneratedAnswerFollowUpInput, including a live counter, an over-limit error state, localized validation messaging, and unit test coverage for the new behaviors.
Changes:
- Introduces
MAX_FOLLOW_UP_QUESTION_LENGTH = 300, tracks a trimmedcharacterCount, and blocks submission (button + Enter) when over the limit. - Adds an input footer that renders a live character counter plus an over-limit validation message wired via ARIA attributes.
- Adds a new
quantic_FollowUpInputTooLonglabel with FR/ES translations, and extends Jest tests for the validation/counter behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/quantic/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/quanticGeneratedAnswerFollowUpInput.js | Implements trimmed character counting, over-limit state, submit prevention, ARIA wiring, and formatted validation message. |
| packages/quantic/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/quanticGeneratedAnswerFollowUpInput.html | Adds aria-invalid/aria-describedby, uses submit-prevented flag, and renders the new footer (message + counter). |
| packages/quantic/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/quanticGeneratedAnswerFollowUpInput.css | Adds an error border style for the invalid container state. |
| packages/quantic/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/tests/quanticGeneratedAnswerFollowUpInput.test.js | Adds mocks and a full validation/counter test suite for the new limit behavior. |
| packages/quantic/force-app/main/default/labels/CustomLabels.labels-meta.xml | Adds the new EN label quantic_FollowUpInputTooLong. |
| packages/quantic/force-app/main/translations/fr.translation-meta.xml | Adds FR translation for quantic_FollowUpInputTooLong. |
| packages/quantic/force-app/main/translations/es.translation-meta.xml | Adds ES translation for quantic_FollowUpInputTooLong. |
| .changeset/gold-views-talk.md | Declares a patch changeset for @coveo/quantic. |
| this.refs.askFollowUpInput.value.trim() === '' | ||
| ) { | ||
| return; | ||
| } | ||
| this.sendSubmitFollowUpEvent(); |
| get characterCounterText() { | ||
| return `${this.characterCount} / ${MAX_FOLLOW_UP_QUESTION_LENGTH}`; | ||
| } |
| /** | ||
| * Maximum number of characters allowed in a follow-up question. | ||
| */ | ||
| const MAX_FOLLOW_UP_QUESTION_LENGTH = 300; |
There was a problem hiding this comment.
yeah I would remove the comment its already pretty obvious
@coveo/atomic
@coveo/atomic-hosted-page
@coveo/atomic-legacy
@coveo/atomic-react
@coveo/auth
@coveo/bueno
@coveo/create-atomic
@coveo/create-atomic-component
@coveo/create-atomic-component-project
@coveo/create-atomic-result-component
@coveo/create-atomic-rollup-plugin
@coveo/headless
@coveo/headless-react
@coveo/shopify
commit: |
| } | ||
|
|
||
| get textareaAriaInvalid() { | ||
| return this.isOverCharacterLimit ? 'true' : 'false'; |
There was a problem hiding this comment.
Here im pretty sure you can just do:
return !!this.isOverCharacterLimit;
aria-invalid resolves true and false to "true" / "false"
SFINT-6844
Summary
Adds a 300-character limit to QuanticGeneratedAnswerFollowUpInput component, with a live character counter, an error state, and a localized validation message. Submission is blocked while the question exceeds the limit.
Changes
Demo
Screen.Recording.2026-06-30.at.10.01.04.AM.mov