Introducing a new way to review your PRs.

Read the announcement

crmne / zapfast

ZapFast: a fast, native WhatsApp client in Rust and egui

View on GitHub

19 documents · Updated Nov 18, 2026

docs / messaging-and-conversations

Messaging and conversation experience

ZapFast gives people one place to find chats, read message history, and send new messages. The experience connects local chat history with live account state, then adds context such as replies, mentions, links, reactions, and delivery status so each message can be understood and acted on.

Chat discovery

The chat list is the main entry point to conversations. It helps people find a chat by browsing, filtering, searching message text, or searching contacts; selecting a result opens the chat or jumps to the matching message.

Chat list

The chat list presents the current account's conversations in activity order. It also supports views for unread chats, private chats, groups, channels, favorites, archived chats, locked chats, and starred messages. A new chat can start from a saved contact, a matching phone number, or the account owner.

Search changes the result set rather than only hiding rows. Results are grouped into chats, messages, and contacts, so a person can reach either the conversation or the exact message that matched.

The list keeps unread state meaningful across views. It shows unread counts and can mark a chat unread without inventing a new message count. Mentions also have a distinct signal because they indicate that a message calls for the person's attention.

References: src/…/chats.rs• L594-677 src/…/chats.rs• L910-1049 src/…/chats.rs• L1185-1275 src/model.rs• L264-324

Conversation entry

Opening a chat changes the main view to that conversation. On a narrow window the conversation replaces the list and provides a back action; on a wider window both remain available. A chat header identifies the conversation and exposes its status and actions.

The header can show a group member summary, a contact's presence, or current typing and audio-recording activity. It also gives access to chat information, message search, calls where supported, and actions such as archive, pin, clear, export, leave, or close.

For related group membership and contact controls, see Groups, contacts, and blocking.

References: src/…/conversation.rs• L430-485 src/…/conversation.rs• L1003-1070 src/…/conversation.rs• L647-841

Conversation rendering

The conversation view turns stored messages and live updates into a readable transcript. It keeps the newest messages near the composer, loads older history when needed, and preserves the reader's position when rows change.

Message transcript

The transcript groups messages by sender and day. Incoming messages can show a sender avatar in group chats, while outgoing messages use the opposite side of the conversation. Media albums appear as one visual row even though each item remains a separate message for actions and reactions.

The view marks the first unread message and can show system rows for events such as a disappearing-message timer change. Pinned-message notices and a pinned-message strip provide a path from the current chat to important messages.

The transcript supports direct navigation from search results, starred messages, replies, and pins. It can also select a range of messages for batch actions or copy their content in conversation order.

flowchart TD
    A[Chat selected] --> B[Load local conversation]
    B --> C[Show unread boundary and recent messages]
    C --> D{Reader action}
    D -->|Scroll up| E[Load older history]
    D -->|Select result, reply, or pin| F[Jump to message]
    D -->|Scroll to end| G[Follow new messages]
    E --> C
    F --> C
    G --> C

References: src/…/conversation.rs• L2971-3147 src/…/conversation.rs• L3460-3629 src/model.rs• L575-610

Message content

Messages share a common context even when their visible content differs. Text can include formatted words and links. Other messages can carry pictures, video, audio, documents, stickers, locations, contacts, polls, or interactive cards. The transcript presents each type in a form that supports its main action, such as playing media, opening a location, voting, or opening a link.

A message also carries sender, time, delivery state, quoted message, reactions, edit state, mentions, and any received thumbnail. This shared context lets the list, transcript, search results, copy actions, and message information view describe the same message consistently.

Interactive cards and polls have their own user flows. See Interactive messages and polls.

References: src/model.rs• L575-632 src/model.rs• L783-862 src/…/conversation.rs• L4858-5009

Message context

Message context answers where a message came from and what has happened to it. The transcript shows the sender in group chats, the local time, delivery marks for outgoing messages, and visual indicators for edits, forwarding, or media state when those properties apply.

The message information view gives a deeper delivery record. In a direct chat it shows delivered and read or played times. In a group it separates recipients into played, read, delivered, and remaining groups, while noting when older messages do not have complete receipt data.

References: src/…/message_info.rs• L72-100 src/…/message_info.rs• L179-231 src/…/message_info.rs• L233-300 src/model.rs• L575-610

Message composition

The composer is the controlled path from a draft to an outgoing message. It supports plain text, multiline text, captions for attachments, replies, mentions, emoji suggestions, media attachments, and voice messages while keeping the draft tied to the open chat.

Draft and send flow

The composer grows with the draft to a small readable limit and then scrolls inside the field. Enter behavior follows the user's setting: Enter can send, or Ctrl+Enter can send while Enter adds a line. The send control changes to a voice-record control when there is no text or attachment.

When a send is requested, the UI passes the text or staged attachment to the account worker with the selected chat, reply target, and mention data. A caption uses the same composer, so an attachment and its text remain one outgoing message operation.

sequenceDiagram
    participant P as Person
    participant C as Composer
    participant A as Account worker
    participant T as Transcript
    P->>C: Type text or stage an attachment
    C->>C: Resolve reply, mention, and preview context
    P->>C: Press Send or choose voice recording
    C->>A: Queue message for the open chat
    A-->>T: Add pending, sent, failed, or updated message state

For the detailed interaction model, see Chat interaction and composition.

References: src/…/conversation.rs• L1495-1661 src/…/conversation.rs• L1800-1866 src/…/conversation.rs• L2051-2120 src/model.rs• L2797-2837

Reply context

A reply keeps a link between the new message and the message it answers. The composer shows the original sender and a short version of the quoted content before sending, so the person can check the context or cancel the reply.

Replies normally stay in the same chat. A group message can also be answered privately, which starts a direct conversation while retaining the group message as the source. If that source is not available locally, the composer does not silently turn the action into an ordinary message.

References: src/model.rs• L62-80 src/model.rs• L644-653 src/…/conversation.rs• L1597-1634 src/…/conversation.rs• L2488-2531 src/model.rs• L2984-2991

Mention context

A mention is a named reference to a group participant in message text or a caption. Typing @ in a group opens a member picker that matches names and numbers; choosing a person inserts the mention while preserving the text the sender sees.

Small groups can also offer an everyone mention. The visible wire token is @all; a localized one-word alias is accepted while typing and is converted to that token only when it is a whole word. The stored mention keeps both the visible user token and its canonical identity, so display and notification can use the right form.

The composer does not treat an email address or text embedded in another word as a mention. This boundary protects ordinary text while allowing a mention to notify the intended participant.

References: src/…/conversation.rs• L1072-1101 src/…/conversation.rs• L1337-1479 src/mentions.rs• L1-19 src/mentions.rs• L89-137 src/model.rs• L601-603

Links work in two related places: the message body and the preview attached to it. A link preview adds a title, description, domain, and optional image so the destination can be understood before it is opened.

While a person writes a link, the composer can show a loading state and then a preview card. The person can remove that preview without removing the link, which sends the message as text only. A sent preview remains attached to the message and is clickable as a single card.

Preview data comes from the linked public web page. The system uses page metadata when available, limits the amount of page and image data it reads, and refuses local or private network targets. If the page has no usable metadata or the fetch fails, the message remains usable without a preview.

The phone's link-preview privacy setting controls whether fetching may start. Until that setting is known, previews stay off; a failed fetch does not block the message.

References: src/…/conversation.rs• L2533-2610 src/…/conversation.rs• L9886-9991 src/…/link_preview.rs• L462-521 src/…/link_preview_setting.rs• L14-26

The message menu exposes links as user actions rather than hidden side effects. A person can open the destination from the preview, copy message text, or use the message context menu for other actions. Search and message summaries keep the link preview and written URL from appearing as duplicate links.

References: src/…/conversation.rs• L7501-7510 src/…/conversation.rs• L9917-9926 src/model.rs• L1326-1352

Message actions

Every message provides actions that match its content and state. The UI exposes common actions near the bubble and keeps the full set in a context menu so pointer, keyboard, and assistive-technology users can reach the same behavior.

Message menu

The message menu can react, reply, reply privately where allowed, star, pin, forward, select, copy text, edit a recent outgoing text, delete for everyone when allowed, or delete locally. Media adds actions such as download, open, save, copy an image, or show its folder. Message info and history reload are available when their data supports them.

The action set is conditional. A read-only chat, a revoked message, an expired edit or revoke window, unavailable media, and an unsupported message type can each remove or disable an action instead of allowing an operation that cannot succeed.

References: src/…/conversation.rs• L7250-7680 src/…/conversation.rs• L7682-7781 src/model.rs• L2982-3014

Selection and copy

Selection turns the composer area into a batch-action bar. A person can select individual messages or a range, then delete or forward the selection. Copying selected messages produces a readable transcript in chat order and replaces mention tokens with names rather than exposing internal identifiers.

References: src/…/conversation.rs• L5097-5139 src/…/conversation.rs• L7198-7247 src/…/conversation.rs• L11670-11730

Archive and export

Chat export is a local action from the chat menu. It saves the messages already stored on the computer and can include downloaded attachments in a ZIP. It does not download missing history or files, and exported files are not encrypted; locked chats cannot be exported.

See Chat archive and export for the archive and export flow.

References: src/…/conversation.rs• L684-797 src/…/chat_export.rs• L7-73 src/model.rs• L2965-2978

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep chat-list search results and message-jump behavior aligned with the transcript's message identity and history-loading rules.
  • Keep composer reply targets and mention data aligned with the message payload sent by the account worker.
  • Keep the visible @all token, localized aliases, stored mention identity, and notification flag aligned when mention rules change.
  • Keep link-preview fetching, the phone privacy setting, and the composer dismissal state aligned so a message can still send without a preview.
  • Keep message-menu availability aligned with chat permissions, message age, delivery state, and media state.
  • Keep copy and export output aligned with the same sender, mention, content-label, and attachment rules used by the transcript.

Important failure modes

TriggerConsequenceGuard
A search result points to a message that is not loadedThe person opens the chat but cannot see the intended contextPreserve the message identity and load or reload the needed history before the jump
A reply source is missing for a private group replyThe send could lose the source chat and become an ordinary messageKeep the reply target until the worker resolves it, or require cancellation
A localized everyone alias matches inside a larger word or addressOrdinary text could notify the whole groupRequire mention boundaries before alias rewriting
The phone link-preview setting is unknown or unreadableA preview fetch could violate the phone's privacy choiceKeep previews disabled until a trusted setting is available
A link resolves to a local or private addressPreview fetching could reach the user's networkReject local names and private, reserved, or link-local addresses
Export is requested for a locked chat or missing attachmentThe export could expose protected data or imply data that is not localDisable locked-chat export and report unavailable files in the export result

Key files

FileWhy to read it
src/…/chats.rsDefines chat browsing, filters, search groups, and message entry points
src/…/conversation.rsDefines the open-chat header, transcript, composer, message context, links, and actions
src/model.rsDefines the shared meaning of chats, messages, content, replies, mentions, previews, and actions
src/…/message_info.rsShows delivery and read context for direct and group messages
src/mentions.rsDefines everyone-mention tokens, aliases, boundaries, and notification meaning
src/…/link_preview.rsDefines the safe, bounded source of link-preview data
src/…/link_preview_setting.rsDefines how the phone privacy setting gates link previews
src/…/chat_export.rsDefines the user-facing local export choices and progress state