Use one model row for image and translation downloads
Image settings, translation settings, and the restore prompt each listed models differently. Share ModelDownloadList so every model shows the same name, size, status, selection, and download, cancel, or remove action. Co-authored-by: zjs81 <zjs81@users.noreply.github.com>
This commit is contained in:
50 files changed
+2524
-833
No files matched your search
@@ -122,6 +122,7 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act
|
||||
| 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 |
|
||||
| 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 |
|
||||
@@ -147,6 +148,22 @@ 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.
|
||||
|
||||
### 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`, rows separated by `Divider(height: 1, indent: 16)`:
|
||||
|
||||
| Part | What it shows |
|
||||
|---|---|
|
||||
| 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). The leading icon carries the colour: `primary` when that model is active or downloading, `error` on failure, `onSurfaceVariant` otherwise. |
|
||||
| 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` 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.
|
||||
|
||||
## 6. Sheets, dialogs and pages
|
||||
|
||||
What the code does:
|
||||
|
||||
@@ -9,7 +9,7 @@ MeshCore Open can send a highly compressed image as channel GRP_DATA packets. Un
|
||||
- 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.
|
||||
|
||||
## Send an image
|
||||
|
||||
|
||||
@@ -153,9 +153,7 @@ Not shown on web. Controls on-device message translation powered by a locally-do
|
||||
- **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
|
||||
- **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.
|
||||
|
||||
The auto-translate and composer toggles are disabled until **Enable translation** is on.
|
||||
|
||||
@@ -175,7 +173,7 @@ 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.
|
||||
|
||||
Reference in new issue
Block a user