Skip to content

feat(message): add human-like typing simulation#106

Open
abdelrahmanmegaly-jpg wants to merge 11 commits into
rmyndharis:mainfrom
abdelrahmanmegaly-jpg:feature/message-humanize
Open

feat(message): add human-like typing simulation#106
abdelrahmanmegaly-jpg wants to merge 11 commits into
rmyndharis:mainfrom
abdelrahmanmegaly-jpg:feature/message-humanize

Conversation

@abdelrahmanmegaly-jpg
Copy link
Copy Markdown

@abdelrahmanmegaly-jpg abdelrahmanmegaly-jpg commented May 19, 2026

Description

Add human-like typing simulation to message sending. Messages now show a typing indicator with configurable speed before delivery, making automated messages feel more natural.

Features

  • HumanizeService with configurable typing speeds:
    • slow — 2.5 chars/sec
    • normal — 4.5 chars/sec
    • fast — 6.5 chars/sec
  • Typing indicator via chat.sendStateTyping() with periodic refresh
  • Post-typing hesitation (200ms buffer before send)
  • Max delay cap at 70 seconds
  • Bulk message support with per-message typing delays
  • Dashboard toggle in MessageTester with speed selector

API Usage

POST /api/sessions/:id/messages/send-text
{
  "chatId": "123@c.us",
  "text": "Hello!",
  "humanize": {
    "enabled": true,
    "speed": "slow"
  }
}

Type of Change

  • New feature

Checklist

  • Tests added/updated
  • Lint passes
  • Self-reviewed

whtis and others added 11 commits May 19, 2026 01:08
Add a Simplified Chinese locale to the dashboard, following the i18n
pattern introduced in rmyndharis#64. Chinese is now available alongside English
and Hebrew via the existing sidebar language switcher.

What's included:
- New `src/i18n/locales/zh.json` mirroring the structure of `en.json`,
  covering all pages, components, and toast messages (404 keys + a new
  `common.chinese` label, identical hierarchy to `en.json`)
- `zh` registered in `src/i18n/index.ts` (`supportedLanguages`,
  `resources`) so the language detector picks up `zh-*` browsers
  automatically and the cycle-language button rotates through it
- Language label in `Layout.tsx` switched from a binary `he`/EN ternary
  to a `SupportedLanguage` lookup, so adding more languages later only
  requires extending the map; `zh` shows as `中文`
- `common.chinese` key added to `en.json` for parity with the existing
  `common.english` / `common.hebrew` entries

No code, API, schema, or styling changes outside i18n. RTL list is
unchanged (Chinese is LTR). Existing users see no behavior change
unless their browser is set to `zh-*` or they pick 中文 from the
sidebar.

Verified:
- `npm run build` passes (tsc -b clean, vite build succeeds)
- `npm run lint` reports no new errors (3 pre-existing warnings)
- Key parity check: `en.json` and `zh.json` have identical key sets
  apart from the intentional new `common.chinese`
- Chinese strings present in the production bundle (verified via grep
  on `dist/assets/index-*.js`)
- Add HumanizeService with configurable typing speed (slow/normal/fast)
- Add simulateTyping/simulateRecording to IWhatsAppEngine interface
- Implement typing indicator in WhatsAppWebJsAdapter
- Add humanize option to send-text API endpoint
- Support bulk message humanize with per-message delays
- Add typing speed toggle in MessageTester dashboard
- Add i18n support (English + Hebrew) for humanize labels
- Fix Docker service TypeScript type error in PortBindings
The Swagger document defined the X-API-Key scheme via addApiKey() but never applied it, so no operation declared a security requirement and Swagger UI never sent the key. Requests reached the global ApiKeyGuard with no key and got 401 Unauthorized.

Extract the config into createSwaggerConfig(), apply the scheme globally with addSecurityRequirements, and remove 5 stray @ApiBearerAuth() decorators that referenced an undefined bearer scheme.

Fixes rmyndharis#104
…ish) + add Arabic locale with RTL

- Merge upstream PR rmyndharis#86: Chinese locale (zh.json)
- Merge upstream PR rmyndharis#114: Spanish locale (es.json) + dashboard updates
- Add Arabic translation (ar.json) with full RTL support
- Improve language selector UI (button + dropdown matching sidebar buttons)
- Add Arabic to rtlLanguages alongside Hebrew
- Resolve merge conflicts in Layout.tsx and i18n/index.ts
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.

4 participants