Behind the Scenes of HidaChat: Architecture of a Portable Multi-Account Desktop Client for WhatsApp and Telegram in .NET 9

> TRADUZIONE // LEGGI IN ITALIANO [ IT ]
// SYSTEM_METRIC_OVERVIEW

HidaChat is a high-performance native Windows desktop client engineered to eliminate the resource overhead and constraints of conventional messaging applications. Harnessing the power of .NET 9 (WPF) and the integrated Microsoft Edge WebView2 Evergreen runtime, HidaChat unifies WhatsApp Web and Telegram Web into a 100% portable multi-account workstation, completely free of Electron and featuring instant 0-millisecond tab switching.


⚑ Key Metrics: Head-to-Head Comparison

~8 MB
Package Size (-95%)
140 MB
Idle RAM Usage (-70%)
< 1.2s
Cold Boot Time
0 ms
Tab Switching Latency

πŸ›‘ The Problem: Bottlenecks of Current Desktop Messengers

Modern messaging suites like WhatsApp and Telegram are vital pillars for both professional engineering and daily life. However, power users managing multiple simultaneous personal, business, or cross-platform accounts on Windows constantly encounter severe architectural roadblocks:

  1. Rigidity of Official Clients: Official desktop applications lack native support for concurrent multi-account profiles, forcing users to manage uncoordinated duplicate windows.
  2. Electron Bloat and Excessive Resource Consumption: The vast majority of third-party wrappers (such as Franz, Ferdi, or Rambox) rely on Electron. This means spinning up duplicate Node.js runtimes and independent Chromium processes for every profile, rapidly devouring RAM (500MB to over 1GB for just two accounts).
  3. Lack of True Portability: Session tokens, cryptographic keys, and cookies are scattered across concealed system directories (%AppData%, %LocalAppData%) and the Windows Registry, preventing clean execution from portable USB drives or encrypted containers.
  4. Language Friction: Communicating with international collaborators or clients requires cumbersome copy-pasting to external translation tools, breaking developer focus and workflow flow.

HidaChat was engineered from the ground up to dismantle these compromises.


🎬 Live Showcase & Architectural Gallery

Here is the interface in action, demonstrating instantaneous switching between WhatsApp/Telegram instances and real-time interactive message translation:

HidaChat Live Demo
// MULTI-ACCOUNT INTERFACE (DARK MODE)
Multi-Account Interface
// INSTANT MESSAGE TRANSLATION
Instant Message Translation
// NATIVE WINDOWS TOAST NOTIFICATIONS
Windows Toast Notifications
// DUAL THEME ENGINE (DARK & LIGHT)
Dark and Light Themes

🌟 Why HidaChat? (Detailed Architectural Comparison)

Feature HidaChat Official WhatsApp Official Telegram Altus (Wrapper Electron)
Installation Required ❌ None (100% Portable) βœ… Required βœ… Required βœ… Required
Relocatable Data (USB / Drive) βœ… Yes (ZIP / USB) ❌ No ❌ No ❌ No
Unified Multi-Platform in 1 App βœ… Yes (WhatsApp + Telegram) ❌ WhatsApp Only ❌ Telegram Only ❌ WhatsApp Only
Multi-Account Tabs βœ… Yes (Isolated Profiles) ❌ No ⚠️ Account Switcher Only βœ… SΓ¬
Instant Pre-Warming βœ… Yes (0ms Switch) ❌ No ❌ No ❌ No
In-Context Translator βœ… Yes (Hover + In-Chat) ❌ No ⚠️ Base ❌ No
Native Toast Notifications βœ… Yes (Win32 Toast) βœ… SΓ¬ βœ… SΓ¬ βœ… SΓ¬
Rendering Engine WebView2 (Native Edge) Native / UWP Native Qt / C++ Electron / Dedicated Chromium
UI Framework .NET 9 + WPF WinUI / XAML Qt Desktop HTML / CSS / Node.js

πŸš€ Architectural Foundations of HidaChat

1. Zero-Electron Architecture: .NET 9 + Integrated Edge WebView2

Rather than bundling hundreds of megabytes of redundant Chromium binaries and V8 runtimes, HidaChat taps into the native Microsoft Edge WebView2 (Evergreen) runtime pre-installed across Windows 10 and 11, pairing it with the high-performance runtime of .NET 9.

2. 0-Millisecond Tab Switching (Visibility.Hidden Pre-Warming)

In conventional multi-account clients, switching tabs typically destroys the web control or triggers a full page re-navigation. In HidaChat, the active profile remains visible while background instances are kept warm with Visibility = Visibility.Hidden. WebSockets remain alive and tab switching executes with zero latency.

' MainWindow.xaml.vb (Estratto logica pre-riscaldamento ordinato)
Private Async Sub PopulateWebViews()
    WebViewsGrid.Children.Clear()

    ' 1. PrioritΓ  assoluta all'account attivo
    Dim activeAccount = _accountManager.CurrentAccount
    If activeAccount IsNot Nothing Then
        Await EnsureWebViewAsync(activeAccount)
        activeAccount.WebView.Visibility = Visibility.Visible
    End If

    ' 2. Pre-riscaldamento in background degli altri account (Visibility.Hidden)
    Dim otherAccounts = _accountManager.Accounts.Where(Function(a) a IsNot activeAccount)
    For Each acc In otherAccounts
        Await EnsureWebViewAsync(acc)
        acc.WebView.Visibility = Visibility.Hidden
    Next
End Sub

3. Intelligent Chromium Throttling Bypass for Real-Time Notifications

By default, Chromium throttles or suspends JavaScript timers and background sockets in occluded tabs. In HidaChat, we inject targeted command-line switches to ensure real-time responsiveness:

Dim options As New CoreWebView2EnvironmentOptions()
options.AdditionalBrowserArguments = "--disk-cache-size=104857600 --media-cache-size=52428800 " &
                                     "--disable-background-timer-throttling " &
                                     "--disable-backgrounding-occluded-windows " &
                                     "--disable-renderer-backgrounding " &
                                     "--disable-features=Translate,OptimizationHints,MediaRouter"

4. True 100% Portability and Sandboxed Isolation

// ZERO_TRACE_POLICY
HidaChat confines all user profiles, auth tokens, session cookies, cache stores, and preferences strictly within a self-contained local data/ folder alongside the executable, ensuring true drop-in portability across encrypted USB drives and external volumes.

5. Win32 Subclassing: Frameless Window with Flawless Maximization (WM_GETMINMAXINFO)

By hooking into the native Win32 WM_GETMINMAXINFO message, the maximized window strictly honors the system work area (rcWork) and Windows Taskbar, preventing screen overlap across multi-monitor setups.

6. Cross-Platform In-Context Translation Engine

A lightweight JavaScript DOM mutation observer hooks into incoming message bubbles across WhatsApp Web and Telegram Web K/A, translating messages on hover or batching chat threads while caching responses in local JSON to eliminate redundant network roundtrips.

7. Native Toast Notification Pipeline and IPC Dispatcher

Direct interception of Web Notification events and Service Worker broadcasts dispatched natively via Windows 10/11 Toast: clicking a banner instantly surfaces the app and switches to the corresponding active account.


πŸ“¦ Installation & Distribution

Option 1: Quick Install via Windows Package Manager (winget)

winget install hidaba.HidaChat

Option 2: Standalone Portable ZIP (No Installation Required)

Download the standalone portable ZIP package from GitHub Releases and extract it to any USB drive or directory.


πŸ”— Open Source Resources & Repository