Skip to content

Chat Panel

Developer reference for the Chat panel, composer, link previews, notifications, dedup, hop badges, reactions/tapbacks, mentions, or chat/support export. Repo-wide rules live in AGENTS.md.

  • Components: ChatPanel.tsx (channel/DM UI) + shared ChatComposer.tsx (drafts, mentions, chunking, spellcheck, emoji, scheduled send; also used by RoomsPanel.tsx). Shell overlays: GlobalMessageSearchDialog.tsx / UnifiedInboxDialog.tsx (lazy via lazyShellOverlays.ts; shortcuts from App). Schedule UI: chat/ScheduledSendDialog.tsx. Reticulum DM Share as paper / Scan paper via ChatDmPaperControls.tsx + createReticulumPaperMessage.ts. Scroll-at-bottom helper: chatScrollUtils.ts (getDistFromChatBottom).
  • Global message search: lib/globalMessageSearch.ts — cross-protocol FTS over saved history (GLOBAL_MESSAGE_SEARCH_LIMIT = 50 hits). Filters: protocol / conversation / sender / time range / direction (own-node sets must stay protocol-scoped). Shortcut Ctrl/Cmd+Shift+F (isGlobalMessageSearchShortcut). Dialog opens a hit into the owning Chat conversation.
  • Receive order: chat rows sort by first local receipt, not the stamped timestamp (usually the sender's clock). MessageRecord.receivedAt holds it in the renderer and received_at in messages, meshcore_messages, reticulum_messages and rrc_messages (written on insert only). lib/chatReceiveOrder.ts orders by receivedAt ?? timestamp (compareChatReceiveOrder, chatReceivedAtMs), and nextChatReceivedAt keeps live receipts strictly increasing. A re-delivered message keeps its earliest receipt (earliestChatReceivedAt in the messageStore merges), and loads never stamp rows saved without one. A MeshCore duplicate written under the copy's router id keeps the stored row's receipt, or none (upsertMessage's receiptOf in meshcoreStoreDedup.ts), and an RRC history load gives a live copy of the same line its saved receipt (mergeHistoryMessages). The MeshCore display repair (meshcoreChatMessagesForDisplay) resolves reply parents in sender-time order, then puts the rows in arrival order, so a reply whose parent arrived later keeps its quote. Meshtastic, Reticulum and RRC load their newest window by COALESCE(received_at, timestamp); MeshCore loads by insert order. Day separators, jump to date, Rooms, RRC notifications and the unified inbox use the same order, while bubbles show the stamped time (with its date when that differs from the arrival day). A compact continuation shows its time when the arrival gap or the stamp gap to the line above is at least CHAT_COMPACT_CONTINUATION_TIME_GAP_MS, so a clock that is off stays visible. Read marks are arrival times too: chatReadOrderMs (the order key, clamped like a wire time) feeds the unread counts (chatUnreadCounts.ts, meshcoreRoomsUnread.ts), the New messages divider, Mark unread, the stored mark (latestChatReadMs) and its sanitizer (chatLastReadSanitize.ts), so all of them compare one domain. These keys and the marks are judged against the read clock (chatReadClockMs): this clock, or the newest receipt when that ran ahead of it, since nextChatReceivedAt keeps counting up after this computer's clock is set back. Rows read back from storage resume it (observeSavedChatReceivedAt in the Meshtastic, MeshCore, Reticulum and RRC row mappers), so after a restart lines that arrive while the clock is still set back sort after the lines saved before it. Saved Chat and Rooms read marks resume it too, at every start (observeSavedReadMarks, run from finishRendererStorage right after convertSavedReadMarksOnce), so a line that arrives while the clock is set back lands above the mark even when the rows that set it are not loaded. A saved receipt or mark more than CHAT_RECEIPT_SEED_MAX_LEAD_MS (one day) ahead is ignored as a seed: new lines then take this clock and sort above it; marks taken before such a set-back are capped at this clock plus the skew limit, which keeps such new lines from counting as unread until the clock passes the marks. Not handled here: MeshCore loads still cap a saved stamp more than MESSAGE_TIMESTAMP_MAX_FUTURE_SKEW_SEC ahead of this clock to the load time (effectiveMessageTimestampMs in identityHydrationSnapshot.ts, db:getMeshcoreMessages, db:getMeshcoreMessagesForHydration and mapMeshcoreDbRowsToChatMessages), and MeshCore store ids are built from the stamp (meshcoreMessageStoreId), so after a restart while set back a row saved before the set-back shows the load time and two load passes can store it twice. isChatReadOrderPoisoned skips a row whose receipt is above the read clock (such an ignored receipt) or, for a row saved without one, whose stamp is more than MESSAGE_TIMESTAMP_MAX_FUTURE_SKEW_SEC ahead of this clock and above the read clock (a saved stamp from a fast clock); the skew allowance is never added on top of a receipt clock that ran ahead, or such a stamp would set a mark above the next receipt. clampChatReadMarkMs caps marks against the read clock in the unread counts and sanitizers, and the sanitizers only ever lower a mark (never past the saved mark, the read clock or the newest key). Own sends take their receipt when the row is built (sendChatOnIdentity, the Meshtastic runtime send), so the saved received_at is the live row's. Marks saved before reads went by arrival were the newest read stamp, up to 300 s ahead of the clock; convertSavedReadMarksOnce (run from finishRendererStorage, after the preference write-through and before App mounts) lowers every Chat and Rooms mark ahead of the first start of this version to that start, once (mesh-client:readMarksByArrival). A fast-clock line read just before the upgrade can then show as unread once. Catch up's "since last read" compares AiSummaryLiveMessage.order (aiSummaryScope.ts), and its history query (src/main/ai/history.ts, byArrival) bounds, orders and pages saved rows by COALESCE(received_at, timestamp) up to the read clock and returns that key as order; the hour ranges still use the stamp and this clock. Chat and Rooms give each loaded line chatSummaryOrderMs as its order (0 for a row the unread counts skip), and "since last read" drops read lines from both the saved and the loaded side before matching copies (mergeSummaryMessages), so a read saved line is never matched to an unread loaded one with the same stamp, sender and text. Each caller of useConversationSummary says which clock its mark is on (watermarkClock): Chat and Rooms pass 'arrival', RRC passes 'stamp' because its mark is stamped, and a stamped mark reads history by stamp up to this clock without byArrival. The DM list's recency (chatDmPeerIndex.ts, listDmPeers.ts MAX(COALESCE(received_at, timestamp))), global search (ORDER BY COALESCE(received_at, timestamp) in searchMessages, searchMeshcoreMessages and db:searchReticulumMessages, then compareChatReceiveOrder on the merged hits and the date bounds of filterGlobalMessageSearchHits) and the Rooms Last post header and posters list follow arrival as well. RRC keeps its own read mark (rrcReadWatermark.ts, stamped time).
  • Unified inbox: lib/unifiedInbox.ts + lib/unifiedInboxActions.ts — received-only feed, most recent arrival first (UNIFIED_INBOX_LIMIT = 200); dismiss keys in mesh-client:unifiedInbox:dismissed:v1 (cap 2000). Stars go through updateStarred (see Starred below), so mounted Chat and Rooms panels show them at once. Shortcut Ctrl/Cmd+Shift+U (isUnifiedInboxShortcut).
  • Scheduled send: lib/scheduledSend.ts — one-shot only; reuses durable chat_outbox with nextRetryAt as the wall-clock target (attemptCount === 0); min lead 5s, max horizon 30 days. App must be running at fire time; outbox 24h age cap anchors from the scheduled time. Composer / outbox ScheduledSendDialog. Recurring multi-target schedules belong in Broadcasts (scheduledBroadcasts/), not this dialog.
  • Pin / archive: lib/conversationPinStorage.ts — per-protocol + identity localStorage (mesh-client:conversationPins:v1:…); pinned vs archived view keys (mutually exclusive, max 500 keys); separate from star/mute. Chat tab strip reads these prefs.
  • Conversation pills: Reticulum DMs use WrappingChannelList, matching the wrapped channel pills. Long peer names wrap; avatars, unread badges, mute and close actions remain on each pill. The header scrolls vertically only when needed, with above/below unread controls that reveal a conversation without selecting it or marking it read. Enlarged text retains space for a pill row and overflow hints; short panes can scroll to reach the remaining controls. Meshtastic/MeshCore retain their separate DM strip and picker. Meshtastic channel pills also show the official-style composite ChannelSecurityBadges lock (lib/channelSecurityBadges.ts) from channelSecurityByIndex built in App.tsx from meshtasticRuntime.channelConfigs (encrypted / open / open+location / open+location+MQTT).
  • Markdown: lib/chatMarkdown.ts (parseChatMarkdown / renderChatMarkdownNodes / wrapSelectionWithMarkdown) — safe subset only; ChatMarkdownToolbar sits in the ChatComposer meta row beside the text entry (Chat / Rooms / RRC); ChatPayloadText renders markdown after mention/URL segments and can highlight search hits inside text nodes.
  • Word filter: stores/wordFilterStore.ts + chat/WordFilterSettings.tsx (app settings + per-conversation disable); isHiddenByWordFilter gates Chat list display, unread (chatUnreadCounts.ts), and beeps; MECP payloads never hide; Show N filtered reveal is session-local.
  • Composer limits / send cadence: chatComposerLimits.ts — getMaxChunks(protocol) via ProtocolCapabilities.composerMaxChunks (MeshCore = 1: no outbound [i/N] split; splitChatMessage returns null when text needs more than one packet), room payload via getMeshcoreRoomPayloadLimit, computeComposerLimitStatus phases (warn surfaces a single-packet ⓘ hint; overMaxSingle disables send and shows a role="note" callout). MeshCore also gets a non-blocking ~5s "sending too fast" advisory (role="status", dismissible) from an app-wide clock in meshcoreSendRateNotice.ts (recordMeshcoreSend / isMeshcoreSendTooFast, MESHCORE_FAST_SEND_WARN_INTERVAL_MS). Every live MeshCore send advances the clock and can show the advisory — text (handleSend), GIF, and share-location in ChatComposer, plus outbox drain (useChatOutbox.ts). Legacy MeshCore outbox rows with groupTotal > 1 or [i/N] payloads are quarantined (blocked) on drain instead of being transmitted. Inbound multi-part [i/N] merge is unchanged. i18n: chatPanel.composeLimit.meshcoreSingleNotice.*, chatPanel.meshcoreFastSend.warning, chatPanel.outboxLegacyMultipartBlocked. See meshcore-meshtastic-parity.md.
  • Automatic resend (regular messages): lib/autoResend/autoResendController.ts (mounted once via useAutoResend in App.tsx) watches own sends created this session (messageStore subscribeMessageStoreEvents added with status: 'sending', re-keyed on renamed) and, when one turns failed, schedules up to REGULAR_MESSAGE_MAX_AUTO_RESENDS (3) resends with 15s / 60s / 3m backoff (autoResendPolicy.ts). Each resend goes through the protocol's useSendMessage with retryOfStoreId; the new bubble inherits the lineage count and the superseded failed bubble is removed (Reticulum re-keys via retryOfStoreId; Meshtastic/MeshCore call deleteMessage + db:deleteFailedOutboundMessage, which only deletes status = 'failed' rows). Excluded: MECP payloads (the emergency outbox retries those until acknowledged — see mecp.md), tapbacks, room posts, and channel sends on protocols without ProtocolCapabilities.hasChannelDeliveryAck (MeshCore floods). The failed bubble shows "Retrying (n/3) in m:ss" with Cancel retry (cancelAutoResend); after the budget only the manual Resend icon remains. Queued outbox rows use the same budget (MAX_ATTEMPTS = 1 + 3). i18n: chatPanel.autoResend*, chatPanel.cancelAutoResend*.
  • Payload / links: ChatPayloadText.tsx — mention highlighting, search marks, URL linkification; structured cards in chat/ChatStructuredPayloads.tsx (signal report, RNCP control, drone report); link previews via chat:fetchLinkPreview (src/main/fetchLinkPreview.ts): Open Graph for HTML pages; YouTube watch/shorts/youtu.be via oEmbed + thumbnail; direct image URLs (path extension via chatDirectImageUrl.ts or raster Content-Type) return kind: 'image' and render as inline embeds (ChatInlineImage / DirectImageEmbed); OG/YouTube use card layout. Security: message-selected network content (HTTPS URL previews, Giphy, shared-location tiles, and drone-report tiles) loads automatically. Link-preview IPC accepts HTTPS only, uses a DNS-pinned undici Agent, blocks private/loopback targets, magic-byte sniffs raster MIME (safeRasterImageMime.ts), and enforces 10s fetch / 3s DNS, 64 KiB HTML, 2 MiB image fetch, 256 KiB cache-payload, LRU, and single-flight limits. LXMF attachment rasters: chat:readReticulumAttachmentAsDataUrl (reticulum-attachment-image.ts; path jail, magic-byte MIME, SVG rejected, 2 MiB, IPC rate limit) → ReticulumAttachmentLine. LXMF voice memos (hasReticulumVoiceMemo): Chat DM mic → sidecar /api/v1/voice/memo/* via electronAPI.reticulum.voiceMemo.*; playback via chat:readReticulumAttachmentBytes (reticulum-attachment-audio.ts; OggS sniff, 256 KiB) → ReticulumVoiceMemoLine. Reply quotes: replyPreview.ts.
  • Bot replies: Colorado-Mesh meshcore-bot-firmware replies (status, air, neighbors, trace, lora, version, channels, help / cmd diag) parse in lib/firmwareBotReplyParse.ts and render as FirmwareBotReplyCard; test / path / sig stay in signalReportParse.ts (SignalReportChip). The bot's leading [1a2b] request token (inter-bot duplicate suppression) is hidden when the body is a recognized reply or the sender is a known bot. isMeshcoreTransportStatusChatLine lets firmware-bot replies through (with or without the Name: channel prefix), so they reach chat instead of the device log; agessaman ack @ / nack @ lines are still filtered. useBotSenderDetection (mounted once in App.tsx) scans new messages newest-first and marks senders whose text matches any known bot template in stores/botSendersStore.ts (mesh-client:botSenders, per protocol, cap 500, oldest evicted). BotBadge shows next to chat sender names, DM pills, Nodes list names, and the node detail header. MeshCore channel senders are name-hash stub ids, so the badge follows the display name.
  • Person-sent hop / ack lines and Health Check codes: lib/hopReportParse.ts recognizes client ack lines (, ack: SNR 12.2 dB, RSSI -41 dBm, 9 hops via F8F9, D4D4, …, source clientAck) and typed hop reports (6 hops to Parker, eight hops to SW Denver, copy, 3 hops, source hopReport, place shown in the chip tooltip). ChatPayloadText falls back to it after parseSignalReport and renders the same SignalReportChip. People send these lines, so isHumanSignalSource keeps them out of isBotReplyText / useBotSenderDetection and they never strip a [1a2b] token. lib/healthCheckCode.ts recognizes whole-message MeshCore Health Check codes (MHC-AB12CD, CM-FE2FF8514BB6E5E6, meshcore-health-check and forks) and renders HealthCheckCodeChip, a label and tooltip with no link, because each community runs its own instance and results are keyed by server session, not by code. Prefixes and code lengths vary by server: the parser accepts 1–8 alphanumeric prefix characters and 6–16 hex digits, and only labels prefixes listed in App → Reach check (meshcoreReachCheckCodePrefix, comma-separated, default MHC; lib/reachCheck/reachCheckCodePrefix.ts). useReachCheckCodePrefixes refreshes ChatPanel/RoomsPanel when that setting changes.
  • Unread badges: channel pills, DM pills and conversation-picker rows show saved unread counts even for the selected conversation. Counts clear when its read watermark advances; selection must not hide unread or its MECP severity while the window is unfocused or the reader is above the bottom. The picker trigger continues to summarize other conversations.
  • Storage helpers: src/renderer/lib/chatPanelProtocolStorage.ts — drafts (mesh-client:drafts:<protocol>), open DM tabs, last-read, per-conversation mute projection (conversationMuteStorage.ts, stable overrides in mesh-client:conversationMutes:v1; legacy mesh-client:mutedViews:<protocol> documents stay intact for rollback), starred (mesh-client:starred:<protocol>, cap 200; a room post's star id is roomPostRowKey, which ends with the post's text so two posts by one author in the same second star separately, and parseStarred (used by loadStarred and useStarredMessages) appends the saved payload to a room star id saved before that), MeshCore flood-scope overrides per chat view (mesh-client:floodScopeOverrides:<protocol>, channel keys bound to the radio public key and channel name/PSK fingerprint; DMs use viewKey), weather-marked senders (mesh-client:weatherMarkedSenders:<protocol>, cap 500).
  • Starred: one stored list per protocol (mesh-client:starred:<protocol>) shared by ChatPanel, RoomsPanel (MeshCore) and the unified inbox. Every change goes through updateStarred in lib/starredMessageStore.ts, which applies it to the list as stored at that moment, so one view cannot save over stars another view added from an older copy. Views read the list with hooks/useStarredMessages.ts (useSyncExternalStore on the stored document; re-reads on subscribeStarred and the storage event). Do not keep a separate copy in component state and save it whole.
  • Weather view (#1112): src/renderer/lib/weatherPosts.ts (isWeatherPost: built-in patterns for °F/°C, 60F now, forecast, Hi N/Lo N, JSON with "temp"/"hum"; user-marked senders; optional user regex capped at 200 chars, invalid → ignored with inline error; WeakMap cache keyed by message + config) and src/renderer/stores/weatherFilterStore.ts (weatherFilterHideInChannels / weatherFilterPattern in app settings, marked senders per protocol). ChatPanel viewMode === 'weather' shows weather posts of the selected channel (channel tabs stay active; composer still targets that channel), with a toolbar count and inline settings (chat/WeatherFilterSettings.tsx); the sender header has a Mark as weather sender toggle. When hide-in-channels is on, isHiddenWeatherPost keeps those posts out of the channel view, computeChannelUnreadCounts, and resolveChatNotificationType (returns null), so badges and tones match what Chat shows. DMs are never filtered. Not shown for DM-only chat (Reticulum).
  • Starred view (#1134): has its own read key, never advances a channel/DM watermark, and hides the composer and MECP siren, so opening Starred cannot mark the previous channel (or its MECP shield) read or aim a send at it.
  • Macro bar (#1152, #1160, room-jump): 12 F1–F12 macros in every ChatComposer (channels, DMs, Rooms, RRC; opt out with showMacros={false}). State lives in stores/chatMacrosStore.ts (zustand persist, key mesh-client:chatMacros, sanitized on rehydrate): global slots { label, text, action?: 'text' | 'room', room? }, size (null follows pointer: coarse, large on touch, small otherwise), sendMode (insert default, sendNow only fires when the box is empty so a draft is never sent or lost), and collapsed (default true). action: 'room' uses lib/roomMacros.ts: resolveRoomMacroPlan → navigateRoomMacro via App's registerRoomMacroNavigator / openRoomMacroTarget. When slot.text is non-empty, navigateRoomMacroAndMaybeQueueText queues a session-only pending apply; the destination ChatComposer (roomMacroMatch from RoomsPanel / ChatPanel / RrcChatView) consumes it with takePendingRoomMacroTextApplyIfMatch and runs text-only insert/sendNow (MeshCore room composer waits until logged in). Empty text = jump only. useChatMacroShortcuts (mounted once in App.tsx) handles plain F1–F12 at window level: room slots navigate (and queue text) without needing a source composer; message slots dispatch through lib/chatMacroKeys.ts to the visible composer (checkVisibility, most recently focused). It calls preventDefault only when a slot is claimed, and skips modifiers, repeats and open modals (Shift+F10 stays the channel menu). UI is components/chat/ChatMacroBar.tsx (Small sits on the hint row, Medium/Large get their own row, overflow goes to a More menu, minimum 6 visible) and EditMacrosDialog.tsx (auto-saves; room slots keep the room picker plus optional message field; byte counter warns via computeComposerLimitStatus when text exceeds one message for the opening composer's protocol). Icons come from lucide-react-motion: Settings2, ChevronDown/ChevronUp, Ellipsis, Plus, Keyboard, TriangleAlert, DoorOpen.
  • MeshCore flood scopes: Radio → Regional flood scope manages up to 20 saved regions independently of the radio default, including while disconnected. Discover regions (MeshCore-only) queries nearby Repeater/Room pubkeys with anonymous CMD_SEND_ANON_REQ region requests (no admin password) into a per-radio directory; public discovered names feed the Radio flood-scope section and the Radio → Channels scope picker (see meshcore-repeaters.md). The visible scope button beside Send chooses Default, Unscoped, or a saved/custom region for the open chat view (not discovered names). Default displays the inherited radio scope. Removing a preset does not erase channel preferences. ChatPanel applies the destination channel’s current saved choice during outbox drains (including MECP retries), then restores the radio default; it resolves the queued channel index rather than the open conversation. DMs retain their per-view choices. Scope routing depends on repeater region configuration; it does not enforce membership or geographic boundaries.
  • MeshCore channel menu (#1096, #1139): right-click / menu key / Shift+F10 on a MeshCore channel chip opens Remove channel (not slot 0 Public) and Clear messages (all channels); MeshcoreChatChannelManager (+ dialog) also offers remove. Remove uses the Radio > Channels delete by slot; confirm re-checks that the slot still holds that channel name and that the same radio (node number snapshot from menu open) is connected, else nothing changes. Clear snapshots the channel key when the confirm dialog opens and aborts if the radio, the slot name, or that key changed; otherwise it deletes that key's rows (or, with no key, this radio's rows plus unscoped legacy rows), then reloads from SQLite; the runtime delete rethrows so refusals surface.
  • MeshCore message hydration (quiet channels): db:getMeshcoreMessagesForHydration / loadMeshcoreMessagesForHydration load the newest global window (MESHCORE_DB_MESSAGE_LOAD_LIMIT = 500) and a recent window per logical channel (MESHCORE_DB_PER_CHANNEL_MESSAGE_LOAD_LIMIT = 100; rooms keep MESHCORE_DB_ROOM_MESSAGE_LOAD_LIMIT = 200). A global-only load lets busy Public traffic crowd sparse slots (e.g. #emergency) out of messageStore. Shared limits live in src/shared/meshcoreMessageHydration.ts; SQL is selectMeshcoreMessagesForHydration in src/main/meshcoreMessageChannel.ts. Runtime refreshMessagesFromDb uses the same loader. The identity store and the runtime message list (trimMeshcoreChatMessages on hydration, live ingest, and optimistic sends) keep those floors when the merged set exceeds the 2000-message cap. Overflow beyond each floor fills only the remaining room under the cap, so those paths cannot evict a quiet channel to make space for Public. Chat still reads the identity store.
  • Channel history follows channel identity across radios: channel slot order differs per radio, so group-channel rows carry a channel_key (16-hex digest of protocol + trimmed name + secret/PSK, src/shared/channelIdentityKey.ts) and radio_node_id (messages gained it; meshcore_messages already had it). Live slot→key maps come from meshcoreRuntime.channels / meshtasticRuntime.channelConfigs (lib/channelIdentity.ts), are published per protocol by useLiveChannelKeysSync into liveChannelKeyStore, and stamp fresh inserts (messageStore, messageToDbRow, withMeshtasticChannelIdentity on Meshtastic save paths; never stamped across a radio mismatch). On connect db:backfillChannelKeys (src/main/channelIdentityDb.ts) stamps only rows whose radio_node_id is already this radio (another radio's rows wait until it connects), then upsert-rehydrates. Null-radio history stays unkeyed; it is not attributed to the first tracked radio. Display: remapChannelMessagesToLiveSlots in App.tsx (meshtasticUiMessages / meshcoreUiMessages, so Chat, unread, tray and notifications agree) keeps the last published slot map when the channel list clears until the next radio publishes one (useRetainedChannelRemapContext), moves keyed rows to the slot holding that key (hides keys not on this radio), hides unkeyed rows from another radio, and collapses group rows that share sender, timestamp, payload, and channel key. Reply repair runs on the pre-remap list. Channel clear snapshots the live key when the dialog opens and aborts if it no longer matches. Meshtastic clear with no key deletes nothing (messages.channel is also the DM channel index). Own-node renumber rewrites messages.radio_node_id in the same transaction and in remapMessageNodeId.
  • MQTT-origin reactions (Meshtastic, #1068): React is disabled on MQTT-only rows (intentional reject, #341) with a translated reason; chatActionError clears when leaving Chat or changing view.
  • Notifications: src/renderer/lib/chatNotifications.ts — playMessageNotification(type) via Web Audio: channel = single 880 Hz pulse (150 ms); dm / reply = dual pulse (587.33 Hz then 783.99 Hz, 50 ms each, 35 ms gap); mecp = repeated ascending triple pulse for ROUTINE; mecpSafety = short–long (dit–dah) pairs × 6 at 1175 Hz square (~4.4s) for SAFETY; mecpSiren = six-cycle siren (~5s, aligned with URGENT) for MAYDAY; mecpEas = 853+960 Hz EAS attention (~5s) for URGENT (mute-bypass via useMecpAlertWatcher / mecpAlert.ts, not pickAudibleNotificationType). Resumes suspended AudioContext when the window is hidden/minimized. Type selection in chatUnreadCounts.ts (resolveChatNotificationType, pickAudibleNotificationType; batch priority reply > dm > channel). ChatPanel plays when the user is on Chat but reading another view; App plays for other panels / backgrounded window (avoids double beep). The App inactive-chat watchers also raise desktop notifications, but only while the window is inactive. They cover all four chat surfaces: Meshtastic, MeshCore, Reticulum LXMF Chat and RRC. The logic lives in chatDesktopNotifications.ts and desktopNotification.ts. These notifications are visual-only (silent: true) and use the same mute gates as the sound. Each conversation is tagged <protocol>:<view>. Clicking one calls app:focusWindow and opens the DM, channel or RRC room. Typed Web Audio from App owns the sound. There is no runtime-local notifier. App → Notifications → Notification tones configures presets, imported short audio, volume and preview per event (notificationSoundSettings.ts; SQLite key notificationSounds). Main owns bounded per-event copies via notificationSounds:* IPC; existing sounds are defaults and missing custom audio falls back to the original. Preview cancellation is separate from incoming playback. See ../notification-sounds.md for platform survey and boundaries. App → Notifications → Chat notifications selects All messages (default) or Mentions and direct messages (mesh-client:chatNotificationMode). Global mute mesh-client:notifMuted and local conversation bells take precedence for ordinary chat; MECP and operational alert owners retain their own policy. RRC keeps its existing room notification choice and unread rules, with global mentions restricting alerts only. Stable mutes follow protocol, finalized radio identity and channel key or full peer key; RRC uses full hub identity and canonical room name. Duplicate slots with the same channel key share a mute. MQTT-only sessions use a separate protocol/client namespace from the existing public, main-owned MQTT client ID. It applies only while MQTT is connected, RF is disconnected and no radio has confirmed its identity this session. Once a radio has, its mutes keep applying to MQTT traffic after the radio disconnects. Legacy mutedViews choices are never migrated into the MQTT namespace; they stay in effect there until the first confirmed radio claims them. Meshtastic MQTT keys come from its canonical configured channels or well-defined standard public default/shorthand. RF channel maps cannot override this separate namespace, and raw PSKs are never copied into the mute document. Cold MeshCore MQTT-only sessions have no group-channel metadata, so they cannot create a channel mute until that metadata exists; full-key DM and room choices remain supported. Verified layouts remain usable during a disconnect; after a cold RF start, discovery must establish device/channel identity before projection or edits. Main-process tray icon shows unread when chat or MeshCore Rooms traffic arrives while backgrounded (src/main/index.ts buildTrayIcon). MECP compose/export and red-dashed bubbles: see mecp.md.
  • Meshtastic dedup: meshtasticMessageDedup.ts — merges delayed RF/MQTT duplicates (10-minute content window) in useMeshtasticRuntime ingest.
  • Hop badges: MessageRecord.rxHops / viaStoreForward round-trip via storeRecordAdapters.ts and meshtasticDbCacheHydration.ts (hopCount on MessageRecord bridges to rxHops for Meshtastic PacketRouter rows); Chat hop pills read ChatMessage.rxHops. MeshCore (primary): companion pathLen on events 7/8 → meshcoreCompanionRxPathLenToHopCount → DomainEvent.payload.hopCount (MeshCoreProtocol, meshcoreDirectMessageDecode); waiting-message drain also sets rxHops from pathLen. MeshCore (fallback): raw-log correlation via resolveMeshcoreIngestRxHops / MESHCORE_CHAT_CORRELATE_WINDOW_MS (3000ms); rawPacketsRef synced inside event-136 setRawPackets updater for same-tick ingest (meshcoreConnSideEffects). MeshCore (late RF correction): meshcoreLateRfHopEnrichment.ts lets an event-136 RX log replace a stored count only on that packet's first reception on the connection (path-invariant payload id): the radio logs every repeat before it drops duplicates, and its message event already carries the first reception's path. A channel packet changes only the row it decrypts to (channel, sender second, then wire text or sender and text; rows stored at receive time because the sender's clock ran ahead match within 3000ms); a DM packet, which cannot be decrypted here, changes no row: the radio logs it before it delivers the message (MeshCore Dispatcher::checkRecv), so the sender's newest DM row is an earlier message, and the DM's own event already carries this reception's path (a DM stored without one takes its preceding log at ingest). Meshtastic: MeshtasticProtocol uses meshtasticComputedRfHopsAway — omit hops for viaMqtt and hopStart === 0; else hopStart - hopLimit when hopStart > 0 && hopLimit <= hopStart.
  • Hop pill route tooltip: ChatRfHopLabel is a button; hover, focus or tap shows how the message arrived, computed on open only (never per render). What a packet records comes from ProtocolCapabilities.messageRouteDetail. MeshCore (floodPath): meshcoreChatMessageRoute (lib/chatMessageRoute.ts) reuses the signal report's exact capture match (meshcoreMessageReceptionStats: channel key, sender, text, sender timestamp), so the route and the ack: ... via ... reply always agree. Flood path hashes are listed sender side first (repeaters append their hash), each named by resolveMeshcoreRouteHops (lib/chatMessageRouteView.ts): Repeater/Room contacts with a known public key only (live meshcorePubKeyRegistry, then public_key_hex), matched on the key prefix via listMeshcorePathPrefixMatches, never the XOR-fold fallback; the freshest match is named with "or another repeater" when several match. The captured path length outranks the stored rxHops. DMs and room posts have no content match, so they say routes are shown for channel messages only. MeshCom (floodPath digipeater): MeshComProtocol stores digipeater callsigns (origin excluded) on TextMessageEvent.rxPathCallsigns / ChatMessage.rxPathCallsigns and persists the full normalized src path in SQLite; meshcomChatMessageRoute prefers that list and resolveMeshcomRouteHops builds flood-path hops. The hop line uses chatPanel.messageRoute.hopCallsign ({{index}}. {{name}}) when name equals hash, so tooltips show callsigns without MeshCore-style hash parentheses. Legacy hop-count-only rows fall back to unavailable. DMs are allowed when digis are present. Meshtastic (lastRelay): MeshtasticProtocol keeps relay_node (low byte of the last relay) on raw_packet; meshtasticChatMessageRoute finds the RF capture by packet id and sender, and resolveMeshtasticRelay prefers a node heard at 0 hops among nodes whose number ends in that byte. A relay_node of 0 reads as not reported. Reticulum (none): packets carry a hop count only. Captures are session-only (2500-entry ring), so restored history says the route is no longer kept. The capture lookups stay in chatMessageRoute.ts because App.tsx wires them; name resolution and wording stay in the lazily loaded Chat chunk (App entry chunk budget). The bubble is the shared InstantTooltipBubble, which flips a tall tooltip to the other side of its trigger when it does not fit (fitInstantTooltipVertically), so a long route near the top of the list opens below the pill. i18n: chatPanel.messageRoute.* (the hop line is hand-written per locale with each locale's hopLabel word; machine translation renders "hops" as brewing hops).
  • Bubbles and composer (v6, Option B): incoming bubbles use bg-chat-incoming-bg / border-chat-incoming-border, own bubbles bg-chat-outgoing-bg / border-chat-outgoing-border (all four user-editable in App → Appearance → Colors; THEME_TOKEN_ALPHA in themeColors.ts renders the fills translucent). DMs use the same tones as channels (no purple). rounded-xl with the small corner toward the sender (rounded-tl-sm in, rounded-tr-sm out), row max 80% (94% below sm, no rem cap, so wide windows keep long messages on one line); MECP severity tones (mecpChatBubbleToneClasses) always win. Incoming rows have a 24px avatar gutter (data-chat-avatar): sender initials from lib/senderInitials.ts, or the Reticulum LXMF face (own Reticulum messages keep the face in the header); compact-mode continuations get an empty spacer so a sender's run reads as one block. Incoming hops / S&F / transport sit at the end of the header line; only header-less compact continuations show them as a footer. Toolbar icons sit in one role="group" ("Conversation tools"). The composer looks the same for channels, DMs and Rooms; Send shows an icon plus its label (Queue / Send N parts stay words), and a keyboard hint line (chatPanel.composeHint, hidden on touch) gives way to the length counter.
  • Relay coverage (in-memory, outgoing bubbles only): relayCoverageStore keyed by identityId:messageId (not persisted). UI: RelayCoverageLine in ChatPanel status row via relayCoverageMessageKey. MeshCore: openHeardRepeatWindow from Chat useSendMessage channel sends and runtime channel TX; during MESHCORE_HEARD_REPEAT_WINDOW_MS (120s — large meshes often need ≥60s for multi-hop returns), "Heard by" counts only repeaters confirmed to have forwarded our own packet. The window carries an expectation (channel index, radio self name, wire text, send second); useMeshcoreRuntime feeds channel secrets into the tracker (setMeshcoreHeardRepeatChannelSecrets). An overheard GRP_TXT binds the window only when it decrypts with that channel's secret (src/shared/meshcoreGroupText.ts: channel hash + 2-byte HMAC + AES-128-ECB via @noble/ciphers) to "<selfName>: <wireText>" with a timestamp in [sentAt − 2s, sentAt + window]. After binding, each flood-path segment of that same payload (path-invariant id meshCorePathInvariantPayloadId: CRC lookup + full type/payload equality) credits a forwarder (Repeater/Room when resolved via pubKeyMapRef / pubkey prefix; otherwise synthetic hex as “additional unidentified”). Chat hops are never credited. Unconfirmed floods (other senders on the channel, unknown secret, no expectation) are never credited. Naming is reliable on 2/3-byte path modes; 1-byte is best-effort (collisions common). Only forwarders whose rebroadcast reaches our radio are credited (multi-hop peers appear via accumulated path hashes). renameMessageId re-keys coverage + window; disconnect clears window + identity coverage. Meshtastic: binary heard/timeout for RF channel/broadcast via meshtasticHeardRepeat + useMeshtasticRuntime transport status (DMs/MQTT ignored). Reticulum: predicted route at send (reticulumRouteCoverage / sendReticulumChatMessage); hops-only vs via-first-hop i18n; pending→hash rename re-keys; clearReticulumSessionStores strips reticulum coverage. i18n: chatPanel.heardBy*, chatPanel.route*Predicted*.
  • Reach check (MeshCore only): client for community Mesh Health Check servers (yellowcooln/meshcore-health-check and forks). Main: src/main/reach-check.ts (createReachCheckClient: GET /api/bootstrap, POST /api/sessions, GET /api/sessions/:id), public https: origins only via normalizeReachCheckOrigin (src/shared/reachCheck.ts) and src/main/public-address.ts (DNS answer must be global, request pinned to it; shared with the regional map client; at most two lookups run at once in the whole main process (one count on globalThis, since the reach check and regional map bundles each inline the module), because a dns.lookup that timed out keeps its thread-pool thread until the OS answers), 10 s timeout, 256 KiB cap, no redirects. Every server value is validated before use (code ^[A-Z0-9]{1,8}-[0-9A-F]{6,16}$, channel name and hash, session id, /share/<id> path, clamped counts, expiry capped at now + 30 min). IPC reachCheck:bootstrap|createSession|getSession ships as the sibling bundle reach-check-handlers.js (outside the index.js size budget). Dev-only: unpackaged builds with MESH_CLIENT_REACH_CHECK_LOCAL=1 also accept http://127.0.0.1:<port> / http://localhost:<port> for a local test server. Renderer: server origin in app setting meshcoreReachCheckServerUrl (blank default, App > Reach check, ReachCheckServerField; setMeshcoreReachCheckServerUrl reads the value back and returns whether storage took it, and when it did not the App field says the address was not saved, keeps the typed address for a retry and the earlier one stays in use); useReachCheck (ChatPanel toolbar Radar button, ReachCheckDialog) runs bootstrap, then planReachCheckChannel (a radio channel counts only when its name and its key hash both match the server's one-byte hash; adds a #name hashtag channel after confirmation, or asks for a pasted key), waits for the new index in channels, selects it, creates the session last and sends the code through the outbox path (saved flood scope applies). After each wait the hook checks active (ChatPanel passes !composerDisabled, false while the panel is hidden or its protocol is switching; the flow then ends with no dialog and leaving answers an open step with Cancel; leaving also marks that check cancelled for good, because App keeps the panel mounted and a pending request may answer after the user is back) and, with nothing awaited in between, reads the slot again from the current identity and channels (reachCheckSlotPlan, no key derivation) right before writing the slot, before selecting the channel and creating the session, and before sending (a different radio or slot ends with the changed error). A start while active is false does nothing. The send itself may wait for the flood scope (another scoped send, or the channel's saved scope), so sendOnChannel takes a stillWanted check that outboxSendFn runs after that wait, right before onSend; it repeats both checks, also refuses a session the server reports expired or exhausted, or one past its expiresAt, and nothing is sent when it fails (a send that fails after the user left shows no dialog). Selecting the test channel clears an open message search and sender filter, so the code's row stays visible; a notification that picks a channel while a reach dialog is open does not move focus to the composer. Enter in the dialog or the App field is ignored while it commits input-method text. The toolbar button uses aria-disabled while busy so focus can return to it. updateMessageStatus drops the entry when the code's message turns failed, which stops polling even when its row is not mounted (ReachCheckLine hides the line too); with a saved flood scope the send returns only after the scope restore, so a refusal can already have failed the message, and the hook then starts no entry and shows the send-failed message. Turnstile servers get the channel prepared and a link to the site instead. Results: reachCheckStore keyed like relay coverage (identityId:messageId, in memory, soft cap 64), reachCheckPoller every 4 s until exhausted/expired/past expiresAt (one final fetch), 15 min hard stop, 404 = gone, 3 failures = unreachable, stopAllReachCheckPolling also stops a poll whose request is in flight; renameMessageId moves entries; a check ends with its session, not with the radio link (the MeshCore transport teardown also runs for each OpenHop/pyMC quiet reopen, so it must not clear entries; lines stay keyed by identity). UI: ReachCheckLine under own bubbles in ChatPanel. i18n: reachCheck.*, appPanel.reachCheckSection.
  • MeshCore dedup: meshcoreStoreDedup.ts — RF/MQTT merge, companion TX echo, tapback self-echo, room BBS paths in useMeshcoreRuntime ingest (5-minute cross-transport window; distinct from Meshtastic’s 10-minute window). Live store ids carry the wire text for DMs (${sender}:${senderSecond}:${text} in meshcoreDirectMessageDecode.ts) as for channels (ch:${idx}:${senderSecond}:${text}), so two different messages from one sender in the same second stay two rows, while a repeat delivery of the same text keeps its id and merges. Room post ids end with the body as stored (room:${room}[:${author}]:${senderSecond}:${body}, meshcoreRoomMessageId in meshcoreRoomMessageRouting.ts), and reload builds the same id from the saved row.
  • Reactions / tapbacks: reactions.ts (Meshtastic protobuf) + meshcoreChannelText.ts (MeshCore default outbound keyless @[Name] emoji / @[Name] body; opt-in MeshCore Open compatibility in App enables keyed replies, r: reactions, and g: GIF send via meshcoreOpenWireCompatEnabled in appSettingsStorage.ts; inbound keyed/sec↔ms parent match via meshcoreMessageMatchesReplyKey; inbound emoji-only replies promoted via meshcorePromoteEmojiOnlyReplyToTapback; inbound Open r:HASH:INDEX in meshcoreOpenReaction.ts); ChatPanel.tsx attaches tapbacks via replyId + runtime/panel sendReaction. RRC reactions (K_REACT_TO / K_REACT_OP) are grouped under their target by partitionRrcReactions in rrcReactions.ts and sent from RrcPanel handleReact; RrcChatView opens the picker through useReactionPicker (hidden capture input for showEmojiPanel() on darwin/win32, inline <emoji-picker> on Linux).
  • Mention segments: src/renderer/lib/chatMentionSegments.ts — parse/build @[Name] tokens; MentionAutocomplete.tsx renders the dropdown.
  • Export IPC: chat:export — renderer calls window.electronAPI.chat.export(messages); main opens a Save dialog and writes a .txt file.
  • Support bundle IPC: support:exportBundle — exportSupportBundle.ts → window.electronAPI.support.exportBundle(mode, json); main support-bundle.ts writes zip (github = logs + debug snapshot including Reticulum diagnostic JSON and Meshtastic channel layout triage via debugSnapshotMeshtasticContext.ts; developer = SQLite plus redacted reticulum/config and reticulum/mesh_client_stack.json). Modes in support-bundle.types.ts.

RRC hub messages expose Reply next to Copy on hover/focus (or always when message actions are enabled). Reply prefixes @nickname followed by a space to the existing composer draft, focuses it, and uses the normal room send path. System lines have no reply target; muted or unavailable sends disable the action.

Message translation

translation:* IPC owns the opt-in state and verified downloads under userData/translation/. src/main/translation/translationManifest.ts pins Mozilla Remote Settings engine major 4 and model major 3 assets, both compressed and decoded checksums. The constructor and disabled handlers perform no fetch, worker launch or directory creation. Pack installation is serial, atomic and cancellable; deletion is serialized with publication so a cancelled install cannot resurrect removed data. No JavaScript is downloaded.

A dedicated Node worker statically bundles the two vendored loaders. It serializes WASM work, keeps only the active direct/English-pivot model pair, frees native wrappers, and is terminated on timeout, idle, disable or deletion. The renderer CSP is unchanged. Missing pivot packs are returned by ID; simplified Chinese uses Mozilla's zh-Hans model and Portuguese shares the pt model with pt-BR. The shipped Electron Node 24 runtime supplies zstd decoding.

The renderer store keeps 200 results in memory and rejects stale status/inference completions. Auto-translation runs only for mounted incoming prose, skips read languages and uncertain language detection, and never falls back online. Original wire text and stored messages are unchanged. AppTranslationSection owns its settings separately from AppPanel's snapshot save. LibreTranslate requires explicit manual selection, HTTPS for every non-loopback server, bounded replies, and an encrypted API key (unavailable when the OS key store cannot safely encrypt). Cleartext HTTP is accepted only for canonical localhost and literal loopback addresses.

Run node scripts/translation-smoke.mjs manually for real French → English → German inference; --extended also checks Indonesian → English → Japanese with tiny/separate-vocabulary packs. It downloads verified packs into a unique temporary directory and removes them on exit. Use Node 22.15+ with zstd support, or Electron's Node runtime (ELECTRON_RUN_AS_NODE=1). CI uses deterministic fake downloads/workers and verifies inert defaults, lifecycle races, packaging, panel actions, settings search and accessibility.

When refreshing translation upstreams, review the pinned Firefox loader sources in src/main/translation/vendor/README.md and Mozilla's translations-wasm-v2, translations-models-v2 and identification collections together. Update the static manifest only after verifying checksums, model quality/version, native constructor compatibility and licenses, then rerun the real-model smoke. Do not automatically adopt a new CDN record or fetch a loader at runtime. Credits and license notices are in docs/credits.md.

Signal report quick replies

Incoming messages with RF or BLE reception provenance expose Send signal report beside Reply across all chat protocols while connected. TCP/network-only, MQTT-only, paper and unknown-provenance messages do not expose the action. The action sends one reply to the same DM peer as the conversation (resolveChatDmPeer), or to the message channel when it is not a DM, and restores the saved flood-scope path. A direct message whose peer cannot be resolved is not sent, so a MeshCore DM stored with channel: -1 and no to cannot fall through to public channel 0. Reticulum uses the normalized LXMF peer. The action preserves the composer draft and selected reply, and blocks duplicate clicks during a send. Reports use message-level SNR/RSSI/hops, including legitimate zero values. MeshCore channel routes and signal measurements are recovered on demand from local RF captures only after matching the channel key, sender, text and sender timestamp. Missing captures fall back to known message measurements; node telemetry and MQTT captures are never substituted. Route hashes are omitted as a whole when they exceed the UTF-8 budget including reply overhead. Measurements are receiver-local and can describe the final repeater hop. Raw captures are session-only; older history can therefore offer fewer stats. Wire copy uses the interoperable ack: format; UI labels remain localized. chatSignalReport.ts owns matching/formatting, with partial reports and 1/2/3-byte hashes rendered by hopReportParse.ts as human reports.

Meshtastic reports use local packet measurements and RF reply IDs. Hybrid RF/MQTT merges retain the local RF measurements in either arrival order and never substitute a gateway's signal or hop count. Reticulum replies use LXMF message hashes. The sidecar binds opportunistic LXMF messages to an exact locally captured, destination-encrypted RX frame on a configured RF/BLE interface, carrying rx_radio_transport and available SNR/RSSI/hops through live and catch-up ingest. A bounded frame index preserves the first observed radio measurements. Missing/lagged captures leave the action unavailable. Cached peer-route labels are display hints and never qualify a Reticulum message for this action. Direct link, resource and propagated delivery remain unavailable until those delivery paths expose per-message ingress evidence. These measurements are session-only and are not inferred for restored database history. Runtime BLE Peer enable/disable changes refresh the shared reception allowlist before activation. Other live RNS interface classifications retain their startup configuration until the stack restarts.

When a verified reception has no numeric measurements, the action sends only a receipt such as ack: received via RF or ack: received via BLE. A BLE label is reported as BLE and does not assert a LoRa path.

Chat display order and radio recovery

Order chats opens the same ordering dialog for channel pills and direct messages on all protocols, MeshCore Rooms, and Reticulum RRC rooms. Drag a handle with a pointer or touch, use Up/Down on a focused handle, or use the arrow buttons. Sort A–Z orders by displayed name; Default order restores the surface's original order. Save applies the order; Cancel/Escape leaves it unchanged. Preferences persist through the renderer-preference map, scoped by protocol, radio/self id and surface (RRC uses the hub). This changes presentation only, never radio channel indices, message destinations, room membership, favorites or credentials. Temporarily absent entries retain their slots while visible entries are reordered.

Channel chips in the Chat strip can also be dragged directly (useChipDragReorder, native HTML5 drag and drop). A drop saves through the same useChatOrder store with moveChatOrderId, so hidden archived channels stay next to their neighbours. Drop feedback is written to the chips' data-chip-dragging / data-drop-side attributes (styled by CHIP_DRAG_CLASS) rather than React state, so ChatPanel does not re-render while the pointer moves. Only drags carrying the hook's own CHIP_ORDER_DRAG_TYPE are accepted. Pinned chips get no drag props, since pin order wins. The strip's scroll container carries data-chip-drag-scroll, and a drag over a chip near its top or bottom edge scrolls it. Reticulum Chat lists DMs instead of channels (dmOnlyChat), so it has no channel strip; keyboard users reorder with the dialog.

MeshCore Chat and Rooms offer Sync chats from radio for a connected companion after setup. This reads contacts and channel slots without changing the radio. Room contacts merge with local history, names, favorites and saved credentials. The explicit reader checks ChannelInfo indices, reads the v3+ DeviceInfo channel capacity, and rejects every busy/error/timeout response instead of accepting the SDK's partial-success result. Very old firmware without capacity metadata keeps the normal connect-time import; explicit sync asks for compatible firmware rather than reporting an unverifiable partial import. Absent slots in partial connect-time reads do not delete known channels; an explicit empty slot is respected. Sync is single-flight, excludes setup/channel writes, checks connection generation before applying asynchronous work, and awaits contact persistence before reporting success. Failure leaves the existing chat list available for retry. A companion cannot provide room passwords or local chat history that were never stored on it; it can restore the room contacts and configured channels.

Word filter, markdown, mark unread, local delete

  • Word filter: stores/wordFilterStore.ts + chat/WordFilterSettings.tsx — durable wordFilterEnabled / wordFilterWords in app settings; per-conversation disable via mesh-client:wordFilterDisabledConversations:v1. Matching channel/DM payloads are hidden from chat views, unread badges, and notification beeps. MECP / MAYDAY / URGENT never filter (isMecpMessage).
  • Markdown: lib/chatMarkdown.ts renders a sanitized bold/italic/strike/inline-code/link subset in ChatPayloadText (after mentions / location / GIF / link previews). Composer toolbar inserts markers. No raw HTML.
  • Mark unread / local delete: Chat message action bar sets the conversation last-read watermark to just before the latest inbound arrival (no re-notify) and confirms before deleteMessage (local store only).