Skip to content

feat: human-like typing, Arabic locale, auto-reconnect, WebSocket real-time UI#119

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

feat: human-like typing, Arabic locale, auto-reconnect, WebSocket real-time UI#119
abdelrahmanmegaly-jpg wants to merge 11 commits into
rmyndharis:mainfrom
abdelrahmanmegaly-jpg:feature/message-humanize-clean

Conversation

@abdelrahmanmegaly-jpg
Copy link
Copy Markdown

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

Summary

Features

Human-like Typing Simulation (feat(message))

  • Configurable typing speeds (slow/normal/fast) with jitter
  • HumanizeService integrated into sendText, reply, and bulk messaging
  • Dashboard toggle and speed selector in Message Tester
  • Periodic typing indicator refresh to prevent WhatsApp fade-out

Arabic Locale + RTL (feat(dashboard))

  • Full Arabic translation (ar.json) across all sections
  • RTL support added alongside Hebrew
  • Language selector redesigned as button with dropdown

Community PRs Merged

Session Management Fixes (fix(session))

  • Auto-reconnect on server startup: sessions with saved credentials auto-start
  • WebSocket real-time UI: status updates reach dashboard without refresh
  • No QR error for connected sessions: getQRCode returns gracefully
  • Smart Start flow: only shows QR when session actually needs scanning

Technical Details

  • hasCredentials() added to engine interface for pre-flight checks
  • SingletonLock cleanup during auto-start to prevent browser conflicts
  • WebSocket events mapped session.status → session:status for frontend
  • Dev: direct WS to API (Vite proxy limitation); Prod: /events nginx proxy

Files Changed

46 files, +3,482 / -2,262

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`)
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
- Add HumanizeService with configurable typing speeds (slow/normal/fast)
- Add simulateTyping/simulateRecording to WhatsApp engine interface
- Integrate humanize into sendText, reply, and bulk message services
- Add dashboard UI toggle and speed selector with i18n support
- Add periodic typing indicator refresh to prevent fade-out
- Add full Arabic translation (ar.json) across all sections
- Add Arabic to rtlLanguages alongside Hebrew
- Improve language selector UI (button + dropdown matching sidebar buttons)
- Update language labels to show full names (English, العربية, etc.)
…ents

- Add SessionStatus.FAILED to startup reset + auto-start sessions with credentials
- Clean up stale SingletonLock files before auto-start
- Add hasCredentials() to engine interface, adapter, and factory
- Fix WebSocket events: broadcast to dashboard, map event names for frontend
- Fix WebSocket payload adapter for flat/nested events
- Dev: direct WebSocket to API (localhost:2785); Prod: add /events to nginx.conf
- Fix duplicate disconnect notifications (onDisconnected + onStateChanged dedup)
- Don't auto-show QR after Start; show spinner for initializing/connecting
- Fix getQRCode to return empty when session already connected (no error)
- Replace fetchSessions() in handleStart with optimistic status update
- Add useEffect to auto-show QR when status changes to qr_ready
- Use ref to prevent duplicate QR modal openings
- FetchSessions was setting loading=true which hid the UI cards
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