Skip to content

[MKT_799]:feat/Add client-side daily message limit via localStorage#20

Open
jaaaaavier wants to merge 2 commits intomasterfrom
feat/client-side-daily-message-limit
Open

[MKT_799]:feat/Add client-side daily message limit via localStorage#20
jaaaaavier wants to merge 2 commits intomasterfrom
feat/client-side-daily-message-limit

Conversation

@jaaaaavier
Copy link
Contributor

@jaaaaavier jaaaaavier commented Mar 23, 2026

Description

We add a soft-limit to messages a user can send in a day

Changes Made

  • Adds a useMessageLimit hook that tracks daily message usage in localStorage, resetting automatically at midnight
  • Limit is set to 40 messages/day
  • Blocks handleSend in ChatContext when the limit is reached
  • Disables the chat input and shows the already-translated DailyLimit placeholder when the limit is hit

Additional Notes

Need to add a new environment variable

@jaaaaavier jaaaaavier self-assigned this Mar 23, 2026
@jaaaaavier jaaaaavier added the enhancement New feature or request label Mar 23, 2026
@jaaaaavier jaaaaavier requested review from sg-gs and xabg2 March 23, 2026 14:01
@jaaaaavier jaaaaavier requested review from sg-gs and xabg2 March 24, 2026 11:06
@sg-gs
Copy link
Member

sg-gs commented Mar 24, 2026

Remember to add the environment variable @jaaaaavier, I have just reviewed the code itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants