Merge upstream/dev (86 commits) into tth
Upstream redesigned the chat composer (bubble, round +/send button, ChatComposerQuote for the reply preview); our terminal theme had tweaked the old layout. Took upstream's structure and re-applied the terminal look to the new widgets: compact panel padding, square bubble, square button, square and one-line-low reply quote. The terminal reply padding in channel_chat_screen now lives in ChatComposerQuote, so DMs get it too. Also fixed for the merge: - mesh_ui: AvatarCircle uses upstream's avatarInitials() (nullable); the terminal glyph falls back to the person icon like upstream does; - chat_screen: upstream split maxMessageRetries into direct/flood limits, the terminal line now shows the bubble's maxSendAttempts; - test/screens/copy_messages_test.dart: the 1x1 PNG had a bad IDAT CRC. Its async decode failure leaked into the next test; upstream's real flutter_langdetect hides that by timing, our stub (instant init) does not, so the DM test failed ~3 of 5 runs. Replaced with a valid PNG. Checked in the CI image (Flutter 3.47.9): flutter analyze lib test clean; flutter test all green except settings_reveal_test "hides Image Messages sub-options", which fails the same way on plain upstream/dev. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
63907cb17d
210 files changed
+47623
-4900
No files matched your search
@@ -20,7 +20,7 @@ MeshCore Open is an open-source Flutter client for MeshCore LoRa mesh networking
|
||||
7. [Settings](settings.md) - Device settings, app settings, radio configuration, backup/restore, and exports
|
||||
8. [Notifications](notifications.md) - System notifications, replies from watches and Android Auto, unread badges, and notification preferences
|
||||
9. [Repeater Management](repeater-management.md) - Repeater hub, status, CLI, telemetry, and neighbors
|
||||
10. [Additional Features](additional-features.md) - GIF picker, localization, debug logs, SMAZ compression, and more
|
||||
10. [Additional Features](additional-features.md) - GIF picker, localization, debug logs, SMAZ and Cyr2Lat compression, and more
|
||||
11. [Routing Paths](routing-paths.md) - Path encoding, validation, device capability detection, and storage
|
||||
12. [BLE Protocol & Data Layer](ble-protocol.md) - Technical reference for the communication protocol and data architecture
|
||||
13. [Regions](regions.md) - App and radio default regions, unscoped sends, message labels, and reply regions
|
||||
@@ -34,6 +34,7 @@ MeshCore Open is an open-source Flutter client for MeshCore LoRa mesh networking
|
||||
21. [UI Design Reference](design.md) - Contributor reference: theme, typography, spacing, shared widgets, sheets vs dialogs vs pages, states, and localization rules for UI changes
|
||||
22. [Offline Mode](offline-mode.md) - Read-only view of the last radio's contacts, channels and messages while no radio is connected, and the Connect sheet
|
||||
23. [Performance Profiling](performance-profiling.md) - Contributor reference: frame and memory baselines, HTTP capture retention, and resetting diagnostic recordings
|
||||
24. [Chess](games.md) - Play and watch chess games on a channel: invites, challenges, time per move, and how moves are sent and checked
|
||||
|
||||
## App Overview
|
||||
|
||||
@@ -49,6 +50,7 @@ MeshCore Open connects to MeshCore LoRa mesh radios over BLE, USB, or TCP. Once
|
||||
- **Configure radio settings** including frequency, power, bandwidth, and spreading factor
|
||||
- **Cache offline maps** for use without internet connectivity
|
||||
- **Analyze line-of-sight** between nodes with terrain elevation profiles
|
||||
- **Play chess** on a channel, or watch other people's games
|
||||
- **Filter spam** in channels with your own rules and automatic on-device checks
|
||||
- **Use Android Auto** to hear new messages and reply by voice while driving (Android)
|
||||
|
||||
|
||||
@@ -58,21 +58,28 @@ A list of nodes heard passively over the air but not yet added as contacts. Each
|
||||
|
||||
---
|
||||
|
||||
## SMAZ Compression
|
||||
## Compression (SMAZ and Cyr2Lat)
|
||||
|
||||
### What It Is
|
||||
An optional per-contact and per-channel text compression feature using the SMAZ algorithm (optimized for short English text).
|
||||
### Where to Find It
|
||||
Every open direct-message and channel chat shows **Compression: Off**, **Compression: SMAZ** or **Compression: Cyr2Lat** in a strip just below the app bar, above the messages. Tap it to open one sheet with the three choices and what each does. The choice applies to that contact or channel only and is saved on the phone, so it can be changed while the radio is offline. A channel that has not synced from the radio yet has no saved identity, so the strip is disabled and says why.
|
||||
|
||||
### How to Enable
|
||||
- **Per contact**: Chat screen → overflow menu → Contact Settings → toggle "SMAZ compression"
|
||||
- **Per channel**: Long-press channel → Edit → toggle "SMAZ compression"
|
||||
Only one mode is active per chat. Choosing SMAZ turns Cyr2Lat off and the other way round. Off and SMAZ close the sheet once saved; Cyr2Lat keeps it open to show its profile picker. If saving fails, the sheet says so and keeps showing the saved choice.
|
||||
|
||||
### How It Works
|
||||
- When enabled, compression is applied using a "compress only if smaller" strategy — the message is only transmitted compressed if the encoded result is actually shorter than the original. Otherwise, the original text is sent uncompressed
|
||||
- Compressed messages are transmitted with a `s:` prefix followed by base64-encoded data
|
||||
- Recipients using MeshCore Open will decompress automatically. **Recipients using other software** that is not SMAZ-aware will see garbled `s:...` text
|
||||
- The codec operates on ASCII. Non-ASCII / non-English text generally does not benefit from compression and may even expand. Best suited for short English messages
|
||||
- Disabled by default
|
||||
### Off
|
||||
Sends your text exactly as typed. Every app can read it.
|
||||
|
||||
### SMAZ (lossless)
|
||||
- Compresses with the SMAZ short-text dictionary (optimized for short English text)
|
||||
- "Compress only if smaller": a message is sent compressed only when the encoded result is shorter. Otherwise the original text is sent, so turning SMAZ on does not compress every message
|
||||
- Compressed messages are sent as `s:` followed by base64 data. MeshCore Open decodes them back to exactly the original text. **Apps that do not understand SMAZ** show the `s:...` text instead
|
||||
- The codec works on ASCII. Non-English text rarely benefits and may grow
|
||||
|
||||
### Cyr2Lat (character substitution)
|
||||
- Replaces some Cyrillic letters with lookalike Latin ones (for example `А→A`, `З→3`, `Ь→b`). Many Cyrillic letters take two bytes in UTF-8 and Latin ones take one, so some Cyrillic messages get shorter
|
||||
- Not lossless: the exact characters change. Recipients need nothing special to read the result, but copying, searching, names and technical text may behave differently. Your own sent messages appear in the converted form
|
||||
- The replacements come from a Cyr2Lat profile. Pick the chat's profile in the same sheet; without one, the app-wide profile from App Settings → Cyr2Lat is used. Not useful for English text
|
||||
|
||||
Both are off by default. Settings saved before this selector existed are kept.
|
||||
|
||||
---
|
||||
|
||||
@@ -156,7 +163,7 @@ Maintains an in-memory LRU cache of up to 50 contacts, each with up to 100 route
|
||||
Each route keeps delivery and failure counts that fade over time (half their weight per day, at most 16 recent results). For each send attempt a route is chosen by Thompson sampling over those counts, adjusted slightly for speed and for what the radio currently hears. There are no user-tunable weights. A route is deleted only when it keeps failing and hasn't delivered for a week. Flood deliveries that receive an ACK credit the specific return path. Details: [Auto route selection](routing-paths.md#auto-route-selection).
|
||||
|
||||
Used internally for:
|
||||
- **Auto route rotation**: Picks a route for each attempt; retries usually move to a different route, and the last attempt floods
|
||||
- **Auto route rotation**: Picks a route for each direct attempt; retries usually move to a different route, then the flood attempts run
|
||||
- **Flood statistics**: Tracks flood deliveries and failures
|
||||
|
||||
---
|
||||
@@ -167,16 +174,16 @@ Used internally for:
|
||||
Handles reliable delivery of outgoing direct messages:
|
||||
1. Assigns a UUID and sends immediately. Only one message per contact can be in-flight at a time (avoids overflowing the firmware's 8-entry ACK table); subsequent messages are queued
|
||||
2. Listens for ACK frames matched via SHA-256 hash of `[timestamp][attempt][text][sender_pubkey]`
|
||||
3. On timeout, retries with exponential backoff: `1000 × 2^retryCount` ms (1s, 2s, 4s, 8s...)
|
||||
4. Each retry may use a different path (via path history diversity window)
|
||||
5. After max retries: marks failed but keeps a **30-second grace window** during which a late ACK can still resolve the message to "delivered". Optionally clears the contact's path
|
||||
3. On timeout, retries with exponential backoff: `1000 × 2^retryCount` ms (1s, 2s, 4s, 8s...), capped at 32 seconds
|
||||
4. Each direct retry may use a different path (via path history diversity window) when auto route rotation is on
|
||||
5. After the configured direct and flood attempts: marks failed but keeps a **30-second grace window** during which a late ACK can still resolve the message to "delivered". Optionally clears the contact's path
|
||||
6. Reports RTT and path data for quality learning
|
||||
7. Maintains an ACK hash history (last 50 entries) to handle duplicate ACKs
|
||||
|
||||
### Configurable Settings (App Settings → Messaging)
|
||||
- Max retries (2–10, default 5)
|
||||
### Configurable Settings (App Settings → Routing)
|
||||
- Direct attempts (0–15, default 4) and flood attempts (0–10, default 1), set separately from auto route rotation
|
||||
- Clear path on max retry (on/off)
|
||||
- Auto route rotation with weight parameters
|
||||
- Auto route rotation
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -282,3 +282,5 @@ Reactions use `r:<four-hex message hash>:<two-hex emoji index>`. Channel replies
|
||||
Transport-routed raw packets include four transport-code bytes before packed path metadata. For transport floods, the app matches the first two code bytes against locally known region candidates using HMAC-SHA256 over `[payloadType][payload]`. Region scope keys are the first 16 bytes of SHA256 of `#<region>`. The radio's default flood scope is also a candidate, matched on the key the radio reports (it may have been set by another client). The name itself is not carried as plain text. Unknown or ambiguous matches remain null; see [regions](regions.md).
|
||||
|
||||
Image chunks use `CMD_SEND_CHANNEL_DATA` (62), `RESP_CODE_CHANNEL_DATA_RECV` (27), and application data type `0xAE1C`. The framing, capacities, metadata byte, and XOR recovery algorithm are defined in [image_chunk_transport.dart](../lib/services/image_chunk_transport.dart), which is the source of truth. See [image messages](image-messages.md) for user requirements and limitations.
|
||||
|
||||
Chess games use the same command and response with data type `0x0100`, which is registered to MeshCore Open in the firmware's `docs/number_allocations.md`. The high nibble of the first payload byte names the app feature (`1` = chess v1), so other games can share the data type. The packet layouts are in [chess_packets.dart](../lib/games/chess/chess_packets.dart) and [games](games.md#how-moves-are-sent).
|
||||
@@ -61,7 +61,7 @@ Name limits count the `#` and any community prefix, so the name stored on the ra
|
||||
|
||||
| Action | Description |
|
||||
|---|---|
|
||||
| Edit | Change name, PSK (with a dice icon to generate a random PSK), SMAZ compression toggle (compresses outgoing messages to allow longer text within the byte limit), Cyr2Lat encoding toggle (transliterates Cyrillic to Latin for compatibility), or "Enable URL images" toggle (previews image links; requires internet) |
|
||||
| Edit | Change name, PSK (with a dice icon to generate a random PSK), or "Enable URL images" toggle (previews image links; requires internet). Compression is chosen inside the channel chat (see below) |
|
||||
| Mute / Unmute | Toggle push notification suppression for this channel |
|
||||
| Delete | Remove the channel from the device and delete its messages, settings, region and images (confirmation required) |
|
||||
|
||||
@@ -82,6 +82,10 @@ Tap a channel card to open the channel chat screen.
|
||||
- Overflow menu (⋮) → **Show bookmarks** toggles the channel's bookmarked-message filter; the bookmark icon is filled while active and outlined while inactive.
|
||||
- Overflow menu (⋮) → **Chat background**: a color or picture, with a fade slider, behind this channel only. See [Chat backgrounds](themes.md#chat-backgrounds). Holiday greetings in new messages play a short animation, as in [direct chat](chat-and-messaging.md#message-list)
|
||||
|
||||
### Compression Strip
|
||||
|
||||
Below the app bar, above the messages, the same strip as in [direct chats](chat-and-messaging.md#compression-strip) shows and changes this channel's compression: Off, SMAZ or Cyr2Lat. It is stored with the channel's key, so every slot holding that channel shares it, and it can be changed offline. Until the channel has synced from the radio the strip is disabled and says why. See [Compression](additional-features.md#compression-smaz-and-cyr2lat).
|
||||
|
||||
### Message Display
|
||||
|
||||
- Reverse-scrolling list (newest at bottom)
|
||||
@@ -97,7 +101,7 @@ Messages also show a region label when known, independently of message tracing.
|
||||
|
||||
### Message Types in Chat
|
||||
|
||||
- **Plain text** with linkified URLs
|
||||
- **Plain text** with linkified URLs and interactive decimal GPS coordinates (tap to open the **Location** map, long-press for **Copy location** / **Open in maps**; see [Inline GPS Coordinates](chat-and-messaging.md#inline-gps-coordinates))
|
||||
- **GIFs** (`g:{gifId}`) rendered inline via Giphy CDN
|
||||
- **Location pins** (`m:{lat},{lon}|{label}|`) shown as tappable location cards
|
||||
- **Mesh images** sent as GRP_DATA chunks and reconstructed locally ([setup and limitations](image-messages.md))
|
||||
@@ -124,7 +128,7 @@ The app bar overflow menu (⋮) has **Filter messages in this channel** (shown w
|
||||
|
||||
### Channel Auto-Resend
|
||||
|
||||
With **Resend channel messages until they travel far enough** on (App Settings → Messaging), the app waits after each channel send and checks how far the message was heard repeated. If no repeat reached the required hop count, it sends the message again, up to the configured number of times.
|
||||
With **Resend channel messages until they travel far enough** on (App Settings → Routing), the app waits after each channel send and checks how far the message was heard repeated. If no repeat reached the required hop count, it sends the message again, up to the configured number of times.
|
||||
|
||||
Where your radio only hears nearby repeaters, turn on **Also count different nearby repeaters**: the message then also counts as sent once the required number of *different* first-hop repeaters have repeated it, across all attempts. Your own radio's echo and zero-hop echoes don't count.
|
||||
|
||||
@@ -140,6 +144,8 @@ Where your radio only hears nearby repeaters, turn on **Also count different nea
|
||||
| Mark as Unread | Incoming messages only | Marks this message and all subsequent incoming messages as unread |
|
||||
| Delete | All messages | Removes locally (not from mesh) |
|
||||
|
||||
Long-pressing directly on a detected GPS coordinate opens the coordinate action sheet (**Copy location** and **Open in maps**) instead of this message menu; long-press non-coordinate text in the message (or right-click on desktop) for channel message actions.
|
||||
|
||||
## Communities
|
||||
|
||||
Communities are a layer above channels that provide a private namespace.
|
||||
|
||||
@@ -20,7 +20,11 @@ From the Contacts screen, tap any Chat-type contact to open the ChatScreen.
|
||||
- **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**:
|
||||
- **Search** (magnifier icon): Replaces the title with a search field and lists every message in this conversation's full history whose text (or translation) contains the typed word, newest first, with matches highlighted. Channel search also matches sender names and skips messages caught by the [message filter](message-filter.md). Back, Esc or the arrow closes search. Channel chats have the same button.
|
||||
- **Overflow menu** (⋮ icon): Contains Routing, Info, Telemetry, Settings, Chat background, Clear Chat, and Remove from contacts (rooms also have Room Server Management). Routing opens the routing sheet where you can switch between Auto, Direct, and Flood routing and manage recent paths (hop count, round-trip time, age, success count, color-coded by repeater). Info shows a dialog with contact type, path, GPS coordinates, and public key. Chat background sets a color or picture (with a fade slider) behind this chat only; see [Chat backgrounds](themes.md#chat-backgrounds).
|
||||
- **Overflow menu** (⋮ icon): Contains Routing, Info, Telemetry, Settings (link images and telemetry permissions), Chat background, Clear Chat, and Remove from contacts (rooms also have Room Server Management). Routing opens the routing sheet where you can switch between Auto, Direct, and Flood routing and manage recent paths (hop count, round-trip time, age, success count, color-coded by repeater). Info shows a dialog with contact type, path, GPS coordinates, and public key. Chat background sets a color or picture (with a fade slider) behind this chat only; see [Chat backgrounds](themes.md#chat-backgrounds).
|
||||
|
||||
### Compression Strip
|
||||
|
||||
Below the app bar, above the messages, a strip shows **Compression: Off**, **SMAZ** or **Cyr2Lat** for this contact. Tap it to choose a mode in one sheet that explains each: SMAZ is lossless but needs a SMAZ-aware app on the other end and is only used when it makes a message smaller; Cyr2Lat swaps some Cyrillic letters for lookalike Latin ones, stays readable everywhere, but changes the exact characters, using the chosen Cyr2Lat profile. The setting is saved on the phone and can be changed offline. Channel chats show the same strip. See [Compression](additional-features.md#compression-smaz-and-cyr2lat).
|
||||
|
||||
### Message List
|
||||
|
||||
@@ -31,33 +35,66 @@ From the Contacts screen, tap any Chat-type contact to open the ChatScreen.
|
||||
- **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)
|
||||
- Long-press a message and choose **Bookmark** to show a yellow bookmark on the bubble. **Show bookmarks** in the chat menu toggles a filter for bookmarked messages; use **Bookmarks** in the Channels screen menu to browse saved messages, including those from deleted contacts or channels. From the bookmarks list, copy a message with its copy button. It is ordered oldest-to-newest and opens at the newest message. The Export screen can save or share a dated Markdown file, grouped by contact and then channel, with linked URLs and URL-image embeds. Links remain tappable, and supported URL-image previews are shown when **Load images from links** is enabled in App Settings.
|
||||
- Bubble width capped at 72% of screen width
|
||||
- Hyperlinks rendered as tappable green underlined text
|
||||
- Hyperlinks rendered as tappable underlined text; inline decimal GPS coordinates are rendered as bold underlined links (see [Inline GPS Coordinates](#inline-gps-coordinates))
|
||||
- Message text follows the system font size (Android/iOS accessibility text size); pinch-to-zoom scales on top of it
|
||||
- **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. The newest 200 messages are kept in memory; up to 1000 per conversation are kept in storage
|
||||
- **Lazy loading**: Scrolling to top loads older messages from storage. The newest 200 messages are kept in memory, plus any older pages loaded while the chat is open; up to 1000 per conversation are kept in storage
|
||||
- **Reading position**: Near the bottom, the chat follows new messages. Scrolled up, it stays on the messages you are reading while new ones arrive below, such as a room's backlog right after login, and never pulls a scroll in progress back to the bottom
|
||||
- **Arrival order**: Messages are ordered by when they arrived on this device, not by the sender's clock. If a message's time is more than 5 minutes in the future, a small clock-warning icon appears next to its time (the sender's clock is probably wrong); tap it for an explanation
|
||||
|
||||
### Input Bar
|
||||
|
||||
- **Send action button** (left, ⊕ icon): Opens a menu with **Send GIF** (GIF picker bottom sheet) and **Share my location**
|
||||
The composer is a rounded bubble at the bottom of the chat with one round button beside it. With a chat background set, the bubble floats over the background.
|
||||
|
||||
- **Round button** (right): shows **+** while the field is empty and **Send** once you type. **+** opens the send action menu: **Send GIF** (GIF picker bottom sheet), **Share my location**, **Share contact**, and, when set up, image uploads
|
||||
- **Share my location**: Sends your radio's current position (from the radio, not the phone's GPS) as a location pin. You're asked for a label (default: your node name) before sending; the keyboard's Send key confirms. If the radio reports no usable position (none set, or 0,0), the item is hidden and a snackbar says "Your radio has no location set". Location shares follow the same send cooldown as typed messages and are never sent as a reply. In channel chat the menu also holds **Send low-res image over radio** when image messages are set up
|
||||
- **Translation button** (optional, between GIF and text field): Shown only when translation is enabled in App Settings. Tap to configure outgoing-message translation language and on/off toggle.
|
||||
- **Text field** (center): Auto-capitalization, enforces UTF-8 byte limit in real-time
|
||||
- **Send button** (right): Submits the message
|
||||
- **Text field**: Auto-capitalization, enforces the UTF-8 byte limit in real time. It grows to five lines (fewer with very large text while the keyboard is open), then scrolls
|
||||
- **Byte counter**: appears in the bottom-right of the bubble once a message passes 70 % of the limit, and turns red near the limit
|
||||
- **Translation button** (inside the bubble, right): Shown only when translation is enabled in App Settings. Tap to configure outgoing-message translation language and on/off toggle.
|
||||
- **Reply preview**: In channel chat, replying shows the quoted message at the top of the bubble with a **✕** to cancel and, when the original had a region, the region chip
|
||||
- On desktop: Enter/Numpad Enter also submits
|
||||
- When a GIF is selected, the text field shows an inline GIF preview with a dismiss button
|
||||
- When a GIF is selected, the bubble shows a GIF preview with a remove button; Enter sends it
|
||||
- With no radio connected, the bubble says so and a **Connect** button takes the place of the round button
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Wire Format | Display |
|
||||
|---|---|---|
|
||||
| Plain text | Raw UTF-8 string | Inline text with link detection |
|
||||
| Plain text | Raw UTF-8 string | Inline text with URL and decimal coordinate detection |
|
||||
| URL image preview | Image URL in text (per-contact opt-in; requires internet) | Downloaded inline preview |
|
||||
| GIF | `g:<giphy-id>` | Inline GIF image from Giphy CDN |
|
||||
| Location pin | `m:<lat>,<lon>\|<label>\|...` | Location icon + label; tap to open map |
|
||||
| Reaction | `r:<hash>:<emoji-index>` | Applied to target message as emoji pill |
|
||||
|
||||
## Inline GPS Coordinates
|
||||
|
||||
Plain-text messages in direct chats, room chats, channel chats, and saved bookmarks (including translated text and shown originals) automatically detect inline decimal GPS coordinates.
|
||||
|
||||
### Supported Format
|
||||
|
||||
- **Decimal `lat, lon` pairs**: Matches two decimal numbers separated by a comma with optional spaces or tabs after the comma (for example `37.7749, -122.4194` or `-33.86882,151.20929`). Each number may include a leading `+` or `-` sign.
|
||||
- **WGS84 bounds**: Latitude must be between `-90.0` and `90.0` and longitude between `-180.0` and `180.0` (inclusive).
|
||||
- **Decimal requirement**: Both latitude and longitude must contain a decimal point with digits on both sides. Plain integer pairs (`10, 20`) and mixed integer/decimal pairs (`37, -122.4194`) are ignored.
|
||||
- **Non-coordinate exclusions**: Version numbers (`1.2.3, 4.5` or `1.2, 3.4.5`), numbers attached to letters, underscores, or extra signs (`v1.2,3.4`, `id_37.7749,-122.4194`), and coordinates inside URLs, email addresses, or `geo:` URIs remain normal text or standard web links. Surrounding sentence punctuation such as `(37.7749, -122.4194)` or a trailing period (`38.722,-9.139.`) is allowed without breaking detection.
|
||||
|
||||
### Tap and Long-Press Behavior
|
||||
|
||||
- **Tap**: Opens a dedicated full-screen **Location** map centered on that coordinate at zoom level 15 (zoom range 2–18) with a pin marker and a bottom label card showing the matched coordinate text. Map controls provide **Zoom in** (`+`), **Zoom out** (`-`), and **Center map** buttons (plus arrow/WASD pan and R/F zoom keys on desktop), and the app bar provides **Copy location** and **Open in maps**. Pressing Back returns to the exact same message scroll position. Like the main map, cached tiles work offline while uncached tiles require internet.
|
||||
- **Long-press**: Opens a coordinate action sheet with **Copy location** (copies the matched coordinate text to the clipboard) and **Open in maps**, instead of the message bubble context menu. Long-pressing non-coordinate text in the same message (or right-clicking on desktop) still opens the normal message actions menu.
|
||||
|
||||
### Open in Maps Platform Behavior
|
||||
|
||||
**Open in maps** launches an external map application or browser tab depending on the platform:
|
||||
|
||||
| Platform | Target launched |
|
||||
|---|---|
|
||||
| Android | `geo:<lat>,<lon>?q=<lat>,<lon>` (system default maps app) |
|
||||
| iOS, macOS | `https://maps.apple.com/?ll=<lat>,<lon>&q=<lat>,<lon>` (Apple Maps) |
|
||||
| Linux, Windows, Web | `https://www.openstreetmap.org/?mlat=<lat>,<lon>#map=16/<lat>/<lon>` (OpenStreetMap in default browser) |
|
||||
|
||||
Launching fails with a snackbar if no maps app or web browser is available to handle the URI.
|
||||
|
||||
## Sharing Contacts
|
||||
|
||||
A contact can be shared in any direct or channel chat. It is sent as an ordinary text message whose whole text is `<PUBKEYHEX:TYPE:NAME>` (64-hex-character public key, advert type 1 Companion / 2 Repeater / 3 Room / 4 Sensor, then the name, which may contain colons). This is the same format the official MeshCore app uses, so shares work in both directions.
|
||||
@@ -102,11 +139,11 @@ When a direct message is sent:
|
||||
1. The app computes an expected ACK hash: `SHA256([timestamp][attempt][text][selfPubKey])[0:4]` — matching the firmware's hash calculation. If SMAZ compression is enabled, the compressed text (not the original) is hashed
|
||||
2. On device acknowledgment (`RESP_CODE_SENT`), the message transitions to "sent" and a timeout timer starts. If that acknowledgment never arrives (for example a dropped BLE notification), a backup timer (the delivery timeout plus 5 seconds) runs the normal retry path instead of leaving the message pending; a late ACK still marks it delivered
|
||||
3. **Timeout duration**: Preferably from the ML timeout prediction service; otherwise from the device's own `est_timeout` in `RESP_CODE_SENT` (clamped to the physics range); otherwise calculated from LoRa airtime physics: `500 + (airtime × 6 + 250) × (pathLength + 1)` ms for direct paths, `500 + 16 × airtime` ms for flood (airtime is estimated from the radio's current spreading factor, bandwidth, and coding rate). The result is capped at 45 seconds.
|
||||
4. On timeout, the message is retried with **exponential backoff**: `1000 × 2^retryCount` ms (1s, 2s, 4s, 8s, 16s...)
|
||||
5. **Max retries**: Configurable (default 5, range 2–10)
|
||||
6. After max retries, the message is marked "failed" — but a **30-second grace window** remains during which a late ACK can still resolve the message to "delivered"
|
||||
7. If **Clear Path on Max Retry** is enabled (App Settings), the contact's stored routing path is automatically cleared when max retries are exhausted
|
||||
8. **Auto route rotation**: When enabled (and no manual path override is set), the retry service uses a diversity window to avoid re-using recently tried paths, cycling through known routes on each attempt
|
||||
4. On timeout, the message is retried with **exponential backoff**: `1000 × 2^retryCount` ms (1s, 2s, 4s, 8s, 16s...), capped at 32 seconds
|
||||
5. **Direct and flood attempts**: Set separately in App Settings → Routing (defaults 4 direct and 1 flood; up to 15 direct and 10 flood). With auto route rotation on, the direct attempts use known routes and the flood attempts follow. With it off, every attempt stays on the contact's current path and only that path's limit applies. Zero on both still sends once
|
||||
6. After those attempts, the message is marked "failed" — but a **30-second grace window** remains during which a late ACK can still resolve the message to "delivered"
|
||||
7. If **Clear Path on Max Retry** is enabled (App Settings → Routing), the contact's stored routing path is automatically cleared when the attempts are exhausted
|
||||
8. **Auto route rotation**: When enabled (and no manual path override is set), the retry service uses a diversity window to avoid re-using recently tried paths, cycling through known routes on each direct attempt. Flood attempts come after those
|
||||
|
||||
### Manual Retry
|
||||
|
||||
@@ -138,6 +175,8 @@ Add emoji reactions to incoming messages (not your own):
|
||||
|
||||
In channel chats the menu also offers **Mark as spam**, **Filter this sender** and **Filter messages like this…**; see [Message filter](message-filter.md). Direct messages are never filtered.
|
||||
|
||||
Long-pressing directly on a detected GPS coordinate opens the coordinate action sheet (**Copy location** and **Open in maps**) instead of this message menu; long-press non-coordinate text in the message (or right-click on desktop) for message actions.
|
||||
|
||||
## Image and translation setup
|
||||
|
||||
Enable URL images in the contact’s chat settings to preview supported image links; see [URL images](additional-features.md#url-image-previews). Images and files can also be uploaded to a configured IPFS provider from the **+** menu in direct or channel chat; the resulting URL is sent as ordinary text. See [sharing via IPFS](additional-features.md#share-an-image-via-ipfs) and [IPFS provider configuration](settings.md#ipfs-provider-configuration). Mesh image packets are currently sent through channel chat, not the direct-message composer. Set up translation and download a model in [App Settings](settings.md#translation) before using incoming or pre-send translation.
|
||||
@@ -40,7 +40,7 @@ Pull-to-refresh re-fetches the full contact list from the device. Telemetry loca
|
||||
|
||||
A toolbar at the top provides:
|
||||
|
||||
**Search**: Matches contact name (case-insensitive) or public key hex prefix. Debounced at 300ms.
|
||||
**Search**: Matches contact name (case-insensitive) or public key hex prefix. Names that start with the query are listed before other name matches, then key-prefix matches. Within each group the selected sort still applies. Debounced at 300ms.
|
||||
|
||||
**Sort options**:
|
||||
- Latest Messages (by most recent message)
|
||||
@@ -54,14 +54,16 @@ A toolbar at the top provides:
|
||||
|
||||
Groups are a client-side organizational feature for grouping contacts.
|
||||
|
||||
- **Create a group**: Tap the group dropdown → "+" icon → enter name → select members → Save
|
||||
- **Create a group**: Tap the group dropdown → "+" icon → enter name → add members → Save
|
||||
- **Edit a group**: Group dropdown → pencil icon next to the group
|
||||
- **Delete a group**: Group dropdown → trash icon next to the group
|
||||
- **Filter by group**: Select a group from the dropdown to show only its members
|
||||
|
||||
Groups are stored per radio identity (scoped by public key).
|
||||
|
||||
**Validation rules**: Group names cannot be empty, cannot be "all" (reserved, case-insensitive), and must be unique (case-insensitive). The group creation dialog includes a built-in search field to filter contacts when selecting members. Creating a new group automatically selects it as the active filter.
|
||||
The group editor lists **Current members (N)** first, each with a remove button. Below it, **Add contacts** has a search field and lists only contacts that are not members yet; tap a row or its add button to add it. Changes apply when you tap Save. Removing a member only changes the group; the contact stays on the radio.
|
||||
|
||||
**Validation rules**: Group names cannot be empty, cannot be "all" (reserved, case-insensitive), and must be unique (case-insensitive). Creating a new group automatically selects it as the active filter.
|
||||
|
||||
## Tap Actions
|
||||
|
||||
@@ -89,8 +91,8 @@ Groups are stored per radio identity (scoped by public key).
|
||||
|
||||
The Contacts screen has a single **three-dot overflow menu** (`⋮`) in the app bar:
|
||||
|
||||
- Add Contact — opens the Add Contact page
|
||||
- Discovered Contacts — opens the DiscoveryScreen
|
||||
- Add Contact from Clipboard — reads a `meshcore://<hex>` URI from clipboard and imports it
|
||||
- *(divider)*
|
||||
- Zero-Hop Advert — broadcasts your advertisement to immediately adjacent nodes
|
||||
- Flood Advert — broadcasts across the full mesh network
|
||||
@@ -99,15 +101,20 @@ The Contacts screen has a single **three-dot overflow menu** (`⋮`) in the app
|
||||
- Disconnect — disconnects from the device
|
||||
- Settings — opens the Settings screen
|
||||
|
||||
A **floating action button** (person-add icon) provides a shortcut sheet to "Add Contact from Clipboard" or "Discovered Contacts".
|
||||
A **floating action button** (person-add icon) also opens the Add Contact page.
|
||||
|
||||
## Adding Contacts
|
||||
|
||||
### Automatic (Passive)
|
||||
When the radio hears an advertisement, the contact appears automatically if auto-add is enabled for that type (configurable in Settings → Contact Settings).
|
||||
|
||||
### Import from Clipboard
|
||||
Overflow menu (or the FAB shortcut) → "Add Contact from Clipboard". Reads a `meshcore://<hex>` URI from clipboard and imports it to the device.
|
||||
### Add Contact Page (Manual, Clipboard, Discovered, QR)
|
||||
Open **Add Contact** from the Contacts overflow menu or the person-add floating action button.
|
||||
|
||||
- **Manual entry**: Pick the **Contact Type** (Chat, Repeater, Room, or Sensor), enter a **Name**, paste or enter the 64-character hex **Public Key** (leading/trailing whitespace and an optional `0x` prefix are handled automatically), and tap the checkmark (`✓`) to save.
|
||||
- **Add Contact from Clipboard**: Imports `meshcore://` contact URIs and `<PUBKEY:TYPE:NAME>` chat share tokens directly, or detects a bare 64-hex-char public key and fills the Public Key field so you can pick the type, enter a name, and save.
|
||||
- **Add from Discovered Contacts**: Opens the Discovered Contacts screen.
|
||||
- **Scan QR Code**: Opens the QR scanner.
|
||||
|
||||
### Import from Discovered Contacts
|
||||
Overflow menu → "Discovered Contacts". Shows nodes heard passively that haven't been added yet. Tap to immediately import (no confirmation dialog), or long-press for more options (Copy URI, Delete). The Discovery screen has its own search bar, type filters (Users, Repeaters, Rooms), and sort options (Last Seen, A-Z). Its overflow menu has **Export discovered contacts**, **Import discovered contacts**, and "Delete All".
|
||||
@@ -131,7 +138,7 @@ Use the Discovered Contacts overflow menu to move the list of heard-but-not-adde
|
||||
|
||||
### Import from a QR Code
|
||||
|
||||
Choose **Scan QR Code** from the Contacts overflow menu or the add-contact sheet. Allow camera access and scan a compatible contact QR code, or use **Scan QR from Gallery** on the scanner screen to import a QR code from a saved image. Contact QR import is separate from community QR scanning; use Channels for community codes.
|
||||
Choose **Scan QR Code** from the Add Contact page. Allow camera access and scan a compatible contact QR code, or use **Scan QR from Gallery** on the scanner screen to import a QR code from a saved image. Contact QR import is separate from community QR scanning; use Channels for community codes.
|
||||
|
||||
## Contact Sharing Format
|
||||
|
||||
|
||||
+89
-19
@@ -2,7 +2,7 @@
|
||||
|
||||
How MeshCore Open's interface is built today, and the rules to follow when adding or changing UI. Every value below comes from the code it cites. If you change one of those sources, or settle on a new pattern, update this page in the same change.
|
||||
|
||||
The source of truth is `lib/theme/mesh_theme.dart` (theme), `lib/widgets/mesh_ui.dart` (shared widgets) and `lib/widgets/mesh_nav_tile.dart` (settings rows). Where the code disagrees with this page, fix one of them; do not copy the inconsistency.
|
||||
The source of truth is `lib/theme/mesh_theme.dart` (theme), `lib/widgets/mesh_ui.dart` (shared widgets), `lib/widgets/settings_reveal.dart` (reveal-on-enable and settings sliders) and `lib/widgets/mesh_nav_tile.dart` (settings rows). Where the code disagrees with this page, fix one of them; do not copy the inconsistency.
|
||||
|
||||
## 1. Principles
|
||||
|
||||
@@ -29,6 +29,7 @@ The source of truth is `lib/theme/mesh_theme.dart` (theme), `lib/widgets/mesh_ui
|
||||
| Good / bad signal | `MeshTheme.snrColor(snr, blocked:)`; `MeshPalette.signal`, `.warn`, `.alert` for status ramps (e.g. battery in `repeater_status_screen.dart`) |
|
||||
| Own chat bubbles | `MeshBubbleTheme.of(context)` |
|
||||
| Map overlays and markers | `MapPalette`, `MeshMapTheme.of(context)`; line-of-sight charts use `LosPalette` |
|
||||
| Floating map chrome (zoom buttons, panels, toggles) | `ColorScheme` roles like a card: `surfaceContainerLow`, `outlineVariant`, `onSurface`. On desktop, overlays at the top of a path map start at `pathMapTopOverlayInset()` (`path_map_scaffold.dart`) so they clear the zoom buttons |
|
||||
| Coloured text or icon on a tinted background | pass it through `readableAccent(color, background, minContrast:)` (`mesh_ui.dart`), 4.5 for text, 3 for icons |
|
||||
|
||||
Rules:
|
||||
@@ -97,14 +98,17 @@ Minimum sizes: no hard-coded `fontSize` below 12 exists in `lib/screens` or `lib
|
||||
| Section header | padding 16, 20, 16, 8 (LTRB) | `SectionHeader` |
|
||||
| Settings row | padding 16 / 12, 24px icon, 16 gap, chevron 24 | `MeshNavTile` |
|
||||
| Switch row | `SwitchListTile`, `contentPadding` 16 / 4, `secondary` icon size 24 | `app_settings_screen.dart` |
|
||||
| Slider row | `SettingsValueSlider` (`ListTile`), `contentPadding` 16 / 4, `leading` icon size 24, 16 gap | `settings_reveal.dart` |
|
||||
| Popup menu row | 20px icon, 12 gap | `MeshMenuItemRow` |
|
||||
| Banner | padding 16 / 12, 24px icon, 12 gap | `RadioDisconnectedBanner` |
|
||||
| Sheet header | padding 20, 8, 8, 4 (LTRB), 36×4 drag handle | `BottomSheetHeader` |
|
||||
| Radii | `MeshRadii.xs` 6, `sm` 10, `md` 14 (cards, inputs, menus, snackbars, list tiles), `lg` 18 (sheets, dialogs), `xl` 24, `pill` 999 (buttons, chips, FAB) | `MeshRadii` |
|
||||
| Default icon size | 22 | `iconTheme` |
|
||||
| Avatar | 40 | `AvatarCircle` |
|
||||
| Avatar | 40; initials from letters and digits only (`avatarInitials`), else a person icon. Pass a hop's hex prefix, not a "(AB) Name" label | `AvatarCircle` |
|
||||
| List bottom padding under a FAB | 88 | `channels_screen.dart` |
|
||||
|
||||
Every settings row — including sliders, selectors, child rows revealed inside `SettingsReveal`, and model rows in `ModelDownloadList` — uses a vertically centred 24px leading icon with a 16px gap (`MeshNavTile`, `SwitchListTile.secondary`, or `ListTile.leading`) so titles align vertically across a card.
|
||||
|
||||
Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small action buttons, 18 for inline refresh icons and spinners. Keep tappable icons at 20 or more.
|
||||
|
||||
**Tap targets.** Keep Flutter's 48×48 minimum (the default `materialTapTargetSize` and `IconButton` size). Don't shrink with `VisualDensity.compact`, `MaterialTapTargetSize.shrinkWrap` or small `BoxConstraints` unless the control sits inside a larger tappable row.
|
||||
@@ -117,11 +121,16 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act
|
||||
| Label above a group | `SectionHeader(label, trailing:)` | Upper-cases for you; pass the normal-case l10n string |
|
||||
| Settings navigation row | `MeshNavTile` | `onTap: null` dims it to 50 % and reports it as disabled; use `subtitle` to say why |
|
||||
| Settings switch | `SwitchListTile` inside `MeshSettingsTileTheme` | Wrap the settings screen body once in `MeshSettingsTileTheme` |
|
||||
| Radio-style choice in a sheet | `MeshSheetOption` | Used by the language picker and map time filter |
|
||||
| Switch that reveals more controls | `SettingsReveal` | 200ms height ease, `surfaceContainerHighest`, 16px start indent. See [Reveal on enable](#reveal-on-enable) |
|
||||
| Settings slider | `SettingsValueSlider` | Requires a 24px `icon` (`ListTile.leading`). The title includes the selected number, so it stays visible. The drag bubble repeats it |
|
||||
| Radio-style choice in a sheet | `MeshSheetOption` | Used by the language picker, map time filter and compression sheet. Optional `subtitle` explains the option; `onTap: null` disables it. Selected rows show a filled radio icon **and** a bold title, with `selected` semantics |
|
||||
| Per-chat setting at the top of a chat | Full-width strip under the app bar, above the transcript (`ChatCompressionSelector` in `widgets/chat_compression_selector.dart`) | `surfaceContainerLow` fill, `outlineVariant` bottom border, 48dp minimum height, `bodyLarge` w600 "Label: value ▾"; tap opens one `showMeshSheet` with `MeshSheetOption`s. Shows the saved value only; a spinner replaces ▾ while saving; a disabled strip shows why below the label. One shared widget for DM and channel chats; parents pass state and async callbacks |
|
||||
| Choosing between images | Selectable thumbnail tiles in a centred `Wrap` | Image send versions (`_versionTile` in `image_send_preview_sheet.dart`). `InkWell` with `MeshRadii.sm`; selected tile gets a 3px `primary` border **and** a `primary` check badge (never colour alone); caption under the tile in `bodySmall`, w600 when selected; figures such as packet counts in `MeshTheme.mono` 12; wrap the tile in `Semantics(button: true, selected:, label:)` |
|
||||
| Popup menu row | **always** `PopupMenuItem(child: MeshMenuItemRow(icon:, label:))` | Label wraps to 2 lines then ellipsizes; `leading:` for `ThemedIcon`; no icon keeps the 20px slot |
|
||||
| Editing a set of members | Current items first, then a searchable add list | Group editor (`contact_group_editor_dialog.dart`). Wrapping upper-case section label with the count ("Current members (N)"); each member row has a trailing `IconButton` remove (`error` colour, tooltip names the item); the add list excludes current members, and tapping the row or its `primary` add button adds it |
|
||||
| Popup menu row | **always** `PopupMenuItem(child: MeshMenuItemRow(icon:, label:))` | Relies on `MeshTheme.popupMenuTheme` (`surfaceContainerHigh`, `MeshRadii.md`); `MeshMenuItemRow` gives a 20px icon slot, 12px gap, and 2-line wrap + ellipsis (`leading:` for `ThemedIcon`, no icon keeps the 20px slot). Main views share `mainOverflowTrailingItems` (`widgets/connect_sheet.dart`) |
|
||||
| Segmented button label | **always** `ButtonSegment(label: MeshSegmentLabel(text))` | Shrinks to 12 (before system scale), then wraps at word boundaries onto 2 centred lines; never breaks a word |
|
||||
| Status | `StatusChip` | Mono label, coloured dot or icon |
|
||||
| On-device model | `ModelDownloadList` | Name, size, status, selection and one action. See [Model downloads](#model-downloads). |
|
||||
| Metric | `StatTile` | Label wraps to 2 lines; value wraps |
|
||||
| Signal | `SignalBars`, `MeshTheme.snrColor` | |
|
||||
| Route kind | `RouteChip` | Direct / hop count / Flood |
|
||||
@@ -131,7 +140,7 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act
|
||||
| Radio offline on a remote-node screen | `RadioDisconnectedBanner` | Renders nothing while connected |
|
||||
| Sync progress | `SyncProgressAppBarBottom` as the app bar `bottom` | 3px bar |
|
||||
| Toast message | `showDismissibleSnackBar(context, content: Text(...))` | Tap to dismiss, replaces the current snackbar, safe after an async gap |
|
||||
| List item entrance | `ListEntrance(index:)` | Optional |
|
||||
| List item entrance | `ListEntrance(index:)` | Optional. Plays only for rows built while the list is at rest at the top; rows scrolled into view appear at once |
|
||||
|
||||
**Buttons.** Theme shapes are all pill-shaped. In use:
|
||||
|
||||
@@ -147,6 +156,53 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act
|
||||
|
||||
**IconButton.** Always set `tooltip:` with a localized string. It is the accessible name.
|
||||
|
||||
**Chat composer.** Direct and channel chats share `ChatComposer` (`widgets/chat_composer.dart`); change it there, not per screen.
|
||||
|
||||
- Panel: no divider; `scheme.surface` without a chat background, transparent over one (the screens pass the composer as `ChatBackdrop.footer`, and `ChatBackdrop.hasBackgroundOf` tells it a background is drawn). Margins 12 on the sides, 8 above and below.
|
||||
- Bubble: radius `kComposerBubbleRadius` (20), no outline, `surfaceContainerHigh` fill, or the incoming-bubble colour (`MessageBubbleColors`, `surfaceContainerLow`) over a background. One line is 48 tall; the field grows to `kComposerMaxLines` (5), fewer when large text and the keyboard leave little room, then scrolls. Buttons stay bottom-aligned.
|
||||
- Inside the bubble: a reply quote at the top (`ChatComposerQuote`: 4px leading bar in `primary`, title, one-line content, ✕), the field or the GIF preview, the translate button on the right, and the byte counter bottom-right only past 70 % of the limit (`ByteCountedTextField(counterOnlyNearLimit: true)`).
|
||||
- One round button beside the bubble, 44 drawn in a 48 touch target: `+` (the action menu) while the field is empty, Send in `primary` once there is text. The swap fades and scales for 150 ms, instantly when `MediaQuery.disableAnimations` is set.
|
||||
- Offline, `OfflineComposerBar` uses the same panel, bubble and height, with Connect in place of the round button (below the bubble on narrow or large-text layouts).
|
||||
- Full-width strips that are not part of the draft (image send progress) go in `header`, above the bubble.
|
||||
|
||||
### Reveal on enable
|
||||
|
||||
A switch that uncovers more controls (such as **Enable image messages** and **Enable translation**) uses `SettingsReveal` (`lib/widgets/settings_reveal.dart`). The block's height eases over 200ms (`RevealOnEnable.duration`, `Curves.easeInOut`, aligned to the top). While the switch is off the extra controls are not in the tree, so they are not announced. The panel uses `surfaceContainerHighest` and a 16px start indent. Because the panel already sits on `surfaceContainerHighest`, controls and inset notices inside it must contrast against `surfaceContainerHighest` as well as `surfaceContainerLow` (`MeshTheme`'s slider inactive track and value indicator step away from `surfaceContainerHighest`, and inset notice boxes inside `SettingsReveal`, such as `ImageCodecModelsSection`'s unavailable-platform notice, use `surfaceContainerLow` with an `outlineVariant` border).
|
||||
|
||||
The same animation without the tint is `RevealOnEnable`. Use it when the revealed control is not a settings sub-panel: the Bluetooth-off banner on the scanner and the device-info rows on the Settings screen.
|
||||
|
||||
Do not add a second duration, and do not reveal the controls with a plain `if` that pops them in. A block that swaps between two bodies, such as the filtered-message preview, keeps `AnimatedSize` but uses `RevealOnEnable.duration` and `RevealOnEnable.curve`.
|
||||
|
||||
Sliders that belong to a setting use `SettingsValueSlider` with a 24px `icon` (`ListTile.leading`) so the title and slider line up with adjacent rows. Put the selected number in the title (a localized string with the count). The slider's drag label repeats that number; it is not the only place the value appears.
|
||||
|
||||
### Model downloads
|
||||
|
||||
Image models, translation models, and the restore prompt that fetches missing models all use `ModelDownloadList` (`lib/widgets/model_download_list.dart`). Do not add a second download form (a dropdown of presets, a separate filename row, or a one-off progress bar).
|
||||
|
||||
One model is one row inside the existing `MeshCard` (or `SettingsReveal`), rows separated by `Divider(height: 1, indent: 16)`, with leading icon, text column, and trailing action(s) vertically centred (`padding: 16, 12, 4, 12` when an action is present so the icon aligns with `MeshNavTile`'s 16px trailing inset):
|
||||
|
||||
| Part | What it shows |
|
||||
|---|---|
|
||||
| Leading icon | 24px icon, 16px gap: `Icons.memory_outlined` (`onSurfaceVariant`) when not downloaded, 24px `CircularProgressIndicator` (`primary`) while downloading, `Icons.check_circle` (`primary`) when active, `Icons.check_circle_outline` (`onSurfaceVariant`) when ready, `Icons.error_outline` (`error`) on failure. Never repeat the trailing download icon on the left. |
|
||||
| Title | Friendly name, `meshTileTitleStyle` (`bodyLarge` w600). It wraps. Never a raw filename or URL. |
|
||||
| Subtitle | Size via the `mapCache_size*` strings when known, then the status: Not downloaded, Downloading, Ready, or Couldn't download. The model in use also says Active. An install that stopped part-way says Incomplete. The words stay `onSurfaceVariant` (Active is w600). |
|
||||
| Progress | While downloading, a `LinearProgressIndicator` (indeterminate when the total is unknown, or while chunks are merged or the file is verified) and a mono 12 caption of bytes and percent. |
|
||||
| Action | One `IconButton` (48×48 touch target) with a localized tooltip: Download, Cancel, or Remove model. An install that already has files but is not ready shows both Download and Remove. Tap a Ready row to select it when more than one model can be active. A row the user cannot use is dimmed to 50 %, same as a disabled `MeshNavTile`. |
|
||||
| Manual URL | When the feature accepts one (translation), put a single text field under the list. Its download control is the same Download icon. The file joins this list. |
|
||||
|
||||
A dialog that offers several missing models (backup restore) uses the same rows for name, size, status and progress, and keeps its own confirm button.
|
||||
|
||||
### Chess board
|
||||
|
||||
`ChessBoardView` (`lib/games/chess/ui/chess_board.dart`) is board content, not chrome, so its squares keep the same classic colours in every theme (`ChessBoardPalette`). Both have strong contrast with the white and black piece vectors (`chess_vectors_flutter`).
|
||||
|
||||
- Last move: both squares get a translucent yellow wash. Check: a red radial glow behind the king. Selected piece: a 3px `primary` border.
|
||||
- Legal targets: a dark dot on an empty square and a dark ring around a capturable piece, so they differ in shape and not only colour.
|
||||
- Rank and file labels sit in the corners of the edge squares, in the opposite square colour, at 12–14px.
|
||||
- The board fills the width (up to 560) and the page scrolls, so it fits a 320dp phone at 2.0× text.
|
||||
|
||||
The channel's games list is a `showMeshSheet` with a `DraggableScrollableSheet`, the same layout as the Add channel sheet. Starting a game closes it and opens a second sheet, so sheets are never stacked.
|
||||
|
||||
## 6. Sheets, dialogs and pages
|
||||
|
||||
What the code does:
|
||||
@@ -154,7 +210,7 @@ What the code does:
|
||||
| Container | Call | Used for | Examples |
|
||||
|---|---|---|---|
|
||||
| Bottom sheet | `showMeshSheet` + `BottomSheetHeader` (28 calls in 17 files) | Choosing from a list, an item's actions, quick tools tied to the current screen | Language picker, notification mode, add contact/channel options, emoji and GIF pickers, node info, share contact, image actions |
|
||||
| Draggable sheet | `showModalBottomSheet` + `DraggableScrollableSheet` | Tall, scrollable panels that need a drag size | `ContactRoutingSheet` (`routing_sheet.dart`), path editor, image send preview |
|
||||
| Draggable sheet | `showModalBottomSheet` + `DraggableScrollableSheet` | Tall, scrollable panels that need a drag size | `ContactRoutingSheet` (`routing_sheet.dart`), image send preview |
|
||||
| Dialog | `showDialog` + `AlertDialog` (72 calls in 35 files) | Confirming an action, a short input (one to three fields), a short message | Disconnect (`showDisconnectDialog`), clear (`showConfirmClearDialog`), unsaved changes, edit node name, rename point |
|
||||
| Page | `Navigator.push(MaterialPageRoute(...))` | Anything with sections, many fields, its own save, or that the user stays in | App Settings, Repeater Settings, Themes, Theme editor, Message filter, Region management |
|
||||
|
||||
@@ -165,16 +221,28 @@ Rules for new UI:
|
||||
3. **Forms with sections, live remote values, or anything that needs Save/Discard → page.** Guard unsaved changes with `PopScope` and a discard dialog, as `repeater_settings_screen.dart` does.
|
||||
4. Never stack a dialog on a sheet on a dialog. Close the sheet first, or move the flow to a page.
|
||||
|
||||
## 7. App bars
|
||||
**Sheet layout.** `showMeshSheet` is the sheet: safe area on the top and sides, and the keyboard or navigation-bar inset on the bottom. Start the content with `BottomSheetHeader`. That widget is the handle and the title row (padding 20, 8, 8, 4 and a 36×4 handle, section 4). Do not add space above it, draw a second handle, or size the sheet with a fraction inside an `Align`; that leaves an empty band over the handle. The status-bar inset stays outside the sheet.
|
||||
|
||||
The manual path editor (`path_editor_sheet.dart`) uses that layout. The hop list and the hex path field stay pinned under the header, including while the keyboard is open. When the band under the header is shorter than the search field, as on a landscape phone with the keyboard open, those blocks and the repeater list scroll together instead of overflowing.
|
||||
|
||||
## 7. Node search
|
||||
|
||||
Contact, repeater, room and user search all use `lib/utils/contact_search.dart`. Sort with `compareContactQueryRank`: names that start with the query, then other substring matches, then a public-key / hop-hash prefix. Use `rankLabeledKeyQuery` for a label that is not itself a contact, such as "my contact" on the share sheet. Do not filter with a separate name `contains`.
|
||||
|
||||
That is the Contacts list and its group member picker, Discovery, Map node search, Map "send to contact", Share contact, and the Build Path repeater and room list. Channel names, chat messages, repeater CLI commands and the path-trace hex field are not this search. The map key-prefix setting is a filter, not a ranked search.
|
||||
|
||||
## 8. App bars
|
||||
|
||||
- Title: a plain localized string, ellipsized on one line. Use `AppBarTitle` on top-level and settings screens; it adds the connected node name as a subtitle and battery/SNR indicators when there is room, dropping them in that order on narrow widths. Use `AdaptiveAppBarTitle` for a plain one-line title.
|
||||
- Centre the title (`centerTitle: true`, `AGENTS.md`); 31 screens set it explicitly because the theme default is `false`. Chat screens (`chat_screen.dart`, `channel_chat_screen.dart`) deliberately use `centerTitle: false` for their two-line name + route title.
|
||||
- Actions: at most two icon buttons plus the overflow (`Icons.more_vert`) menu, for example `RadioStatsIconButton`, search, ⋮ in `chat_screen.dart`. Put everything else in the overflow menu.
|
||||
- Overflow menu order: things about this screen first, then app-level items (Disconnect, Settings), with destructive items last. Destructive items use `MeshMenuItemRow(color: scheme.error)` so both icon and label turn red (Clear chat in `chat_screen.dart`; Clear / Delete channel in `channel_chat_screen.dart`). Use `PopupMenuDivider` between groups.
|
||||
- Overflow menus:
|
||||
- Order: screen-specific items first, then a `PopupMenuDivider` separating the trailing app-level section — Connect/Disconnect (`connectionMenuItem`) immediately followed by Settings (`settingsMenuItem`) — and destructive items last if a screen has any. Omit the divider when no items precede the app-level section (for example, `MapScreen` while building a path trace). Main views use `mainOverflowTrailingItems(screenContext, menuContext, hasPrecedingItems:)` in `lib/widgets/connect_sheet.dart` so they stay in sync.
|
||||
- Visual & interaction rules: rely on `MeshTheme`'s `popupMenuTheme` (`surfaceContainerHigh`, `MeshRadii.md` border radius, and consistent `menuPadding`, margins, item padding, and elevation), separate sections with `PopupMenuDivider`, build every row with `MeshMenuItemRow` (20px icon slot, 12px gap, 2-line wrap + ellipsis), use `context.l10n.contacts_moreOptions` as the button `tooltip` on main views, and capture the screen `context` (not the `itemBuilder`'s `menuContext`) for `onTap` callbacks since menus pop before `onTap` runs. Destructive items use `MeshMenuItemRow(color: scheme.error)` so both icon and label turn red (Clear chat in `chat_screen.dart`; Clear / Delete channel in `channel_chat_screen.dart`).
|
||||
- Search: tapping search swaps the title for the field and hides all actions (`actions: _searching ? null : [...]`). The leading back arrow and the system back gesture close the search (`PopScope(canPop: !_searching)`) instead of leaving the screen.
|
||||
- Long operations: show progress as the app bar `bottom` (`SyncProgressAppBarBottom`, or a 4px `LinearProgressIndicator` for Refresh all in `repeater_settings_screen.dart`).
|
||||
|
||||
## 8. States
|
||||
## 9. States
|
||||
|
||||
| State | How to show it |
|
||||
|---|---|
|
||||
@@ -183,7 +251,7 @@ Rules for new UI:
|
||||
| Background sync | `SyncProgressAppBarBottom`. |
|
||||
| Empty | `EmptyState` with an icon, a short title, and an action when there is an obvious next step. Use a separate "no results" state (`Icons.search_off`) when a search or filter hides everything. |
|
||||
| Error | A snackbar for a failed action. `ErrorRetryCard` for a failed load the user can retry. Never show raw exception text alone. |
|
||||
| Companion radio disconnected | Main and chat screens stay open, read-only ([offline mode](offline-mode.md)). Decide with `isRadioReadOnly(connector)` / `context.radioReadOnly` (`lib/utils/radio_guard.dart`): disable menu items (`PopupMenuItem(enabled: false)`, drop destructive colors) and buttons, hide FABs, and call `ensureRadioConnected(context)` as the safety net in handlers. The chat composer shows `OfflineComposerBar`. Repeater screens stay open with `RadioDisconnectedBanner` at the top and disable radio-dependent actions. Settings rows that need the radio pass `onTap: null` and show `settings_requiresConnection` as the subtitle (`settings_screen.dart`). |
|
||||
| Companion radio disconnected | Main and chat screens stay open, read-only ([offline mode](offline-mode.md)). Decide with `isRadioReadOnly(connector)` / `context.radioReadOnly` (`lib/utils/radio_guard.dart`): disable menu items (`PopupMenuItem(enabled: false)`, drop destructive colors) and buttons, hide FABs, and call `ensureRadioConnected(context)` as the safety net in handlers. The chat composer shows `OfflineComposerBar` in the same bubble and margins. Repeater screens stay open with `RadioDisconnectedBanner` at the top and disable radio-dependent actions. Settings rows that need the radio pass `onTap: null` and show `settings_requiresConnection` as the subtitle (`settings_screen.dart`). |
|
||||
| Feature unsupported by firmware | Disabled row with a subtitle that says why (`settings_requiresFirmware('v1.10')`). |
|
||||
| Remote value not fetched yet | See below. |
|
||||
|
||||
@@ -197,7 +265,7 @@ Rules for new UI:
|
||||
|
||||
Follow the same pattern for any new remote-value screen.
|
||||
|
||||
## 9. Text and localization
|
||||
## 10. Text and localization
|
||||
|
||||
- All user-facing strings go through `context.l10n` (`lib/l10n/l10n.dart`). Add keys to `lib/l10n/app_en.arb` first. No string literals in widgets, including fallbacks.
|
||||
- Keep strings short: labels are a few words, subtitles one sentence.
|
||||
@@ -211,32 +279,34 @@ Follow the same pattern for any new remote-value screen.
|
||||
- Upper-casing is done in code (`SectionHeader`, `StatTile`, `RouteChip`); keep the ARB strings in normal case.
|
||||
- Test with a long locale (German, Portuguese) and a large system font (at least 1.3×, ideally 2.0×) on a narrow phone (320dp). `test/screens/small_screen_layout_test.dart` checks many screens at 320×568 at 1.0, 1.3 and 2.0× in English; add new screens to it.
|
||||
|
||||
## 10. Checklist for a UI change
|
||||
## 11. Checklist for a UI change
|
||||
|
||||
- [ ] Colours from `colorScheme` or theme extensions; no raw `Colors.*` or `MeshPalette.ink/bg/line` in chrome.
|
||||
- [ ] Text styles from `textTheme` or `MeshTheme.mono`; nothing below 12.
|
||||
- [ ] Settings rows use `MeshNavTile` / `SwitchListTile` inside `MeshSettingsTileTheme`; cards are `MeshCard` with a `SectionHeader`.
|
||||
- [ ] Popup menu rows use `MeshMenuItemRow`; segmented buttons use `MeshSegmentLabel`; destructive menu items last, in `scheme.error`.
|
||||
- [ ] A switch that reveals more controls uses `SettingsReveal`. A settings slider uses `SettingsValueSlider` so the selected value stays in the title.
|
||||
- [ ] Overflow menus rely on `MeshTheme.popupMenuTheme`, use `MeshMenuItemRow`, have a localized `tooltip`, place screen-specific items above a `PopupMenuDivider` followed by Connect/Disconnect and Settings (omitting any leading divider when empty), and place destructive items last in `scheme.error`; segmented buttons use `MeshSegmentLabel`.
|
||||
- [ ] Every `IconButton` and FAB has a localized `tooltip`.
|
||||
- [ ] Tap targets at least 48×48.
|
||||
- [ ] Right container: dialog for confirm/short input, `showMeshSheet` + `BottomSheetHeader` for choices and item actions, page for forms.
|
||||
- [ ] Right container: dialog for confirm/short input, `showMeshSheet` + `BottomSheetHeader` for choices and item actions, page for forms. No gap above the sheet handle.
|
||||
- [ ] Contact, repeater, room and user search uses `compareContactQueryRank`: prefix, then substring, then hop hash.
|
||||
- [ ] Loading, empty, error, offline and unknown-value states handled.
|
||||
- [ ] All strings in `app_en.arb`; checked in German or Portuguese at 1.3× and 2.0× on a narrow screen.
|
||||
- [ ] Light, dark and one custom theme checked.
|
||||
- [ ] This page updated if you introduced or changed a pattern.
|
||||
|
||||
## 11. Known inconsistencies
|
||||
## 12. Known inconsistencies
|
||||
|
||||
The current code does not yet follow this page everywhere:
|
||||
|
||||
- **App bar centring.** `MeshTheme._build` sets `centerTitle: false`, but `AGENTS.md` asks for centred titles and 31 screens override it. `contacts_screen.dart` does not, so its title is left-aligned while Channels and Settings are centred.
|
||||
- **Disconnect placement in overflow menus.** It is the first item in `channels_screen.dart`, but just above Settings in `contacts_screen.dart` and `map_screen.dart`. It tints only the icon (`iconColor`), while Clear chat / Delete tint icon and label (`color`).
|
||||
- **Disconnect icon-only error tint.** In overflow menus, Disconnect tints only the icon (`iconColor`), while Clear chat / Delete tint icon and label (`color`).
|
||||
- **Menu rows not using `MeshMenuItemRow`.** `channel_chat_screen.dart` bulk-select menu (Select all / Copy) puts a `ListTile` inside `PopupMenuItem`. `widgets/list_filter_widget.dart` and the group menu in `contacts_screen.dart` use plain `Text` items, which is acceptable for icon-less lists but does not limit wrapping.
|
||||
- **Settings toggles in two sizes.** `FeatureToggleRow` (`widgets/elements_ui.dart`, used in `settings_screen.dart` dialogs) uses a `bodyMedium` w600 title and `bodySmall` subtitle with a 32px refresh button. `MeshNavTile` and themed `SwitchListTile`s use `bodyLarge` w600 / `bodyMedium`. Only App Settings, Message Filter and Repeater Settings wrap their body in `MeshSettingsTileTheme`.
|
||||
- **`ErrorRetryCard` is unused** and its fallback label is the hard-coded English `'Retry'` (`mesh_ui.dart`); screens show load errors in their own ways.
|
||||
- **Fixed-width label boxes.** `chat_screen.dart` `_buildInfoRow` (80px), `line_of_sight_map_screen.dart` endpoint label (54px, `fontSize: 12`), `channel_message_path_screen.dart` (72px, upper-cased `accentLabel` at its 11px default).
|
||||
- **11px text.** `MeshTheme.accentLabel()` without `fontSize` gives 11px in `channel_message_path_screen.dart` and `widgets/path_map_ui.dart` (which also uses dark-only `MeshPalette.ink3`). The type scale's `labelSmall` (11) is used in `list_filter_widget.dart` section titles.
|
||||
- **Hard-coded colours.** `SyncProgressAppBarBottom` uses `Colors.red`, `Colors.blue` and `Colors.green`; `AppBarTitle` subtitle uses `Colors.grey[600]` at a literal 14 instead of `onSurfaceVariant`; `telemetry_location_map.dart` uses raw `Colors.*`. `MeshPalette.ink/bg/line` appear directly in eight screen/widget files (mostly map panels, where they are intentional; also `channels_screen.dart` and `channel_chat_screen.dart` community dots with an 8px icon).
|
||||
- **11px text.** `MeshTheme.accentLabel()` without `fontSize` gives 11px in `channel_message_path_screen.dart`. The type scale's `labelSmall` (11) is used in `list_filter_widget.dart` section titles.
|
||||
- **Hard-coded colours.** `SyncProgressAppBarBottom` uses `Colors.red`, `Colors.blue` and `Colors.green`; `AppBarTitle` subtitle uses `Colors.grey[600]` at a literal 14 instead of `onSurfaceVariant`; `telemetry_location_map.dart` uses raw `Colors.*`. `MeshPalette.ink/bg/line` still appear directly in a few screen/widget files: map marker overlays (node name labels and shared-count badges in `path_map_scaffold.dart`, the hop badge on avatars in `channel_message_path_screen.dart`) and the `channels_screen.dart` and `channel_chat_screen.dart` community dots with an 8px icon. The path map chrome (`PathMapBottomPanel`, `PathMapDesktopControls`, `PathViewModeToggle` and the panel contents in `path_map_ui.dart` and both path map screens) uses `ColorScheme` roles: `surfaceContainerLow` background, `outlineVariant` border and dividers, `onSurface`/`onSurfaceVariant` text and icons, `primary` for active toggles and `tertiary` for warnings.
|
||||
- **Literal sizes instead of the theme.** About 300 literal `fontSize:` values in `lib/screens` and `lib/widgets` (most 12–14), e.g. `EmptyState` subtitle at 13.5; and 36 `BorderRadius.circular(<number>)` calls (8 and 12 most common) instead of `MeshRadii`.
|
||||
- **Navigation bar theme.** `navigationBarTheme` colours selected labels `onPrimary`, which is white-on-white in light mode; `QuickSwitchBar` overrides it. Any other `NavigationBar` would inherit the problem.
|
||||
- **Two badge styles.** `QuickSwitchBar` uses Material `Badge` capped at 99+; `UnreadBadge` caps at 9999+.
|
||||
@@ -244,7 +314,7 @@ The current code does not yet follow this page everywhere:
|
||||
- **Large forms in dialogs.** `RadioSettingsDialog` (`widgets/radio_settings_dialog.dart`, nine inputs) and the contact settings dialog in `chat_screen.dart` are dialogs although they behave like forms.
|
||||
- **Dialog buttons.** `showDisconnectDialog` (`utils/dialog_utils.dart`) uses two `TextButton`s with no emphasis; `showConfirmClearDialog` uses a red `FilledButton`.
|
||||
- **Snackbars.** A few places still call `ScaffoldMessenger.showSnackBar` directly (`discovery_screen.dart`, `app_settings_screen.dart`, `message_filter_settings_screen.dart`, `region_management_screen.dart`, `helpers/image_send_flow.dart`) and so miss tap-to-dismiss and replace-instead-of-queue.
|
||||
- **Small tap targets.** `FeatureToggleRow` refresh (32px) and 40px buttons in `chat_screen.dart`, `channel_chat_screen.dart`, `reaction_chips.dart`, `snr_indicator.dart`, `path_map_ui.dart`; 44px in `routing_sheet.dart`, `path_editor_sheet.dart`.
|
||||
- **Small tap targets.** `FeatureToggleRow` refresh (32px) and 40px buttons in `chat_screen.dart`, `channel_chat_screen.dart`, `reaction_chips.dart`, `snr_indicator.dart`, `path_map_ui.dart`; 44px in `routing_sheet.dart`.
|
||||
- **Unknown placeholders.** Repeater and companion stats screens use `—`; `line_of_sight_map_screen.dart` uses `--`.
|
||||
- **Missing tooltip.** The Contacts FAB (`contacts_screen.dart`) has no tooltip; about 18 of 111 `IconButton`s have no tooltip nearby.
|
||||
- **Stale doc comments.** `SectionHeader` is described as "mono" but uses the sans `accentLabel`; the `StatusChip` comment sits above `meshContrastRatio`.
|
||||
@@ -0,0 +1,63 @@
|
||||
# Chess
|
||||
|
||||
Play chess with someone on a channel, or watch other people's games. Moves go over the mesh as small channel data packets, so games suit a slow network: each move can take its time, and anyone on the channel can follow along.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Companion firmware v1.15 or newer, on every radio that plays or watches. Older firmware can't send or receive channel data, and the games sheet says so.
|
||||
- Everyone involved must be on the same channel (same key). Other MeshCore apps don't show the games, and the moves never appear as chat messages.
|
||||
|
||||
## Start a game
|
||||
|
||||
Open a channel, tap **+** next to the message box, then **Chess games**. The entry shows how many games and invites are open on that channel.
|
||||
|
||||
- **Challenge someone**: pick a person recently heard on this channel. Only a radio with that name can accept. Their phone shows a notification.
|
||||
- **Post an open invite**: anyone on the channel can accept. If two people accept at the same time, the inviter's phone picks the first one it heard and tells everyone; the other person keeps watching.
|
||||
|
||||
Choose the **time per move** (no limit, 15 minutes, 1 hour (default), 6 hours, 1 day or 3 days) and **your colour** (random, white or black). Unanswered invites expire after a day. Tap your own invite to cancel it.
|
||||
|
||||
## Play
|
||||
|
||||
The board turns so that your pieces are at the bottom. Tap one of your pieces, then one of the marked squares. A promotion asks which piece you want.
|
||||
|
||||
- **Offer draw** / **Accept draw**. Making a move instead declines an offer.
|
||||
- **Resign** asks first.
|
||||
- **Claim win on time** appears when your opponent has gone more than 10 minutes past the time per move. Your phone times it from when it sent your last move; the 10 minutes allow for slow delivery. Other phones accept the claim once the time per move has passed since they heard that move.
|
||||
- **Ask for update** gets a stuck game moving. While you wait after your own move, it sends that move again, and your opponent's phone answers with its move if you missed it. Otherwise it asks the players to send the latest move again. A player answers within a few seconds, at most once a minute per game. A finished game answers too, with the last move and the resignation, draw accept or win claim that ended it, so a game whose last packet got lost still ends on every phone.
|
||||
|
||||
If the radio doesn't confirm a move, the move stays on your board, since it may have gone out, and the game says so. Use **Ask for update** to send it again.
|
||||
|
||||
Checkmate, stalemate, not enough pieces to mate, the 50-move rule and repetition end the game on their own.
|
||||
|
||||
You get a notification when you're challenged, when it's your move, and when a game ends, unless the channel is muted or the game is open on screen. Notifications open the channel.
|
||||
|
||||
## Watch
|
||||
|
||||
Every game on the channel shows up under **Live games**. If you joined late, the board appears with the next move, because each move carries the whole position. Moves from before you joined show as "(missed)". Until you've heard how the game started, the players are marked as not confirmed; **Ask for update** fetches that. If your phone never heard the invite, the players stay marked as not confirmed, because nothing ties them to it.
|
||||
|
||||
Finished games stay in the list for a week. Tap **✕** to remove one sooner.
|
||||
|
||||
## How moves are sent
|
||||
|
||||
Each packet starts with a 5-byte header: app and packet kind, a random 2-byte game ID, and the 2-byte half-move number. Kinds are invite, accept, decline, move, resign, draw offer, draw accept, cancel, timeout claim, game info and request.
|
||||
|
||||
A move is 48 bytes or less, which fills four 16-byte encrypted blocks on air:
|
||||
|
||||
| Field | Bytes |
|
||||
|---|---|
|
||||
| Header | 5 |
|
||||
| Move, as its index in the sorted list of legal moves | 1 |
|
||||
| Chain value (see below) | 16 |
|
||||
| Position after the move | ≤26 |
|
||||
|
||||
The position is an 8-byte map of occupied squares, 2 bytes for side to move, castling, en passant and the 50-move counter, then half a byte per piece.
|
||||
|
||||
Other packets: invite 55 bytes (87 for a challenge, with the name), accept 53, decline 37, resign, draw offer, draw accept, cancel and timeout claim 21 each, game info 122, request 6, with names of up to 31 bytes.
|
||||
|
||||
**Checking who moved.** Each player's phone makes a secret value and hashes it 512 times. Only the last hash is sent, in the invite or accept. Each later action reveals the hash one step back, which anyone can check by hashing it forward but nobody else can produce. A packet with a value that doesn't fit the player's chain is ignored. Each value counts once, and only after the ones before it: the first packet heard with a value uses it up, even when it doesn't change the game (a draw offer for a position you haven't seen yet, say), and values before it no longer count. If your opponent then needs a move again, their phone sends it with a new value. Player names are not checked; the chain is.
|
||||
|
||||
The inviter's first value after the commitment is kept for the game info, which says whose accept won. Anyone who heard the invite can check it came from the inviter, and works out the colours from the invite rather than taking the packet's word. If you accepted and the game info names someone else, you watch the game instead, and switch to playing if a later game info names you.
|
||||
|
||||
Players also check that the move gives the position in the packet. Spectators who missed moves take the position as it is. A draw accept only counts after a draw offer, and a timeout claim only when the game has a time per move and it has run out. Both are for the position they were sent in: one that crosses a move on air counts on neither phone.
|
||||
|
||||
Your secret values stay on your phone, stored per radio with the rest of the game.
|
||||
@@ -5,11 +5,15 @@ MeshCore Open can send a highly compressed image as channel GRP_DATA packets. Un
|
||||
## Requirements and setup
|
||||
|
||||
- Companion firmware version code **11 or later** (identified in the connector as v1.15.0) for the current channel-data layout.
|
||||
- A native runtime with a working ONNX backend. The web build has no image codec backend.
|
||||
- A native runtime with a working ONNX backend. The web build has no image codec backend, and neither does a native build made without ONNX Runtime (see below).
|
||||
- The image model bundle installed through App Settings → Image model, and Enable image messages turned on.
|
||||
- Enough storage for the roughly 1 GB bundle and enough available memory for reconstruction, which can peak above 2 GB. Actual latency and memory usage depend on hardware.
|
||||
|
||||
Downloads use the configured Hugging Face model bundle, support resume, and verify file checksums. Download the model while internet is available. Once installed, encoding and reconstruction run locally; photos are not uploaded for inference. Compatible recipients need the same supported codec/model format.
|
||||
Downloads use the configured Hugging Face model bundle, support resume, and verify file checksums. App Settings shows that bundle as one model row — name, size, and status — the same row used for translation models. Download the model while internet is available. Once installed, encoding and reconstruction run locally; photos are not uploaded for inference. Compatible recipients need the same supported codec/model format.
|
||||
|
||||
### Builds without ONNX Runtime
|
||||
|
||||
`scripts/onnx.sh off` builds the app with a pure-Dart stub in place of `flutter_onnxruntime`, so no platform downloads or bundles ORT ([how to build](../README.md#building-without-onnx-runtime)). In that build image messages are unavailable, exactly as on web: the image button and Settings explain that the build has no ONNX Runtime, the model cannot be downloaded, and received images cannot be reconstructed. `scripts/onnx.sh on` restores the default build. The app detects the stub because its `OnnxRuntime()` constructor throws (`imageCodecRuntimeAvailable` in [image_codec_backend.dart](../lib/services/image_codec_backend.dart)).
|
||||
|
||||
## Send an image
|
||||
|
||||
@@ -34,7 +38,7 @@ Chunks are reassembled into an image entry in channel chat. A partially received
|
||||
|
||||
With Process images automatically enabled, complete images are queued for local reconstruction. Automatic decoding runs only while the app is in the foreground, one image at a time, with at most 3 images queued; when more arrive, the newest 3 are kept and the rest wait for a tap. Otherwise, tap an image entry to process it. Download/enable the model if prompted. A failed reconstruction can be retried; missing chunks and inference errors are different failures.
|
||||
|
||||
Tap a reconstructed image to inspect it. Long-press or right-click its chat bubble for Packet info, Delete, and Save (available once decoded). Deletion is local. Encoded streams and reconstructed images are persisted in application storage, capped at 200 images, 64 MB, and 30 days, plus a limit of 400 image entries (including ones waiting to be decoded and your own sent images once their data has expired). When the cap is reached, the oldest reconstructed images are evicted first and show "Image no longer stored"; they can be decoded again while their small encoded stream remains. Past 30 days the stream is removed too.
|
||||
Tap a reconstructed image to inspect it. Long-press or right-click its chat bubble for Copy (copies sender, timestamp, byte/packet summary, and the AI-reconstruction caption when decoded), Packet info, Delete, and Save (available once decoded). Copying raw image pixels to the clipboard is not supported—use Save image to export or share the PNG with its provenance caption—and AEIC images cannot be re-sent by pasting text into the composer because they travel as binary `GRP_DATA` chunks. Deletion is local. Encoded streams and reconstructed images are persisted in application storage, capped at 200 images, 64 MB, and 30 days, plus a limit of 400 image entries (including ones waiting to be decoded and your own sent images once their data has expired). When the cap is reached, the oldest reconstructed images are evicted first and show "Image no longer stored"; they can be decoded again while their small encoded stream remains. Past 30 days the stream is removed too.
|
||||
|
||||
## Other image features
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ The colors and markers below describe the standard theme. A custom, preset, or h
|
||||
## How to Access
|
||||
|
||||
- **QuickSwitchBar tab 2** (rightmost) from Contacts or Channels
|
||||
- **Deep-link from a chat message**: Tapping a shared location pin in a chat opens the map centered on that pin
|
||||
- **Deep-link from a shared location pin**: Tapping a shared location pin (`m:<lat>,<lon>|...`) in a chat opens the map centered on that pin
|
||||
- **Tap an inline GPS coordinate in a message**: Tapping a detected decimal coordinate pair (for example `37.7749, -122.4194`) opens a dedicated full-screen **Location** map centered on that point; see [Inline GPS Coordinates](chat-and-messaging.md#inline-gps-coordinates)
|
||||
- **Settings → Offline Map Cache**: Opens the tile cache management screen
|
||||
|
||||
## What the Map Displays
|
||||
@@ -114,6 +115,9 @@ Additional filters:
|
||||
### Legend Card (Top-Right)
|
||||
Shows node count and pin count. Tappable to expand a legend of all marker types.
|
||||
|
||||
### Coordinate Location Map (From Chat Text)
|
||||
Tapping a decimal GPS coordinate in a message or bookmark opens a focused **Location** screen (`CoordinateMapScreen`) centered on that coordinate at zoom 15 (range 2–18) with a pin marker, a bottom coordinate card, **Zoom in** (`+`) / **Zoom out** (`-`) / **Center map** buttons, desktop arrow/WASD pan and R/F zoom support, and app bar actions for **Copy location** and **Open in maps** (`geo:` on Android, Apple Maps on iOS/macOS, OpenStreetMap in the browser on Linux/Windows/web). Pressing Back returns to the chat at the same scroll position. Unlike structured `m:<lat>,<lon>|...` pins, plain-text coordinates are not added as persistent flag markers on the main Mesh Map.
|
||||
|
||||
---
|
||||
|
||||
## Path Trace Map
|
||||
|
||||
@@ -48,6 +48,7 @@ ContactsScreen (selected=0)
|
||||
├─ [quick-switch 1] → pushReplacement → ChannelsScreen
|
||||
├─ [quick-switch 2] → pushReplacement → MapScreen
|
||||
├─ [tap contact] → push → ChatScreen
|
||||
├─ [FAB / overflow > Add Contact] → push → AddContactScreen
|
||||
├─ [overflow > Settings] → push → SettingsScreen
|
||||
└─ [overflow > Discovered] → push → DiscoveryScreen
|
||||
|
||||
|
||||
@@ -102,10 +102,11 @@ Access via **App Settings → Notifications**:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| Enable Notifications | On | Master toggle; requests OS permission when turned on |
|
||||
| Message Notifications | On | DM alerts (greyed out if master is off) |
|
||||
| Channel Message Notifications | On | Channel alerts (greyed out if master is off) |
|
||||
| Advertisement Notifications | On | New node alerts (greyed out if master is off) |
|
||||
| Enable Notifications | On | Master toggle (shows off if OS permission is denied); requests OS permission when turned on and reveals the options below |
|
||||
| Message Notifications | On | Direct message alerts (shown when notifications are enabled) |
|
||||
| Channel Message Notifications | On | Channel message alerts (shown when notifications are enabled) |
|
||||
| Advertisement Notifications | On | New node alerts (shown when notifications are enabled) |
|
||||
| Background Activity (Android) | — | Opens system battery optimization settings (shown when notifications are enabled) |
|
||||
|
||||
### Per-Channel Notification Modes
|
||||
|
||||
|
||||
@@ -57,3 +57,39 @@ them into the selected radio's scope. Review-mode cleanup also covers the databa
|
||||
For a manual full application-data copy, keep the history database alongside the
|
||||
application's other support files; copying the preferences file alone no longer
|
||||
includes native message or route histories.
|
||||
|
||||
## Long contact and channel lists
|
||||
|
||||
`test/screens/list_scroll_perf_test.dart` builds the contacts list with 500
|
||||
contacts and the channels list with 40 channels, flings each one with a
|
||||
connector notify partway through, and prints build counts and how many visible
|
||||
rows were blank or still fading in during the fling:
|
||||
|
||||
```sh
|
||||
flutter test test/screens/list_scroll_perf_test.dart
|
||||
```
|
||||
|
||||
It fails if rows scrolled into view play the entrance fade, or if a connector
|
||||
notify that changes nothing rebuilds contact rows. The counts are a widget-test
|
||||
proxy; frame times still need a phone.
|
||||
|
||||
To check scrolling on a phone:
|
||||
|
||||
1. Connect a radio with several hundred contacts and a few dozen channels (or
|
||||
use the same radio before and after a change), then run
|
||||
`flutter run --profile` on the phone.
|
||||
2. Open DevTools from the printed link and select the Performance page. Turn
|
||||
on "Track widget builds" only for a separate run: it adds overhead to the
|
||||
frame times.
|
||||
3. Open Contacts, wait for sync to finish, and clear the timeline.
|
||||
4. Fling the list hard to the bottom and back to the top five times, then drag
|
||||
it up and down quickly for a few seconds. Repeat while messages and adverts
|
||||
are arriving.
|
||||
5. In the frame chart, note the share of frames over budget (16 ms at 60 Hz,
|
||||
8 ms at 120 Hz) on the UI and raster threads, and the worst frames. Select a
|
||||
slow frame to see whether build, layout, paint or raster dominates.
|
||||
6. Watch the screen: rows must be fully drawn as they enter, with no blank
|
||||
rows trailing the finger.
|
||||
7. Repeat steps 3 to 6 on Channels.
|
||||
8. Record the device, build mode, contact and channel counts and the numbers
|
||||
from step 5 for the before and after builds.
|
||||
@@ -19,7 +19,7 @@ From the Contacts screen:
|
||||
- Routing mode selector and "Manage Paths" link are available directly in the dialog (configure routing before login)
|
||||
- Auto-retries up to 5 times on timeout, showing progress ("Attempt 2 of 5"). A wrong password (explicit failure response) stops immediately — only timeouts trigger retries
|
||||
- CLI commands to a repeater are matched to their reply by a short prefix. A reply that arrives late for an earlier attempt still completes the command, and no further attempts are sent
|
||||
- If auto-clock-sync is enabled for this repeater (configured in Repeater Settings), a `clock sync` command is sent automatically on successful login
|
||||
- If clock sync on login is on for this repeater, a `clock sync` command is sent automatically on successful login. The repeater's choice is Default, On, or Off. Default follows **Sync repeater clock on login** in App Settings → Repeaters and Rooms, which is off unless you turn it on
|
||||
|
||||
---
|
||||
|
||||
@@ -179,7 +179,7 @@ Most settings are declared once in `repeaterSettingSpecs` (`lib/models/repeater_
|
||||
- Packet forwarding toggle (`set repeat`)
|
||||
- Guest access toggle (`set allow.read.only`)
|
||||
- Multi-ACKs toggle (`set multi.acks`)
|
||||
- Auto clock sync after login toggle (local app setting only, not sent to repeater)
|
||||
- Clock sync after login (Default / On / Off; local app setting only, not sent to repeater). Default follows App Settings → Repeaters and Rooms
|
||||
|
||||
**5. Network Health**
|
||||
- Loop detection dropdown (off / minimal / moderate / strict; `set loop.detect`)
|
||||
@@ -218,7 +218,7 @@ Most settings are declared once in `repeaterSettingSpecs` (`lib/models/repeater_
|
||||
- Erase filesystem (serial-only; shown disabled with an explanation — no command is sent over the air)
|
||||
|
||||
### Key Interactions
|
||||
- **Settings are not fetched on open by default.** Each `get` is a separate LoRa round trip, so fetching everything is slow and uses airtime. Turn on **Auto-fetch repeater settings** in App Settings to fetch everything when the screen opens; otherwise use **Refresh all** or the per-setting refresh buttons. Name and location are pre-filled from cached contact data
|
||||
- **Settings are not fetched on open by default.** Each `get` is a separate LoRa round trip, so fetching everything is slow and uses airtime. Turn on **Auto-fetch repeater settings** in App Settings → Repeaters and Rooms to fetch everything when the screen opens; otherwise use **Refresh all** or the per-setting refresh buttons. Name and location are pre-filled from cached contact data
|
||||
- Every control can be edited before its value has been fetched. Unfetched values show as "—" (or off) until fetched or edited, and only edited settings are sent on save
|
||||
- Save button in app bar appears when any change is detected; failed commands keep those settings dirty for retry, and a saved value counts as the repeater's current value
|
||||
- Settings are sent sequentially with 200ms delays between commands; firmware responses are checked and partial failures are reported in a snackbar
|
||||
|
||||
@@ -55,11 +55,15 @@ Contacts/messages persist hop count, path bytes, and width. Legacy contact recor
|
||||
- **Faded stats:** each route keeps delivery and failure counts that lose half their weight every 24 hours (`routeStatsHalfLife`), so recent behaviour outweighs old.
|
||||
- **Thompson sampling:** for each attempt, a plausible delivery rate is drawn for every route from its faded counts and the best draw wins. Proven routes win most of the time; untested or recovering routes are still tried occasionally. Speed adjusts the score slightly.
|
||||
- **Context:** `MeshCoreConnector.routeContextFor` reports what the radio heard in the last two hours (advertisers heard directly and the last hop of relayed adverts). Routes whose first hop was heard — or the direct route, when the contact itself was heard directly — score higher; routes that don't fit score lower. Not hearing a repeater is weak evidence, so nothing is excluded. With nothing heard, context has no effect.
|
||||
- **Retries** halve the score of routes already tried for the same message, so they usually try something different without wasting an attempt on a much weaker route. The final attempt always floods.
|
||||
- **Retries** halve the score of routes already tried for the same message, so they usually try something different without wasting an attempt on a much weaker route. Direct attempts use a known route. Once those are used up, the remaining attempts flood (`SendAttemptPlan.floodFromAttempt`). With flood attempts set to 0, a send never switches to flood.
|
||||
- **Offline contacts:** `MessageRetryService` holds a message's route failures until its fate is known. If any attempt is acknowledged, the routes that timed out are blamed; if nothing gets through, the contact was probably unreachable and no route is blamed.
|
||||
- **Forgetting:** a failing route is deleted only after it hasn't delivered for a week, so a repeater that is down for a day is still known when it returns.
|
||||
- Route picks and their results are written to the app debug log under the `Routing` tag.
|
||||
|
||||
`resolvePathSelection` uses a route picked from history even when the radio itself holds no path for the contact, so repeater logins and commands use proven routes instead of flooding.
|
||||
|
||||
## Building a path by hand
|
||||
|
||||
Chat → Routing → Manual opens the Build Path sheet. The hops you have added stay pinned at the top, including while the keyboard is open, and the one just added is highlighted. Under that list is the hex field, so a path can be typed without scrolling past every repeater. On a very short sheet, such as landscape with the keyboard open, the hop list, hex field, search field, and repeater list scroll together so the search field stays reachable. Search matches repeater and room names and hop hashes (the public-key prefix). Names that start with the query are listed before other substring matches, then hash-only matches.
|
||||
|
||||
For message-path actions, trace maps, and retry behavior, see [chat](chat-and-messaging.md), [channels](channels.md), and [map](map-and-location.md).
|
||||
+23
-14
@@ -119,18 +119,32 @@ A dedicated sub-screen for app-level preferences (nothing here is sent to the de
|
||||
Individual channels can be muted from the channel chat bell icon, the channel list, or the channel notification. Replying from notifications, watches, and Android Auto is described in [Notifications](notifications.md).
|
||||
|
||||
### Messaging
|
||||
- **Clear Path on Max Retry**: Erases the stored routing path after all retries fail
|
||||
- **Jump to Oldest Unread**: When opening a chat, scrolls to the oldest unread message instead of the newest
|
||||
- **Auto-fetch Repeater Settings** (off by default): Requests every setting when a repeater's settings screen opens. Each setting is a separate request over LoRa, so this is slow and uses airtime; when off, use Refresh All or the per-setting refresh buttons. See [Repeater Settings](repeater-management.md#repeater-settings)
|
||||
- **Auto Route Rotation**: Lets the app choose each message's route from the routes that have worked for that contact (see [Auto route selection](routing-paths.md#auto-route-selection)). When enabled, it expands (hidden when off) to show:
|
||||
- Max Message Retries (2–10, default 5)
|
||||
- **Reset Routing Algorithm to Default**: Restores the routing settings to their factory defaults
|
||||
- **Enable Message Tracing**: Shows path trace overlays and extra metadata on messages
|
||||
- **Region next to hop count** (default off): Shows a channel message's region chip on the same line as its hop count instead of below it
|
||||
- **Compression indicator** (default off): Shows an icon on direct and channel messages that were compressed with SMAZ
|
||||
|
||||
### Routing
|
||||
What happens when a message is sent. Each slider shows its selected number in the title. Turning a switch on reveals its extra controls with the same animation.
|
||||
|
||||
- **Clear Path on Max Retry**: Erases the stored routing path after every send attempt fails
|
||||
- **Direct attempts** (0–15, default 4): How many times to try a known route. Available whether or not auto route rotation is on
|
||||
- **Flood attempts** (0–10, default 1): How many times to flood. Floods use more airtime. With rotation on, these run after the direct attempts. With it off, they apply only when the contact's path is already Flood
|
||||
- **Auto Route Rotation**: Lets the app choose each direct attempt's route from the routes that have worked for that contact (see [Auto route selection](routing-paths.md#auto-route-selection)). Off keeps the contact's current path for every attempt
|
||||
- **Resend channel messages until they travel far enough** (default off): If your channel message isn't heard coming back through enough repeaters, it's sent again. Uses more airtime. When on, it shows:
|
||||
- Required hops (1–8, default 2)
|
||||
- Resend up to (1–5 times, default 1)
|
||||
- **Also count different nearby repeaters** (default off): Treats the message as sent once that many *different* first-hop repeaters have repeated it, even if you can't hear it travel further. Useful where only nearby repeaters are audible. See [Channels](channels.md#channel-auto-resend)
|
||||
- **Reset routing settings to defaults**: Restores every control in this section (the toggles, the attempt limits, and the stored route-weight constants) to the factory defaults
|
||||
|
||||
If both direct and flood attempts are 0, the message is still sent once on the current path. A saved `max_message_retries` value from an older version becomes that many attempts minus one direct, plus one flood, which keeps the old "last attempt floods" behaviour for the previous default of 5 (4 direct + 1 flood).
|
||||
|
||||
### Repeaters and Rooms
|
||||
- **Sync repeater clock on login** (off by default): After a successful repeater login, send `clock sync`. Off is the previous default: a repeater only synced when its own switch was on. Each repeater can override this with Default, On, or Off. Default follows this switch. A saved per-repeater on or off stays an override
|
||||
- **Focus the password field** (off by default): On keeps the previous login dialog: the cursor goes into an empty password field (room login still skips this on a phone). Off waits until you tap the field, so the keyboard does not cover the dialog
|
||||
- **Login attempts** (1–10, default 5): How many times to try logging in to a repeater or room server. Telemetry fetches are sent once and have no retry setting
|
||||
- **Auto-fetch Repeater Settings** (off by default): Requests every setting when a repeater's settings screen opens. Each setting is a separate request over LoRa, so this is slow and uses airtime; when off, use Refresh All or the per-setting refresh buttons. See [Repeater Settings](repeater-management.md#repeater-settings)
|
||||
- **Reset repeater and room settings to defaults**: Restores the controls in this section. Choices saved on individual repeaters are left alone
|
||||
|
||||
### Battery
|
||||
- **Battery Chemistry**: NMC / LiFePO4 / LiPo (per device, used to calibrate percentage from voltage)
|
||||
@@ -148,16 +162,11 @@ Individual channels can be muted from the channel chat bell icon, the channel li
|
||||
- **Offline Map Cache**: Navigate to tile download screen
|
||||
|
||||
### Translation
|
||||
Not shown on web. Controls on-device message translation powered by a locally-downloaded ML model:
|
||||
- **Enable translation**: Enables message translation controls
|
||||
Not shown on web. Controls on-device message translation powered by a locally-downloaded ML model. Turn on **Enable translation** first; the translation options and model rows then appear:
|
||||
- **Auto-translate incoming messages**: Automatically translates incoming messages for chat/channel display and notifications
|
||||
- **Translate before sending**: Sets the default state of the composer's translate icon (on means messages are translated before sending)
|
||||
- **Target language**: Language to translate into (searchable list; defaults to the app language)
|
||||
- **Downloaded model**: Dropdown to select among already-downloaded translation models
|
||||
- **Preset Hugging Face model**: Download a curated preset model with one tap
|
||||
- **Manual model URL**: Enter a URL to download a custom GGUF-format model; shows download progress and a cancel button
|
||||
|
||||
The auto-translate and composer toggles are disabled until **Enable translation** is on.
|
||||
- **Models**: The same model rows used for the image codec. Each preset is one row with its name, size once known, and status (not downloaded, downloading with progress, ready, or couldn't download). The model in use is marked Active; tap another ready row to switch. Download, cancel, and remove are the row's action. A manual model URL under the list downloads a custom GGUF file into the same list.
|
||||
|
||||
### IPFS Provider Configuration
|
||||
|
||||
@@ -175,10 +184,10 @@ Save the settings before sharing. The upload action is shown in the chat compose
|
||||
|
||||
### Image Messages
|
||||
|
||||
Image message controls live in App Settings → Messaging. Turn on **Enable image messages** first; **Process images automatically** and the image model download/cancel/removal controls then appear. Automatic processing reconstructs every image as it arrives and uses about 2 GB of memory for a second each time; leave it off to reconstruct with a tap. See [Image Messages](image-messages.md) for firmware, native-runtime, storage, and memory requirements.
|
||||
Image message controls live in App Settings → Messaging. Turn on **Enable image messages** first; **Process images automatically** and the image model row then appear. That row is the same model list used for translation: name, size, status (not downloaded, downloading with progress, ready, or couldn't download), and one action (download, cancel, or remove). A finished install is marked Active. Automatic processing reconstructs every image as it arrives and uses about 2 GB of memory for a second each time; leave it off to reconstruct with a tap. See [Image Messages](image-messages.md) for firmware, native-runtime, storage, and memory requirements.
|
||||
|
||||
### Cyrillic-to-Latin (Cyr2Lat)
|
||||
Controls character substitution profiles used to render Cyrillic text in Latin characters. A dropdown selects the active profile; Add, Edit, and Delete buttons manage the profile list (the last remaining profile cannot be deleted). Each profile stores a JSON character map.
|
||||
Controls character substitution profiles used to render Cyrillic text in Latin characters. A dropdown selects the active profile; Add, Edit, and Delete buttons manage the profile list (the last remaining profile cannot be deleted). Each profile stores a JSON character map. The active profile is the default; each chat can pick its own in its **Compression** strip (see [Compression](additional-features.md#compression-smaz-and-cyr2lat)).
|
||||
|
||||
### Debug
|
||||
- **App Debug Logging**: Enable the in-app debug log
|
||||
|
||||
Reference in new issue
Block a user