Skip to content

Add message input validation and character limit warnings for chat #15

Description

@HRISHIKESH-hackoff

Description

Currently, the chat message input in OpenMindWell doesn't have proper input validation or character limit warnings. This can lead to:

  • Users sending empty messages
  • Extremely long messages that degrade UX
  • No visual feedback about message length limits

Proposed Solution

Add the following enhancements to the chat input component:

  1. Input Validation: Prevent sending empty or whitespace-only messages
  2. Character Counter: Display current character count vs. limit (suggest 500 char limit)
  3. Visual Warnings: Show warnings when approaching the limit (e.g., 80% full)
  4. Disabled State: Disable send button when input is empty
  5. User Feedback: Toast notification for validation errors

Implementation Details

  • Update the chat input component in frontend/src/components/
  • Add client-side validation before sending to backend
  • Add styling for character counter and warning indicators
  • Update backend to also validate and reject invalid messages

Testing

  • Test empty message rejection
  • Test whitespace-only message rejection
  • Test character counter accuracy
  • Test visual warnings at different percentages
  • Test on mobile and desktop viewports

Type

Enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions