# Chat & Messaging ## Overview The app supports two chat modes: - **Direct messages**: Encrypted point-to-point messages to individual contacts - **Channel messages**: Broadcast messages to shared channels (see [Channels](channels.md)) This page covers direct messaging. For channel chat, see the Channels documentation. ## How to Access From the Contacts screen, tap any Chat-type contact to open the ChatScreen. ## Chat Screen Layout ### App Bar - **Title**: Contact name - **Subtitle**: Current routing path label (e.g., "2 hops", "flood (auto)", "direct (forced)") and unread count. Tapping the subtitle shows the full path details. - **Action buttons**: - **Routing mode** (waves icon): Switch between Auto, Direct, and Flood routing - **Path management** (timeline icon): View recent paths with hop count, round-trip time, age, and success count. Paths are color-coded by direct repeater (green/yellow/red/blue for ranked repeaters, grey for unknown). Tap a path to activate it (the device verifies and confirms via snackbar), long-press to view full path details, set custom paths, or force flood mode. A warning banner appears when history reaches 100 entries. - **Info** (info icon): Contact info dialog showing type, path, GPS coordinates, public key, and SMAZ compression toggle ### Message List - Scrollable list with newest messages at the bottom - **Outgoing messages**: Right-aligned, primary color background. **Failed messages** change to a red-toned error container background - **Incoming messages**: Left-aligned, grey background with a colored avatar (initial letter or first emoji of sender name; color is deterministic from a hash of the sender name) - Bubble width capped at 65% of screen width - Hyperlinks rendered as tappable green underlined text - **Pinch-to-zoom**: Two-finger zoom (0.8x–1.8x) and double-tap to reset - **Jump to bottom**: Floating button appears when scrolled away from the bottom - **Lazy loading**: Scrolling to top loads older messages from storage ### Input Bar - **GIF button** (left): Opens GIF picker bottom sheet - **Text field** (center): Auto-capitalization, enforces UTF-8 byte limit in real-time - **Send button** (right): Submits the message - On desktop: Enter/Numpad Enter also submits - When a GIF is selected, the text field shows an inline GIF preview with a dismiss button ## Message Types | Type | Wire Format | Display | |---|---|---| | Plain text | Raw UTF-8 string | Inline text with link detection | | GIF | `g:` | Inline GIF image from Giphy CDN | | Location pin | `m:,\|