Merge upstream/dev (2 commits) [upstream-sync]

This commit is contained in:
upstream-sync-bot committed 2026-11-27 04:51:29 +00:00
commit b984e1d9a3
60 files changed
+989 -1472

No files matched your search

+3 -1
View File
@@ -137,6 +137,7 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act
| 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 |
| Alternatives on one page | `TabBar` (icon and label per tab) in `AppBar.bottom` with a `TabBarView` | Connect a radio (`connect_screen.dart`). A tab that needs its own FAB is its own `Scaffold` inside its own `ScaffoldMessenger`, so its snackbars lift its FAB. Labels shrink to fit (`FittedBox`) rather than fade. While an action runs that leaving the tab would cancel, lock the tabs: `ExcludeFocus` and `IgnorePointer` at 50 % opacity, and `NeverScrollableScrollPhysics`. When the keyboard leaves under 400 dp, drop the tab bar and the header so a form keeps room |
| 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 |
@@ -146,6 +147,7 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act
| Empty list | `EmptyState(icon:, title:, subtitle:, action:)` | Scrolls rather than overflowing at large text |
| Inline error with retry | `ErrorRetryCard(message:, onRetry:, retryLabel:)` | Pass `retryLabel: context.l10n.common_retry` |
| Radio offline on a remote-node screen | `RadioDisconnectedBanner` | Renders nothing while connected |
| Card the user can close | `GetNodeBanner` (bottom of Connect a radio) | Close `IconButton` (`common_close` tooltip) at the end of the title row; closing hides it with `RevealOnEnable` until the page closes. At most 40 % of the screen height, scrolling inside at large text; hidden on screens under 480 dp tall (a landscape phone) |
| Progress bar | `MeshProgressBar`; `MeshProgressAppBarBottom` as an app bar `bottom`; `SyncProgressAppBarBottom` for the app syncs, with `busy: true` while the screen waits for the radio (Settings actions) (`widgets/sync_progress_overlay.dart`) | See [Progress bars](#progress-bars) |
| Toast message | `showDismissibleSnackBar(context, content: Text(...))` | Tap to dismiss, replaces the current snackbar, safe after an async gap |
| 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 |
@@ -177,7 +179,7 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act
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.
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, the device-info rows on the Settings screen, and the node banner on Connect a radio.
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`.
+8 -9
View File
@@ -5,7 +5,7 @@
The app follows this general flow:
```
Launch → Scanner Screen → [Connect via BLE/USB/TCP] → Channels Screen
Launch → Connect a radio → [Connect via BLE/USB/TCP] → Channels Screen
Launch (a radio connected before) → Channels Screen (offline until connected)
```
@@ -32,17 +32,16 @@ Tapping a tab replaces the current screen with a subtle fade + slight horizontal
- **Theme mode** is user-configurable in App Settings (System / Light / Dark) — not locked to system
- **Language** can be overridden to one of 18 supported languages, or follow the system locale
- On web, if a non-Chromium browser is detected, the app shows a `ChromeRequiredScreen` instead of the Scanner (the web client needs Chrome for Web Serial USB)
- On web, if a non-Chromium browser is detected, the app shows a `ChromeRequiredScreen` instead of Connect a radio (the web client needs Chrome for Web Serial USB)
## Full Navigation Graph
```
ScannerScreen (root when no radio is remembered; otherwise pushed from the connect sheet)
├─ [BLE connect] → ChannelsScreen as the only route
├─ [TCP icon button] → push → TcpScreen
│ └─ [TCP connected] → ChannelsScreen as the only route
└─ [USB icon button] → push → UsbScreen
└─ [USB connected] → ChannelsScreen as the only route
ConnectScreen (root when no radio is remembered; otherwise pushed from the connect sheet,
on the tab of the last radio's connection type)
├─ [Bluetooth tab: BLE connect] → ChannelsScreen as the only route
├─ [USB tab: USB connect] → ChannelsScreen as the only route
└─ [TCP tab: TCP connect] → ChannelsScreen as the only route
ContactsScreen (selected=0)
├─ [quick-switch 1] → pushReplacement → ChannelsScreen
@@ -71,7 +70,7 @@ Settings (push from any main screen)
└─ [Offline Map Cache] → push → MapCacheScreen
```
A connection made from the scanner, USB, TCP or review mode replaces the whole stack with ChannelsScreen (`navigateToMainAfterConnect`). Leaving the scanner cancels only a Bluetooth connection it started; a pending automatic reconnect is left alone.
A connection made from any tab or from review mode replaces the whole stack with ChannelsScreen (`navigateToMainAfterConnect`). Leaving the Bluetooth tab cancels a Bluetooth connection in progress, leaving the USB tab a USB one, and leaving the TCP tab only a connection started from it (the tabs are locked while connecting); a pending automatic reconnect is left alone.
## Additional settings destinations
+5 -5
View File
@@ -4,7 +4,7 @@ When no radio is connected, the app keeps showing the last radio you connected t
## What you see
- **Launch.** If a radio has connected before, the app opens on Channels instead of the scanner. With no remembered radio it opens on the scanner, as before.
- **Launch.** If a radio has connected before, the app opens on Channels instead of Connect a radio. With no remembered radio it opens on Connect a radio, as before.
- **Contacts, channels, messages, unread counts and the map** show that radio's saved data. Chats open, scroll, search and jump as usual.
- **App bar.** The battery and signal indicators are replaced by a **Connect** button (icon only on narrow screens). The subtitle reads "Offline · *radio name*". While the app is connecting, or a dropped link will be retried, a "Reconnecting…" chip shows instead; tapping it opens the same sheet.
- **Message box.** Each chat replaces the message box with "Connect to a radio to send messages" and a Connect button. Text you typed before the link dropped is kept and comes back when the radio reconnects.
@@ -13,13 +13,13 @@ When no radio is connected, the app keeps showing the last radio you connected t
The Connect button and the overflow menu's **Connect** entry (it replaces **Disconnect** while offline) open a sheet with:
- **Reconnect to *name*.** For a Bluetooth or TCP radio. It connects directly, without the scanner. Not offered on web.
- **Choose a radio.** Opens the scanner (Bluetooth, USB or TCP). For a USB radio, or on web, it opens the USB screen.
- **Reconnect to *name*.** For a Bluetooth or TCP radio. It connects directly, without Connect a radio. Not offered on web.
- **Choose a radio.** Opens Connect a radio on the tab of the last radio's connection type (Bluetooth, USB or TCP); on web, the USB tab.
- **Stop reconnecting.** Shown while an automatic reconnect is pending.
After a connection made from the scanner, USB, TCP or review mode, the app shows Channels as its only screen. Reconnecting from the sheet keeps you on the screen you were on.
After a connection made from Connect a radio or review mode, the app shows Channels as its only screen. Reconnecting from the sheet keeps you on the screen you were on.
**Disconnect** asks for confirmation and then leaves you on the same screen, offline. The app no longer returns to the scanner when a radio disconnects.
**Disconnect** asks for confirmation and then leaves you on the same screen, offline. The app no longer returns to Connect a radio when a radio disconnects.
## What is available offline
+2 -2
View File
@@ -4,8 +4,8 @@ Review mode is a hidden mode for Google Play and App Store reviewers who have no
## Entering and Exiting
1. Open the **Connect** (scanner) screen.
2. **Long-press the "MeshCore Open" title.**
1. Open the **Connect a radio** screen.
2. **Long-press the "Connect a radio" title.**
3. Tap **Enter** in the dialog. The app connects to the simulated radio and opens the channel list.
While review mode is active, a banner at the top of the channel and contact lists shows **Send test message** and **Exit**. Tap **Exit**, or disconnect as usual, to leave review mode. The simulator is shut down, its data is deleted, and the app returns to the Connect screen.
+33 -45
View File
@@ -1,39 +1,38 @@
# Scanner & Connection
## BLE Scanner (Home Screen)
## Connect a Radio
The BLE Scanner is the app's home screen until a radio has connected once. After that the app opens on Channels with the last radio's saved data ([offline mode](offline-mode.md)).
**Connect a radio** is the app's home screen until a radio has connected once. After that the app opens on Channels with the last radio's saved data ([offline mode](offline-mode.md)).
### How to Access
- Opens automatically when the app starts and no radio is remembered
- From the main screens: **Connect** (app bar or overflow menu) → **Choose a radio**
- From the main screens: **Connect** (app bar or overflow menu) → **Choose a radio**. It opens on the tab of the last radio's connection type (on web, the USB tab)
- Disconnecting no longer returns here; the main screens stay open, read-only
### What the User Sees
**App Bar**: Centered title "Scanner".
**App Bar**: Centered title "Connect a radio" with **Bluetooth**, **USB** and **TCP** tabs below it. Tap a tab or swipe between them. There is no USB tab on iOS, and no TCP tab on web (Chrome). The tabs stay put while a connection is being made, because leaving a tab cancels its connection.
**Bluetooth-Off Warning Banner** (conditional): Appears when the Bluetooth adapter is off, showing a `bluetooth_disabled` icon, a warning message, and on Android, an "Enable Bluetooth" button.
**Status Bar**: A full-width colored strip reflecting the current connection state:
**Status Chip**: Under the tabs, the same on every tab:
| State | Text | Color |
|---|---|---|
| Disconnected | "Not connected" | Grey |
| Scanning | "Scanning..." | Blue |
| Scanning (Bluetooth) | "Scanning for devices..." | Blue |
| Connecting | "Connecting..." | Orange |
| Connected | "Connected to \<device name\>" | Green |
| Connected | "Connected to \<device name, USB port or TCP endpoint\>" | Green |
| Disconnecting | "Disconnecting..." | Orange |
**Device List**: When no devices are found, shows a large Bluetooth icon with a prompt. The prompt text is dynamic: "Searching for devices..." while actively scanning, or "Tap Scan to search" when idle. When devices are found, shows a scrollable list of `DeviceTile` widgets.
**Need a new node? card** (bottom of the page): Shown only when the remote `_banner.meshcoreopen.org` record turns it on, and not on a screen too short for it (under 480 dp, such as a landscape phone). Tapping it opens the shop link. **Close** hides it on every tab until you leave the page; it shows again the next time you open it.
**App Bar Actions**: Icon buttons in the top-right corner of the app bar:
- **USB** icon button - Opens USB connection screen (Android, Windows, Linux, macOS, Chrome web only)
- **TCP/IP** icon button - Opens TCP connection screen (all non-web platforms)
## Bluetooth Tab
**Bottom FAB**: A single floating action button:
- **BLE Scan** button - Toggles BLE scanning on/off; shows a spinner when scanning. **Disabled** (greyed out, not tappable) when Bluetooth is off
**Bluetooth-Off Warning Banner** (conditional): Appears when the Bluetooth adapter is off, showing a `bluetooth_disabled` icon, a warning message, and on Android, an "Enable Bluetooth" button.
**Device List**: When no devices are found, shows a large Bluetooth icon with a prompt: "Searching for MeshCore devices..." while scanning, or "Tap Scan to find MeshCore devices" when idle. When devices are found, shows a scrollable list of `DeviceTile` rows.
**Scan Button** (bottom right): Toggles BLE scanning on/off; shows a spinner when scanning. **Disabled** (greyed out, not tappable) when Bluetooth is off. Leaving the tab stops a scan, so the other tabs can connect straight away. On web, Scan explains that Bluetooth isn't available in the browser.
### Device Tile
@@ -47,7 +46,7 @@ Each discovered device is displayed as a list tile showing:
- **RSSI value** in dBm (e.g., "-72 dBm")
- **Device name** (falls back to "Unknown Device")
- **Device ID** (BLE MAC address on Android; a system-assigned UUID on iOS/macOS)
- **Connect button** (the entire tile row is also tappable — both trigger connection)
- The whole row is tappable to connect; a progress ring replaces the signal while connecting
Note: The weak (-80 to -90 dBm) and poor (< -90 dBm) tiers share the same icon shape and are only differentiated by color (orange vs. red).
@@ -61,7 +60,7 @@ Note: The weak (-80 to -90 dBm) and poor (< -90 dBm) tiers share the same icon s
### Connecting to a Device
Tap a device tile or its Connect button:
Tap a device row:
1. The connector stops scanning and transitions to "connecting"
2. Connects to the device with a 15-second timeout (6 seconds on Linux)
3. Requests MTU 185 bytes for optimal throughput
@@ -72,57 +71,46 @@ Tap a device tile or its Connect button:
---
## USB Connection
### How to Access
From the Scanner screen, tap the **USB** icon button in the app bar.
## USB Tab
### What the User Sees
- A colored status bar at the top (same color scheme as BLE scanner)
- A list of detected USB serial ports, each showing:
- A list of detected USB serial ports, in the same rows as Bluetooth devices:
- Friendly display name
- Raw port name (subtitle, only shown when it differs from the display name)
- Chevron trailing icon (the entire tile is tappable to connect)
- Transport switcher buttons (outlined, not FABs) to switch to BLE or TCP (these use `pushReplacement`, so back navigation returns to Scanner, not between USB/TCP)
- Raw port name (only shown when it differs from the display name)
- A progress ring on the port being connected
- On web: a **Choose serial port** button opens the browser's port picker; ports you already allowed are listed below it
### Key Interactions
- On desktop (Windows, Linux, macOS): ports are polled every 2 seconds for hot-plug detection (polling pauses while connecting/connected)
- On mobile: tap the "Scan" FAB to manually refresh
- Tap a port tile to connect
- On desktop (Windows, Linux, macOS): ports are polled every 2 seconds for hot-plug detection (polling pauses while connecting/connected); with nothing plugged in, the list says a radio shows up by itself
- On Android: tap **Refresh** to look for ports again
- Tap a port row to connect
- On successful connection, navigates to Channels screen
- On connection failure, the port list automatically refreshes
- Platform-specific error messages for common USB failures (permission denied, device missing, device detached, device busy, driver missing, port invalid, timeout, and more)
---
## TCP Connection
### How to Access
From the Scanner screen, tap the **TCP/IP** icon button in the app bar.
## TCP Tab
### What the User Sees
- A colored status bar at the top
- **Host address** text field
- **Port number** text field
- **Endpoint** text field
- **Port** text field
- **Connect** button
- Transport switcher buttons (outlined, not FABs) to switch to USB or BLE
### Key Interactions
- Last-used host and port are pre-populated from saved settings
- Last-used endpoint and port are pre-populated from saved settings
- On short screens, the tabs and the status chip hide while the keyboard is open
- Tap Connect to validate inputs and connect
- Host must not be empty
- Endpoint must not be empty
- Port must be a number between 1 and 65535
- Validation errors are shown as red snackbars
- Validation errors are shown under the fields
- The Connect button shows a spinner and "Connecting..." label while in progress
- The status bar shows the specific host:port being connected to (e.g., "Connecting to 192.168.1.1:5000")
- On success, navigates to Channels screen and saves the host/port to settings
- On connection, the status bar shows the active TCP endpoint (e.g., "Connected to 192.168.1.1:5000")
- On success, navigates to Channels screen and saves the endpoint and port to settings
- On connection, the status chip shows the active TCP endpoint (e.g., "Connected to 192.168.1.1:5000")
- Error messages for timeout, unsupported platform, and connection failures
### Automatic Reconnect
+1 -1
View File
@@ -16,7 +16,7 @@ Use Chrome (or a Chromium browser that identifies as Chrome) and HTTPS (or an ap
## Unexpected disconnect
BLE and TCP retry an unexpected disconnect with exponential backoff; manual disconnects do not trigger reconnect. USB requires reconnection through its connection screen. If a TCP companion still drops in the background on Android, allow background activity (App Settings → Notifications → **Background Activity**) and check the phone's Wi-Fi power-saving settings. Navigation returns to the scanner when a connection is lost. If reconnect continues to fail, check power, firmware, adapter state, and competing clients.
BLE and TCP retry an unexpected disconnect with exponential backoff; manual disconnects do not trigger reconnect. USB requires reconnecting from the USB tab of **Connect a radio**. If a TCP companion still drops in the background on Android, allow background activity (App Settings → Notifications → **Background Activity**) and check the phone's Wi-Fi power-saving settings. When a connection is lost, the app stays on the current screen, read-only. If reconnect continues to fail, check power, firmware, adapter state, and competing clients.
## Feature unavailable or no data