Merge origin/dev into cursor/consistent-model-download-ui-092a
This commit is contained in:
commit
94f24cf635
67 files changed
+5448
-875
No files matched your search
@@ -12,6 +12,12 @@ on:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
# ONNX Runtime for the Linux jobs. Its Linux downloads from
|
||||
# github.com/microsoft/onnxruntime currently 404, so tagged Linux AppImages
|
||||
# ship without image messages until this is set back to "on".
|
||||
MESHCORE_LINUX_ONNX: "off"
|
||||
|
||||
jobs:
|
||||
android:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -71,7 +77,7 @@ jobs:
|
||||
run: |
|
||||
shellcheck scripts/build_appimage.sh scripts/appimage/*.sh scripts/appimage/AppRun
|
||||
bash scripts/appimage/test_packaging.sh
|
||||
- run: flutter pub get
|
||||
- run: scripts/onnx.sh "$MESHCORE_LINUX_ONNX"
|
||||
- run: flutter build linux --release --no-pub
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Read AppImage base image
|
||||
@@ -141,7 +147,7 @@ jobs:
|
||||
run: |
|
||||
shellcheck scripts/build_appimage.sh scripts/appimage/*.sh scripts/appimage/AppRun
|
||||
bash scripts/appimage/test_packaging.sh
|
||||
- run: flutter pub get
|
||||
- run: scripts/onnx.sh "$MESHCORE_LINUX_ONNX"
|
||||
- run: flutter test --reporter expanded
|
||||
- name: Build ARM64 Linux release
|
||||
run: |
|
||||
|
||||
@@ -38,3 +38,9 @@ jobs:
|
||||
|
||||
- name: Run tests
|
||||
run: flutter test -r github
|
||||
|
||||
- name: Analyze and test without ONNX Runtime
|
||||
run: |
|
||||
scripts/onnx.sh off
|
||||
flutter analyze --fatal-infos --fatal-warnings
|
||||
flutter test -r github
|
||||
@@ -94,3 +94,6 @@ keystore.properties
|
||||
|
||||
# Claude Code local working dir (worktrees, jobs, settings)
|
||||
.claude/
|
||||
|
||||
# Written by scripts/onnx.sh off (ONNX-free build)
|
||||
/pubspec_overrides.yaml
|
||||
@@ -151,6 +151,26 @@ The matrix describes implemented functionality, not a guarantee that every featu
|
||||
flutter run
|
||||
```
|
||||
|
||||
### Building without ONNX Runtime
|
||||
|
||||
ONNX Runtime (ORT) runs only the [image message](documentation/image-messages.md) codec, and every platform build fetches it: Linux and Windows from GitHub releases, Android from Maven Central, iOS and macOS from CocoaPods/SwiftPM. If those downloads fail, build without it:
|
||||
|
||||
```bash
|
||||
scripts/onnx.sh off # stub flutter_onnxruntime, then flutter pub get
|
||||
flutter build apk --release # or linux, windows, ios, macos
|
||||
scripts/onnx.sh on # back to the default build
|
||||
```
|
||||
|
||||
`off` writes a git-ignored `pubspec_overrides.yaml` that points `flutter_onnxruntime` at the pure-Dart stub in `third_party/flutter_onnxruntime_stub`, so no native plugin or ORT library is built, downloaded or bundled. On Windows without bash, create that file by hand:
|
||||
|
||||
```yaml
|
||||
dependency_overrides:
|
||||
flutter_onnxruntime:
|
||||
path: third_party/flutter_onnxruntime_stub
|
||||
```
|
||||
|
||||
Image messages then behave as on web: the app cannot send them or reconstruct received ones, and Settings says the build has no ONNX Runtime. Everything else is unchanged. While the override is active, `flutter pub get` also rewrites the committed plugin registrants (`linux/`, `windows/`, `macos/Flutter/`); switch back before committing. Linux builds in CI (`.github/workflows/build.yml`) currently use this mode because the ORT Linux release downloads are unavailable.
|
||||
|
||||
### Linux AppImage
|
||||
|
||||
`flutter build linux --release` produces the regular Flutter bundle and an
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -40,13 +44,17 @@ From the Contacts screen, tap any Chat-type contact to open the ChatScreen.
|
||||
|
||||
### 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
|
||||
|
||||
|
||||
+13
-3
@@ -117,7 +117,8 @@ 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 |
|
||||
| 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 |
|
||||
| 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 |
|
||||
@@ -132,7 +133,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:
|
||||
|
||||
@@ -148,6 +149,15 @@ 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.
|
||||
|
||||
### 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).
|
||||
@@ -200,7 +210,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. |
|
||||
|
||||
|
||||
@@ -5,12 +5,16 @@ 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. 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
|
||||
|
||||
1. Open channel chat and tap the image button beside the composer.
|
||||
|
||||
@@ -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.
|
||||
@@ -176,7 +176,7 @@ Save the settings before sharing. The upload action is shown in the chat compose
|
||||
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
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_
|
||||
import '../utils/advert_signature.dart';
|
||||
import '../models/channel.dart';
|
||||
import '../models/channel_message.dart';
|
||||
import '../models/chat_compression_mode.dart';
|
||||
import '../models/bookmarked_message.dart';
|
||||
import '../models/companion_radio_stats.dart';
|
||||
import '../models/contact.dart';
|
||||
@@ -61,6 +62,7 @@ import '../storage/channel_settings_store.dart';
|
||||
import '../storage/channel_region_store.dart';
|
||||
import '../storage/channel_storage_migration.dart';
|
||||
import '../storage/channel_store.dart';
|
||||
import '../storage/contact_added_at_store.dart';
|
||||
import '../storage/contact_discovery_store.dart';
|
||||
import '../storage/contact_settings_store.dart';
|
||||
import '../storage/contact_store.dart';
|
||||
@@ -525,6 +527,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
final ChannelRegionStore _channelRegionStore = ChannelRegionStore();
|
||||
final ContactSettingsStore _contactSettingsStore = ContactSettingsStore();
|
||||
final ContactStore _contactStore = ContactStore();
|
||||
final ContactAddedAtStore _contactAddedAtStore = ContactAddedAtStore();
|
||||
final Map<String, DateTime> _contactAddedAt = {};
|
||||
final ContactDiscoveryStore _discoveryContactStore = ContactDiscoveryStore();
|
||||
final ChannelStore _channelStore = ChannelStore();
|
||||
final UnreadStore _unreadStore = UnreadStore();
|
||||
@@ -648,6 +652,11 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
return radio.bleDisplayName;
|
||||
}
|
||||
|
||||
/// Phone time a contact was first added from a card; the list orders by it
|
||||
/// while the radio has no advert time for the contact.
|
||||
DateTime? contactAddedAt(String contactPubKeyHex) =>
|
||||
_contactAddedAt[contactPubKeyHex];
|
||||
|
||||
Contact? getContactByPubKeyHex(String contactPubKeyHex) {
|
||||
return _contacts.cast<Contact?>().firstWhere(
|
||||
(c) => c?.publicKeyHex == contactPubKeyHex,
|
||||
@@ -1816,10 +1825,6 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
await _channelRegionStore.saveDefaultRegion(region);
|
||||
}
|
||||
|
||||
void ensureContactSmazSettingLoaded(String contactKeyHex) {
|
||||
_ensureContactSmazSettingLoaded(contactKeyHex);
|
||||
}
|
||||
|
||||
bool isChannelCyr2LatEnabled(int channelIndex) {
|
||||
_ensureChannelCyr2LatSettingLoaded(channelIndex);
|
||||
return _channelCyr2LatEnabled[channelIndex] ?? false;
|
||||
@@ -1830,10 +1835,6 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
return _contactCyr2LatEnabled[contactKeyHex] ?? false;
|
||||
}
|
||||
|
||||
void ensureContactCyr2LatSettingLoaded(String contactKeyHex) {
|
||||
_ensureContactCyr2LatSettingLoaded(contactKeyHex);
|
||||
}
|
||||
|
||||
Future<void> loadUnreadState() async {
|
||||
_contactUnreadCount
|
||||
..clear()
|
||||
@@ -2102,30 +2103,97 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
];
|
||||
}
|
||||
|
||||
Future<void> setChannelSmazEnabled(int channelIndex, bool enabled) async {
|
||||
final slots = _slotsSharingChannel(channelIndex);
|
||||
for (final slot in slots) {
|
||||
_channelSmazEnabled[slot] = enabled;
|
||||
ChatCompressionMode channelCompressionMode(int channelIndex) {
|
||||
if (isChannelSmazEnabled(channelIndex)) return ChatCompressionMode.smaz;
|
||||
if (isChannelCyr2LatEnabled(channelIndex)) {
|
||||
return ChatCompressionMode.cyr2lat;
|
||||
}
|
||||
final channelId = _channelIdForSlot(channelIndex);
|
||||
if (enabled) {
|
||||
for (final slot in slots) {
|
||||
_channelCyr2LatEnabled[slot] = false;
|
||||
}
|
||||
if (channelId != null) {
|
||||
await _channelSettingsStore.saveCyr2LatEnabled(channelId, false);
|
||||
}
|
||||
}
|
||||
if (channelId != null) {
|
||||
await _channelSettingsStore.saveSmazEnabled(channelId, enabled);
|
||||
}
|
||||
notifyListeners();
|
||||
return ChatCompressionMode.off;
|
||||
}
|
||||
|
||||
Future<void> setContactSmazEnabled(String contactKeyHex, bool enabled) async {
|
||||
_contactSmazEnabled[contactKeyHex] = enabled;
|
||||
await _contactSettingsStore.saveSmazEnabled(contactKeyHex, enabled);
|
||||
notifyListeners();
|
||||
ChatCompressionMode contactCompressionMode(String contactKeyHex) {
|
||||
_ensureContactSmazSettingLoaded(contactKeyHex);
|
||||
if (isContactSmazEnabled(contactKeyHex)) return ChatCompressionMode.smaz;
|
||||
if (isContactCyr2LatEnabled(contactKeyHex)) {
|
||||
return ChatCompressionMode.cyr2lat;
|
||||
}
|
||||
return ChatCompressionMode.off;
|
||||
}
|
||||
|
||||
/// Serializes compression writes so overlapping choices can't interleave
|
||||
/// their flag writes and leave SMAZ and Cyr2Lat both on.
|
||||
Future<void> _compressionWrites = Future<void>.value();
|
||||
|
||||
Future<void> _queueCompressionWrite(Future<void> Function() write) {
|
||||
final next = _compressionWrites.then((_) => write());
|
||||
_compressionWrites = next.catchError((_) {});
|
||||
return next;
|
||||
}
|
||||
|
||||
/// Saves [mode] for the channel in [channelIndex] and every slot holding
|
||||
/// the same channel. Flags are switched off before the new one is switched
|
||||
/// on, and memory follows each completed write, so a failure never leaves
|
||||
/// both on. Throws [StateError] when the slot has no storage ID.
|
||||
Future<void> setChannelCompressionMode(
|
||||
int channelIndex,
|
||||
ChatCompressionMode mode,
|
||||
) {
|
||||
return _queueCompressionWrite(() async {
|
||||
final channelId = _channelIdForSlot(channelIndex);
|
||||
if (channelId == null) {
|
||||
throw StateError('Channel slot $channelIndex has no storage ID');
|
||||
}
|
||||
final slots = _slotsSharingChannel(channelIndex);
|
||||
Future<void> writeSmaz(bool on) async {
|
||||
await _channelSettingsStore.saveSmazEnabled(channelId, on);
|
||||
for (final slot in slots) {
|
||||
_channelSmazEnabled[slot] = on;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> writeCyr2Lat(bool on) async {
|
||||
await _channelSettingsStore.saveCyr2LatEnabled(channelId, on);
|
||||
for (final slot in slots) {
|
||||
_channelCyr2LatEnabled[slot] = on;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (mode != ChatCompressionMode.smaz) await writeSmaz(false);
|
||||
if (mode != ChatCompressionMode.cyr2lat) await writeCyr2Lat(false);
|
||||
if (mode == ChatCompressionMode.smaz) await writeSmaz(true);
|
||||
if (mode == ChatCompressionMode.cyr2lat) await writeCyr2Lat(true);
|
||||
} finally {
|
||||
notifyListeners();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Contact counterpart of [setChannelCompressionMode].
|
||||
Future<void> setContactCompressionMode(
|
||||
String contactKeyHex,
|
||||
ChatCompressionMode mode,
|
||||
) {
|
||||
return _queueCompressionWrite(() async {
|
||||
Future<void> writeSmaz(bool on) async {
|
||||
await _contactSettingsStore.saveSmazEnabled(contactKeyHex, on);
|
||||
_contactSmazEnabled[contactKeyHex] = on;
|
||||
}
|
||||
|
||||
Future<void> writeCyr2Lat(bool on) async {
|
||||
await _contactSettingsStore.saveCyr2LatEnabled(contactKeyHex, on);
|
||||
_contactCyr2LatEnabled[contactKeyHex] = on;
|
||||
}
|
||||
|
||||
try {
|
||||
if (mode != ChatCompressionMode.smaz) await writeSmaz(false);
|
||||
if (mode != ChatCompressionMode.cyr2lat) await writeCyr2Lat(false);
|
||||
if (mode == ChatCompressionMode.smaz) await writeSmaz(true);
|
||||
if (mode == ChatCompressionMode.cyr2lat) await writeCyr2Lat(true);
|
||||
} finally {
|
||||
notifyListeners();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> setChannelUrlImagesEnabled(
|
||||
@@ -2151,35 +2219,6 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> setChannelCyr2LatEnabled(int channelIndex, bool enabled) async {
|
||||
final slots = _slotsSharingChannel(channelIndex);
|
||||
for (final slot in slots) {
|
||||
_channelCyr2LatEnabled[slot] = enabled;
|
||||
}
|
||||
final channelId = _channelIdForSlot(channelIndex);
|
||||
if (enabled) {
|
||||
for (final slot in slots) {
|
||||
_channelSmazEnabled[slot] = false;
|
||||
}
|
||||
if (channelId != null) {
|
||||
await _channelSettingsStore.saveSmazEnabled(channelId, false);
|
||||
}
|
||||
}
|
||||
if (channelId != null) {
|
||||
await _channelSettingsStore.saveCyr2LatEnabled(channelId, enabled);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> setContactCyr2LatEnabled(
|
||||
String contactKeyHex,
|
||||
bool enabled,
|
||||
) async {
|
||||
_contactCyr2LatEnabled[contactKeyHex] = enabled;
|
||||
await _contactSettingsStore.saveCyr2LatEnabled(contactKeyHex, enabled);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> setChannelRegion(int channelIndex, String region) async {
|
||||
// Update in-memory state and notify synchronously so the UI reflects the
|
||||
// change immediately; persistence happens in the background.
|
||||
@@ -2435,6 +2474,9 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
_contacts
|
||||
..clear()
|
||||
..addAll(cached);
|
||||
_contactAddedAt
|
||||
..clear()
|
||||
..addAll(_contactAddedAtStore.load());
|
||||
for (final contact in cached) {
|
||||
_ensureContactSmazSettingLoaded(contact.publicKeyHex);
|
||||
_ensureContactCyr2LatSettingLoaded(contact.publicKeyHex);
|
||||
@@ -5097,6 +5139,13 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
pathHashByteWidth: pathHashByteWidth,
|
||||
);
|
||||
await sendFrame(frame, waitForGenericAck: true);
|
||||
if (publicKey != null) {
|
||||
final keyHex = pubKeyToHex(publicKey);
|
||||
if (!_contactAddedAt.containsKey(keyHex)) {
|
||||
_contactAddedAt[keyHex] = DateTime.now();
|
||||
await _contactAddedAtStore.save(_contactAddedAt);
|
||||
}
|
||||
}
|
||||
await refreshContacts();
|
||||
}
|
||||
|
||||
@@ -6092,6 +6141,9 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
_contactsStorageFull = false;
|
||||
_contacts.removeWhere((c) => c.publicKeyHex == contact.publicKeyHex);
|
||||
_knownContactKeys.remove(contact.publicKeyHex);
|
||||
if (_contactAddedAt.remove(contact.publicKeyHex) != null) {
|
||||
unawaited(_contactAddedAtStore.save(_contactAddedAt));
|
||||
}
|
||||
unawaited(updateKnownDiscovered());
|
||||
unawaited(_persistContacts());
|
||||
_conversations.remove(contact.publicKeyHex);
|
||||
@@ -7780,6 +7832,9 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
);
|
||||
_contacts.removeWhere((c) => c.publicKeyHex == keyHex);
|
||||
_knownContactKeys.remove(keyHex);
|
||||
if (_contactAddedAt.remove(keyHex) != null) {
|
||||
unawaited(_contactAddedAtStore.save(_contactAddedAt));
|
||||
}
|
||||
_contactsStorageFull = false;
|
||||
unawaited(updateKnownDiscovered());
|
||||
unawaited(_persistContacts());
|
||||
@@ -8337,7 +8392,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
void _ensureContactSmazSettingLoaded(String contactKeyHex) {
|
||||
if (_contactSmazEnabled.containsKey(contactKeyHex)) return;
|
||||
_contactSettingsStore.loadSmazEnabled(contactKeyHex).then((enabled) {
|
||||
if (_contactSmazEnabled[contactKeyHex] == enabled) return;
|
||||
if (_contactSmazEnabled.containsKey(contactKeyHex)) return;
|
||||
_contactSmazEnabled[contactKeyHex] = enabled;
|
||||
notifyListeners();
|
||||
});
|
||||
@@ -8346,7 +8401,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
void _ensureContactCyr2LatSettingLoaded(String contactKeyHex) {
|
||||
if (_contactCyr2LatEnabled.containsKey(contactKeyHex)) return;
|
||||
_contactSettingsStore.loadCyr2LatEnabled(contactKeyHex).then((enabled) {
|
||||
if (_contactCyr2LatEnabled[contactKeyHex] == enabled) return;
|
||||
if (_contactCyr2LatEnabled.containsKey(contactKeyHex)) return;
|
||||
_contactCyr2LatEnabled[contactKeyHex] = enabled;
|
||||
notifyListeners();
|
||||
});
|
||||
@@ -8364,7 +8419,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
void _ensureContactCyr2LatProfileLoaded(String contactKeyHex) {
|
||||
if (_contactCyr2LatProfileId.containsKey(contactKeyHex)) return;
|
||||
_contactSettingsStore.loadCyr2LatProfileId(contactKeyHex).then((profileId) {
|
||||
if (_contactCyr2LatProfileId[contactKeyHex] == profileId) return;
|
||||
if (_contactCyr2LatProfileId.containsKey(contactKeyHex)) return;
|
||||
_contactCyr2LatProfileId[contactKeyHex] = profileId;
|
||||
notifyListeners();
|
||||
});
|
||||
@@ -8375,7 +8430,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
final channelId = _slotChannelIds[channelIndex];
|
||||
if (channelId == null) return;
|
||||
_channelSettingsStore.loadCyr2LatEnabled(channelId).then((enabled) {
|
||||
if (_channelCyr2LatEnabled[channelIndex] == enabled) return;
|
||||
if (_channelCyr2LatEnabled.containsKey(channelIndex)) return;
|
||||
_channelCyr2LatEnabled[channelIndex] = enabled;
|
||||
notifyListeners();
|
||||
});
|
||||
@@ -8386,7 +8441,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
final channelId = _slotChannelIds[channelIndex];
|
||||
if (channelId == null) return;
|
||||
_channelSettingsStore.loadCyr2LatProfileId(channelId).then((profileId) {
|
||||
if (_channelCyr2LatProfileId[channelIndex] == profileId) return;
|
||||
if (_channelCyr2LatProfileId.containsKey(channelIndex)) return;
|
||||
_channelCyr2LatProfileId[channelIndex] = profileId;
|
||||
notifyListeners();
|
||||
});
|
||||
@@ -8402,13 +8457,13 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
String? profileId,
|
||||
) async {
|
||||
if (_channelCyr2LatProfileId[channelIndex] == profileId) return;
|
||||
for (final slot in _slotsSharingChannel(channelIndex)) {
|
||||
_channelCyr2LatProfileId[slot] = profileId;
|
||||
}
|
||||
final channelId = _channelIdForSlot(channelIndex);
|
||||
if (channelId != null) {
|
||||
await _channelSettingsStore.saveCyr2LatProfileId(channelId, profileId);
|
||||
}
|
||||
for (final slot in _slotsSharingChannel(channelIndex)) {
|
||||
_channelCyr2LatProfileId[slot] = profileId;
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@@ -8422,8 +8477,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
String? profileId,
|
||||
) async {
|
||||
if (_contactCyr2LatProfileId[contactKeyHex] == profileId) return;
|
||||
_contactCyr2LatProfileId[contactKeyHex] = profileId;
|
||||
await _contactSettingsStore.saveCyr2LatProfileId(contactKeyHex, profileId);
|
||||
_contactCyr2LatProfileId[contactKeyHex] = profileId;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@@ -9864,6 +9919,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
_channelRegionStore.setPublicKeyHex = keyHex;
|
||||
_contactSettingsStore.setPublicKeyHex = keyHex;
|
||||
_contactStore.setPublicKeyHex = keyHex;
|
||||
_contactAddedAtStore.setPublicKeyHex = keyHex;
|
||||
_channelStore.setPublicKeyHex = keyHex;
|
||||
_unreadStore.setPublicKeyHex = keyHex;
|
||||
_discoveryContactStore.setPublicKeyHex = keyHex;
|
||||
|
||||
+23
-5
@@ -839,6 +839,7 @@
|
||||
"contacts_noContactsMatchFilter": "No contacts match your filter",
|
||||
"contacts_noMembers": "No members",
|
||||
"contacts_lastSeenNow": "recently",
|
||||
"contacts_lastSeenNever": "not heard yet",
|
||||
"contacts_lastSeenMinsAgo": "~ {minutes} min.",
|
||||
"@contacts_lastSeenMinsAgo": {
|
||||
"placeholders": {
|
||||
@@ -968,9 +969,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"channels_smazCompression": "SMAZ compression",
|
||||
"channels_cyr2latCompression": "Cyr2Lat compression",
|
||||
"channels_cyr2latCompressionDscr": "Replaces some Cyrillic characters with Latin characters when sending.",
|
||||
"channels_cyr2latSettingsHeading": "Cyr2Lat Setup",
|
||||
"channels_cyr2latSettingsSubheading": "List of replacements",
|
||||
"channels_cyr2latSettingsDscr": "Edit the JSON configuration of character replacement",
|
||||
@@ -1409,7 +1407,6 @@
|
||||
"chat_path": "Path",
|
||||
"chat_viewPathOnMap": "View path on map",
|
||||
"chat_publicKey": "Public Key",
|
||||
"chat_compressOutgoingMessages": "Compress outgoing messages",
|
||||
"chat_floodForced": "Flood (forced)",
|
||||
"chat_directForced": "Direct (forced)",
|
||||
"chat_hopsForced": "{count} hops (forced)",
|
||||
@@ -4357,5 +4354,26 @@
|
||||
"total": {"type": "String"},
|
||||
"percent": {"type": "String"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"chatCompression_title": "Compression",
|
||||
"chatCompression_label": "Compression: {mode}",
|
||||
"@chatCompression_label": {
|
||||
"description": "Always-visible control at the top of a chat; mode is Off, SMAZ or Cyr2Lat",
|
||||
"placeholders": {
|
||||
"mode": {
|
||||
"type": "String"
|
||||
}
|
||||
}
|
||||
},
|
||||
"chatCompression_off": "Off",
|
||||
"chatCompression_smaz": "SMAZ",
|
||||
"chatCompression_cyr2lat": "Cyr2Lat",
|
||||
"chatCompression_changeHint": "Change compression for this chat",
|
||||
"chatCompression_sheetSubtitle": "Applies to messages you send in this chat. Saved on this phone.",
|
||||
"chatCompression_offDescription": "No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.",
|
||||
"chatCompression_smazDescription": "Lossless compression for short text. The recipient's app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.",
|
||||
"chatCompression_cyr2latDescription": "Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.",
|
||||
"chatCompression_profile": "Cyr2Lat profile",
|
||||
"chatCompression_noStorageId": "Can't change compression until this channel has synced from the radio.",
|
||||
"chatCompression_saveFailed": "Couldn't save the compression setting. Showing the saved setting."
|
||||
}
|
||||
@@ -3295,6 +3295,12 @@ abstract class AppLocalizations {
|
||||
/// **'recently'**
|
||||
String get contacts_lastSeenNow;
|
||||
|
||||
/// No description provided for @contacts_lastSeenNever.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'not heard yet'**
|
||||
String get contacts_lastSeenNever;
|
||||
|
||||
/// No description provided for @contacts_lastSeenMinsAgo.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
@@ -3607,24 +3613,6 @@ abstract class AppLocalizations {
|
||||
/// **'Edit Channel {index}'**
|
||||
String channels_editChannelTitle(int index);
|
||||
|
||||
/// No description provided for @channels_smazCompression.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SMAZ compression'**
|
||||
String get channels_smazCompression;
|
||||
|
||||
/// No description provided for @channels_cyr2latCompression.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Cyr2Lat compression'**
|
||||
String get channels_cyr2latCompression;
|
||||
|
||||
/// No description provided for @channels_cyr2latCompressionDscr.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Replaces some Cyrillic characters with Latin characters when sending.'**
|
||||
String get channels_cyr2latCompressionDscr;
|
||||
|
||||
/// No description provided for @channels_cyr2latSettingsHeading.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
@@ -4813,12 +4801,6 @@ abstract class AppLocalizations {
|
||||
/// **'Public Key'**
|
||||
String get chat_publicKey;
|
||||
|
||||
/// No description provided for @chat_compressOutgoingMessages.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Compress outgoing messages'**
|
||||
String get chat_compressOutgoingMessages;
|
||||
|
||||
/// No description provided for @chat_floodForced.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
@@ -12687,6 +12669,84 @@ abstract class AppLocalizations {
|
||||
/// In en, this message translates to:
|
||||
/// **'{current} / {total} MB ({percent}%)'**
|
||||
String modelDownload_progress(String current, String total, String percent);
|
||||
|
||||
/// No description provided for @chatCompression_title.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Compression'**
|
||||
String get chatCompression_title;
|
||||
|
||||
/// Always-visible control at the top of a chat; mode is Off, SMAZ or Cyr2Lat
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Compression: {mode}'**
|
||||
String chatCompression_label(String mode);
|
||||
|
||||
/// No description provided for @chatCompression_off.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Off'**
|
||||
String get chatCompression_off;
|
||||
|
||||
/// No description provided for @chatCompression_smaz.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'SMAZ'**
|
||||
String get chatCompression_smaz;
|
||||
|
||||
/// No description provided for @chatCompression_cyr2lat.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Cyr2Lat'**
|
||||
String get chatCompression_cyr2lat;
|
||||
|
||||
/// No description provided for @chatCompression_changeHint.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Change compression for this chat'**
|
||||
String get chatCompression_changeHint;
|
||||
|
||||
/// No description provided for @chatCompression_sheetSubtitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Applies to messages you send in this chat. Saved on this phone.'**
|
||||
String get chatCompression_sheetSubtitle;
|
||||
|
||||
/// No description provided for @chatCompression_offDescription.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.'**
|
||||
String get chatCompression_offDescription;
|
||||
|
||||
/// No description provided for @chatCompression_smazDescription.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.'**
|
||||
String get chatCompression_smazDescription;
|
||||
|
||||
/// No description provided for @chatCompression_cyr2latDescription.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.'**
|
||||
String get chatCompression_cyr2latDescription;
|
||||
|
||||
/// No description provided for @chatCompression_profile.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Cyr2Lat profile'**
|
||||
String get chatCompression_profile;
|
||||
|
||||
/// No description provided for @chatCompression_noStorageId.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Can\'t change compression until this channel has synced from the radio.'**
|
||||
String get chatCompression_noStorageId;
|
||||
|
||||
/// No description provided for @chatCompression_saveFailed.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Couldn\'t save the compression setting. Showing the saved setting.'**
|
||||
String get chatCompression_saveFailed;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
@@ -1837,6 +1837,9 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'наскоро';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes мин.';
|
||||
@@ -2019,16 +2022,6 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
return 'Редактирай Канал $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Компресия SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Компресия Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Заменя някои кирилични символи с латиница при изпращане.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Настройки на Cyr2Lat';
|
||||
|
||||
@@ -2756,10 +2749,6 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Публичен ключ';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages =>
|
||||
'Компресиране на изходящи съобщения';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (принудително)';
|
||||
|
||||
@@ -7612,4 +7601,51 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1824,6 +1824,9 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'nedávno';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min.';
|
||||
@@ -2004,16 +2007,6 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
return 'Upravit kanál $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Komprese SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Komprese Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Při odesílání nahradí některé znaky cyrilice latinkou.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Nastavení Cyr2Lat';
|
||||
|
||||
@@ -2746,9 +2739,6 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Veřejný klíč';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Komprimovat odchozí zprávy';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (vynuceno)';
|
||||
|
||||
@@ -7582,4 +7572,51 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1837,6 +1837,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'gerade eben';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes Min.';
|
||||
@@ -2019,16 +2022,6 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
return 'Kanal $index bearbeiten';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'SMAZ-Komprimierung';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Cyr2Lat-Komprimierung';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Ersetzt beim Senden einige kyrillische Zeichen durch lateinische Zeichen.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Cyr2Lat-Einstellungen';
|
||||
|
||||
@@ -2758,10 +2751,6 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Öffentlicher Schlüssel';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages =>
|
||||
'Komprimieren ausgehender Nachrichten';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (erzwungen)';
|
||||
|
||||
@@ -7627,4 +7616,51 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1804,6 +1804,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'recently';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min.';
|
||||
@@ -1983,16 +1986,6 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
return 'Edit Channel $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'SMAZ compression';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Cyr2Lat compression';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Replaces some Cyrillic characters with Latin characters when sending.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Cyr2Lat Setup';
|
||||
|
||||
@@ -2710,9 +2703,6 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Public Key';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Compress outgoing messages';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (forced)';
|
||||
|
||||
@@ -7498,4 +7488,51 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1829,6 +1829,9 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'Reciente';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min';
|
||||
@@ -2012,16 +2015,6 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
return 'Editar Canal $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Compresión SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Compresión Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Reemplaza algunos caracteres cirílicos con caracteres latinos al enviar.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Configuración de Cyr2Lat';
|
||||
|
||||
@@ -2748,9 +2741,6 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Clave pública';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Comprimir mensajes salientes';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (forzado)';
|
||||
|
||||
@@ -7603,4 +7593,51 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1834,6 +1834,9 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'À l\'instant';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min';
|
||||
@@ -2016,16 +2019,6 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
return 'Modifier le Canal $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Compression SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Compression Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Remplace certains caractères cyrilliques par des caractères latins lors de l\'envoi.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Paramètres Cyr2Lat';
|
||||
|
||||
@@ -2753,10 +2746,6 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Clé publique';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages =>
|
||||
'Compresser les messages sortants';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (forcé)';
|
||||
|
||||
@@ -7632,4 +7621,51 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1827,6 +1827,9 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'nemrég';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min.';
|
||||
@@ -2010,16 +2013,6 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
return 'Csatorna szerkesztése $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'SMAZ tömörítés';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Cyr2Lat tömörítés';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Küldéskor egyes cirill karaktereket latin karakterekre cserél.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Cyr2Lat beállítás';
|
||||
|
||||
@@ -2745,9 +2738,6 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Nyilvános kulcs';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'A kimenő üzenetek tömörítése';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (kényszerített)';
|
||||
|
||||
@@ -7595,4 +7585,51 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1831,6 +1831,9 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'Poco fa';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min';
|
||||
@@ -2013,16 +2016,6 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
return 'Modifica Canale $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Compressione SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Compressione Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Sostituisce alcuni caratteri cirillici con caratteri latini durante l\'invio.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Impostazioni Cyr2Lat';
|
||||
|
||||
@@ -2753,9 +2746,6 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Chiave pubblica';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Comprimi messaggi in uscita';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (forzato)';
|
||||
|
||||
@@ -7615,4 +7605,51 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1740,6 +1740,9 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => '最近';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '約 $minutes 分前';
|
||||
@@ -1918,15 +1921,6 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
return 'チャンネル $index の編集';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'SMAZ 圧縮';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Cyr2Lat 圧縮';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr => '送信時に一部のキリル文字をラテン文字に置き換えます。';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Cyr2Lat 設定';
|
||||
|
||||
@@ -2626,9 +2620,6 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => '公開鍵';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => '送信メッセージを圧縮する';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'フラッド(強制)';
|
||||
|
||||
@@ -7257,4 +7248,51 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1744,6 +1744,9 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => '최근';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes분';
|
||||
@@ -1922,15 +1925,6 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
return '채널 $index 편집';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'SMAZ 압축';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Cyr2Lat 압축';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr => '보낼 때 일부 키릴 문자를 라틴 문자로 바꿉니다.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Cyr2Lat 설정';
|
||||
|
||||
@@ -2629,9 +2623,6 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => '공개 키';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => '전송되는 메시지 압축';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => '플러딩 (강제)';
|
||||
|
||||
@@ -7270,4 +7261,51 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1823,6 +1823,9 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'recent';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min.';
|
||||
@@ -2003,16 +2006,6 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
return 'Bewerk Kanaal $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'SMAZ compressie';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Cyr2Lat compressie';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Vervangt sommige Cyrillische tekens door Latijnse tekens bij het verzenden.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Instellingen Cyr2Lat';
|
||||
|
||||
@@ -2737,9 +2730,6 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Openbare Sleutel';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Uitgaande berichten comprimeren';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (afgedwongen)';
|
||||
|
||||
@@ -7571,4 +7561,51 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1845,6 +1845,9 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'niedawno';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min';
|
||||
@@ -2027,16 +2030,6 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
return 'Edytuj Kanał $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Kompresja SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Kompresja Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Zastępuje niektóre znaki cyrylicy alfabetem łacińskim podczas wysyłania.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Ustawienia Cyr2Lat';
|
||||
|
||||
@@ -2780,9 +2773,6 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Klucz Publiczny';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Kompresuj wychodzące wiadomości';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (wymuszony)';
|
||||
|
||||
@@ -7649,4 +7639,51 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1830,6 +1830,9 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'Recente';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min';
|
||||
@@ -2012,16 +2015,6 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
return 'Editar Canal $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Compressão SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Compressão Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Substitui alguns caracteres cirílicos por caracteres latinos ao enviar.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Configuração do Cyr2Lat';
|
||||
|
||||
@@ -2747,9 +2740,6 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Chave Pública';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Comprimir mensagens enviadas';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (forçado)';
|
||||
|
||||
@@ -7593,6 +7583,53 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
|
||||
/// The translations for Portuguese, as used in Portugal (`pt_PT`).
|
||||
@@ -9593,16 +9630,6 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
|
||||
return 'Editar canal $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Compressão SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Compressão Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Substitui alguns caracteres cirílicos por latinos ao enviar.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Configuração Cyr2Lat';
|
||||
|
||||
@@ -10302,9 +10329,6 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
|
||||
@override
|
||||
String get chat_publicKey => 'Chave pública';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Comprimir mensagens enviadas';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (forçado)';
|
||||
|
||||
|
||||
@@ -1829,6 +1829,9 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'недавно';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes мин.';
|
||||
@@ -2011,16 +2014,6 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
return 'Изменить канал $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Сжатие SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Сжатие Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Заменяет некоторые кириллические символы на латиницу при отправке.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Настройка Cyr2Lat';
|
||||
|
||||
@@ -2759,9 +2752,6 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Публичный ключ';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Сжимать исходящие сообщения';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (принудительно)';
|
||||
|
||||
@@ -7629,4 +7619,51 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1823,6 +1823,9 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'nedávno';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min.';
|
||||
@@ -2004,16 +2007,6 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
return 'Upraviť kanál $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Odstránenie kompresie SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Odstránenie kompresie Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Pri odosielaní nahradí niektoré znaky cyriliky latinskými znakmi.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Nastavenia Cyr2Lat';
|
||||
|
||||
@@ -2751,9 +2744,6 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Verejný kľúč';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Komprimovať odoslané správy';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (vynútený)';
|
||||
|
||||
@@ -7594,4 +7584,51 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1821,6 +1821,9 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'pravkar';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min';
|
||||
@@ -2002,16 +2005,6 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
return 'Uredi Kanal $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Kompresija SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Kompresija Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Pri pošiljanju nekatere cirilice nadomesti z latiničnimi.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Nastavitve Cyr2Lat';
|
||||
|
||||
@@ -2746,9 +2739,6 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Ključ javnega tipa';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Stisnite izhodne sporočila';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (vsiljeno)';
|
||||
|
||||
@@ -7588,4 +7578,51 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1811,6 +1811,9 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'nyss';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes min';
|
||||
@@ -1990,16 +1993,6 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
return 'Redigera Kanal $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'SMAZ-komprimering';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Cyr2Lat-komprimering';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Ersätter vissa kyrilliska tecken med latinska tecken när du skickar.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Inställningar för Cyr2Lat';
|
||||
|
||||
@@ -2725,9 +2718,6 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Publik nyckel';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Komprimera utgående meddelanden';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (tvingad)';
|
||||
|
||||
@@ -7548,4 +7538,51 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1825,6 +1825,9 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => 'нещодавно';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '~ $minutes хв.';
|
||||
@@ -2007,16 +2010,6 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
return 'Редагувати канал $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'Стиснення SMAZ';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Стиснення Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr =>
|
||||
'Замінює деякі кириличні символи на латиницю при відправці.';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Налаштування Cyr2Lat';
|
||||
|
||||
@@ -2756,9 +2749,6 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => 'Відкритий ключ';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => 'Стискати вихідні повідомлення';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => 'Flood (примусово)';
|
||||
|
||||
@@ -7641,4 +7631,51 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -1713,6 +1713,9 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
@override
|
||||
String get contacts_lastSeenNow => '刚刚';
|
||||
|
||||
@override
|
||||
String get contacts_lastSeenNever => 'not heard yet';
|
||||
|
||||
@override
|
||||
String contacts_lastSeenMinsAgo(int minutes) {
|
||||
return '约 $minutes 分钟';
|
||||
@@ -1891,15 +1894,6 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
return '编辑频道 $index';
|
||||
}
|
||||
|
||||
@override
|
||||
String get channels_smazCompression => 'SMAZ 压缩';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompression => 'Cyr2Lat 压缩';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latCompressionDscr => '发送时将一些西里尔字符替换为拉丁字符。';
|
||||
|
||||
@override
|
||||
String get channels_cyr2latSettingsHeading => 'Cyr2Lat 設定';
|
||||
|
||||
@@ -2584,9 +2578,6 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
@override
|
||||
String get chat_publicKey => '公钥';
|
||||
|
||||
@override
|
||||
String get chat_compressOutgoingMessages => '压缩发送的消息';
|
||||
|
||||
@override
|
||||
String get chat_floodForced => '泛洪(强制)';
|
||||
|
||||
@@ -7099,4 +7090,51 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
String modelDownload_progress(String current, String total, String percent) {
|
||||
return '$current / $total MB ($percent%)';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_title => 'Compression';
|
||||
|
||||
@override
|
||||
String chatCompression_label(String mode) {
|
||||
return 'Compression: $mode';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chatCompression_off => 'Off';
|
||||
|
||||
@override
|
||||
String get chatCompression_smaz => 'SMAZ';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2lat => 'Cyr2Lat';
|
||||
|
||||
@override
|
||||
String get chatCompression_changeHint => 'Change compression for this chat';
|
||||
|
||||
@override
|
||||
String get chatCompression_sheetSubtitle =>
|
||||
'Applies to messages you send in this chat. Saved on this phone.';
|
||||
|
||||
@override
|
||||
String get chatCompression_offDescription =>
|
||||
'No compression. Sends your text exactly as typed. Every app can read it. Saves no bytes.';
|
||||
|
||||
@override
|
||||
String get chatCompression_smazDescription =>
|
||||
'Lossless compression for short text. The recipient\'s app must support SMAZ; other apps show unreadable \"s:…\" text. Only used when it makes a message smaller, so not every message is compressed.';
|
||||
|
||||
@override
|
||||
String get chatCompression_cyr2latDescription =>
|
||||
'Not lossless. Swaps some Cyrillic letters for lookalike Latin ones (А→A, З→3) to save bytes. Readable in any app with no decoding, but the exact characters change, including your own sent messages here. Copying, search and technical text may be affected. Results depend on the chosen profile.';
|
||||
|
||||
@override
|
||||
String get chatCompression_profile => 'Cyr2Lat profile';
|
||||
|
||||
@override
|
||||
String get chatCompression_noStorageId =>
|
||||
'Can\'t change compression until this channel has synced from the radio.';
|
||||
|
||||
@override
|
||||
String get chatCompression_saveFailed =>
|
||||
'Couldn\'t save the compression setting. Showing the saved setting.';
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
/// Outgoing text transformation chosen for one contact or channel chat.
|
||||
/// Stored as the existing SMAZ and Cyr2Lat flags, at most one of them on.
|
||||
enum ChatCompressionMode { off, smaz, cyr2lat }
|
||||
@@ -53,6 +53,7 @@ import '../widgets/empty_state.dart';
|
||||
import '../widgets/filter_rule_dialog.dart';
|
||||
import '../widgets/filtered_message_ghost.dart';
|
||||
import '../widgets/chat_composer.dart';
|
||||
import '../widgets/chat_compression_selector.dart';
|
||||
import '../widgets/chat_send_pipeline.dart';
|
||||
import '../widgets/chat_zoom_wrapper.dart';
|
||||
import '../widgets/message_bubble_frame.dart';
|
||||
@@ -843,12 +844,17 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
? _buildSearchResults(_loadSearchEntries)
|
||||
: SafeArea(
|
||||
top: false,
|
||||
// The composer panel pads the bottom inset itself, so the
|
||||
// background runs behind it to the screen edge.
|
||||
bottom: false,
|
||||
child: Column(
|
||||
children: [
|
||||
_buildCompressionSelector(),
|
||||
Expanded(
|
||||
child: ChatBackdrop(
|
||||
key: _messageAreaKey,
|
||||
contentKey: _messageAreaKey,
|
||||
chatKey: ChatBackgroundService.channelKey(widget.channel),
|
||||
footer: _buildInputBar(),
|
||||
child: Consumer<MeshCoreConnector>(
|
||||
builder: (context, connector, child) {
|
||||
final messages = connector.getChannelMessages(
|
||||
@@ -1064,7 +1070,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
_buildInputBar(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -2633,47 +2638,23 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildReplyBanner(double textScale) {
|
||||
Widget _buildComposerReplyQuote(double textScale) {
|
||||
final message = _replyingToMessage!;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final replyRegion = message.region;
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surfaceContainerHigh,
|
||||
border: Border(
|
||||
bottom: BorderSide(color: scheme.outlineVariant, width: 1),
|
||||
),
|
||||
return ChatComposerQuote(
|
||||
title: context.l10n.chat_replyingTo(message.senderName),
|
||||
content: _buildReplyContent(
|
||||
message.text,
|
||||
textScale,
|
||||
color: scheme.onSurfaceVariant,
|
||||
maxLines: 1,
|
||||
gifSize: 48,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.reply, size: 18, color: scheme.primary),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
context.l10n.chat_replyingTo(message.senderName),
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 12 * textScale,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: scheme.primary,
|
||||
),
|
||||
),
|
||||
_buildReplyContent(
|
||||
message.text,
|
||||
textScale,
|
||||
color: scheme.onSurfaceVariant,
|
||||
maxLines: 1,
|
||||
gifSize: 48,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (replyRegion?.isNotEmpty ?? false)
|
||||
InkWell(
|
||||
onDismiss: _cancelReply,
|
||||
dismissTooltip: context.l10n.chat_cancelReply,
|
||||
trailing: (replyRegion?.isNotEmpty ?? false)
|
||||
? InkWell(
|
||||
borderRadius: BorderRadius.circular(MeshRadii.xs),
|
||||
onTap: () => setState(() => _useReplyRegion = !_useReplyRegion),
|
||||
child: Container(
|
||||
@@ -2691,6 +2672,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
),
|
||||
child: Text(
|
||||
context.l10n.channels_regionSetTo(replyRegion!),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style:
|
||||
MeshTheme.mono(
|
||||
fontSize: 12 * textScale,
|
||||
@@ -2704,17 +2687,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close, size: 18),
|
||||
tooltip: context.l10n.chat_cancelReply,
|
||||
onPressed: _cancelReply,
|
||||
color: scheme.onSurfaceVariant,
|
||||
constraints: const BoxConstraints(minWidth: 44, minHeight: 44),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2753,6 +2727,32 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
static String _replyPrefix(ChannelMessage replyTo) =>
|
||||
'@[${replyTo.senderName}] ';
|
||||
|
||||
/// Compression is stored on this phone under the channel's storage ID, so
|
||||
/// it can change while the radio is offline, but not before the slot has
|
||||
/// one.
|
||||
Widget _buildCompressionSelector() {
|
||||
final slot = widget.channel.index;
|
||||
return Consumer2<MeshCoreConnector, AppSettingsService>(
|
||||
builder: (context, connector, settingsService, _) {
|
||||
final hasStorageId = connector.channelIdForSlot(slot) != null;
|
||||
return ChatCompressionSelector(
|
||||
mode: connector.channelCompressionMode(slot),
|
||||
enabled: hasStorageId,
|
||||
disabledReason: hasStorageId
|
||||
? null
|
||||
: context.l10n.chatCompression_noStorageId,
|
||||
profiles: settingsService.settings.cyr2latProfiles,
|
||||
profileId: connector.getChannelCyr2LatProfileId(slot),
|
||||
defaultProfileId: settingsService.settings.selectedCyr2latProfileId,
|
||||
onModeChanged: (mode) =>
|
||||
connector.setChannelCompressionMode(slot, mode),
|
||||
onProfileChanged: (id) =>
|
||||
connector.setChannelCyr2LatProfileId(slot, id),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInputBar() {
|
||||
// Only the fields the composer depends on, so unrelated connector
|
||||
// notifications (adverts, other chats, radio stats) don't rebuild it.
|
||||
@@ -2790,18 +2790,17 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
: null,
|
||||
onSend: _sendMessage,
|
||||
sendTooltip: context.l10n.chat_sendMessage,
|
||||
header: [
|
||||
if (replyTo != null)
|
||||
Builder(
|
||||
builder: (context) {
|
||||
final textScale = context.select<ChatTextScaleService, double>(
|
||||
(service) => service.scale,
|
||||
);
|
||||
return _buildReplyBanner(textScale);
|
||||
},
|
||||
),
|
||||
if (_imageSendTotal > 0) _buildImageSendProgress(scheme),
|
||||
],
|
||||
header: [if (_imageSendTotal > 0) _buildImageSendProgress(scheme)],
|
||||
replyPreview: replyTo == null
|
||||
? null
|
||||
: Builder(
|
||||
builder: (context) {
|
||||
final textScale = context.select<ChatTextScaleService, double>(
|
||||
(service) => service.scale,
|
||||
);
|
||||
return _buildComposerReplyQuote(textScale);
|
||||
},
|
||||
),
|
||||
actionsBuilder: () {
|
||||
final connector = context.read<MeshCoreConnector>();
|
||||
return [
|
||||
|
||||
@@ -783,13 +783,14 @@ class _ChannelsScreenState extends State<ChannelsScreen> {
|
||||
break;
|
||||
case ChannelSortOption.latestMessages:
|
||||
// Filtered messages don't bump a channel, matching the preview.
|
||||
// Ordered by local arrival time: sender clocks can be far off.
|
||||
// Looked up once per channel: the lookup can scan back through
|
||||
// filtered messages, and the comparator runs O(n log n) times.
|
||||
final epoch = DateTime(1970);
|
||||
final latest = <Channel, DateTime>{
|
||||
for (final channel in filtered)
|
||||
channel:
|
||||
connector.latestVisibleChannelMessage(channel)?.timestamp ??
|
||||
connector.latestVisibleChannelMessage(channel)?.receivedAt ??
|
||||
epoch,
|
||||
};
|
||||
filtered.sort((a, b) {
|
||||
@@ -1951,16 +1952,11 @@ void showEditChannelSheet(
|
||||
context,
|
||||
listen: false,
|
||||
);
|
||||
bool smazEnabled = connector.isChannelSmazEnabled(channel.index);
|
||||
bool cyr2latEnabled = connector.isChannelCyr2LatEnabled(channel.index);
|
||||
final initialUrlImagesEnabled = connector.isChannelUrlImagesEnabled(
|
||||
channel.index,
|
||||
);
|
||||
bool urlImagesEnabled = initialUrlImagesEnabled;
|
||||
final loadLinkImages = appSettingsService.settings.loadLinkImages;
|
||||
String? selectedCyr2LatProfileId = connector.getChannelCyr2LatProfileId(
|
||||
channel.index,
|
||||
);
|
||||
|
||||
showMeshSheet(
|
||||
context,
|
||||
@@ -2018,62 +2014,6 @@ void showEditChannelSheet(
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(sheetContext.l10n.channels_smazCompression),
|
||||
value: smazEnabled,
|
||||
onChanged: (value) => setSheetState(() {
|
||||
smazEnabled = value;
|
||||
if (smazEnabled) {
|
||||
cyr2latEnabled = false;
|
||||
}
|
||||
}),
|
||||
),
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(
|
||||
sheetContext.l10n.channels_cyr2latCompression,
|
||||
),
|
||||
subtitle: Text(
|
||||
sheetContext.l10n.channels_cyr2latCompressionDscr,
|
||||
),
|
||||
value: cyr2latEnabled,
|
||||
onChanged: (value) => setSheetState(() {
|
||||
cyr2latEnabled = value;
|
||||
if (cyr2latEnabled) {
|
||||
smazEnabled = false;
|
||||
}
|
||||
}),
|
||||
),
|
||||
if (cyr2latEnabled) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 8),
|
||||
child: DropdownButtonFormField<String>(
|
||||
isExpanded: true,
|
||||
initialValue: selectedCyr2LatProfileId,
|
||||
decoration: InputDecoration(
|
||||
labelText: sheetContext
|
||||
.l10n
|
||||
.channels_cyr2latSettingsSubheading,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: appSettingsService.settings.cyr2latProfiles
|
||||
.map((profile) {
|
||||
return DropdownMenuItem(
|
||||
value: profile.id,
|
||||
child: Text(
|
||||
profile.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
);
|
||||
})
|
||||
.toList(),
|
||||
onChanged: (value) => setSheetState(() {
|
||||
selectedCyr2LatProfileId = value;
|
||||
}),
|
||||
),
|
||||
),
|
||||
],
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(sheetContext.l10n.urlImage_enable),
|
||||
@@ -2135,30 +2075,38 @@ void showEditChannelSheet(
|
||||
}
|
||||
|
||||
Navigator.pop(sheetContext);
|
||||
// A new PSK gives the channel a new storage ID;
|
||||
// its compression settings move with it.
|
||||
final previousId = connector.channelIdForSlot(
|
||||
channel.index,
|
||||
);
|
||||
final compression = connector
|
||||
.channelCompressionMode(channel.index);
|
||||
final cyr2LatProfileId = connector
|
||||
.getChannelCyr2LatProfileId(channel.index);
|
||||
try {
|
||||
await connector.setChannel(
|
||||
channel.index,
|
||||
name,
|
||||
psk,
|
||||
);
|
||||
await connector.setChannelSmazEnabled(
|
||||
channel.index,
|
||||
smazEnabled,
|
||||
);
|
||||
await connector.setChannelCyr2LatEnabled(
|
||||
channel.index,
|
||||
cyr2latEnabled,
|
||||
);
|
||||
if (connector.channelIdForSlot(channel.index) !=
|
||||
previousId) {
|
||||
await connector.setChannelCompressionMode(
|
||||
channel.index,
|
||||
compression,
|
||||
);
|
||||
await connector.setChannelCyr2LatProfileId(
|
||||
channel.index,
|
||||
cyr2LatProfileId,
|
||||
);
|
||||
}
|
||||
if (urlImagesEnabled != initialUrlImagesEnabled) {
|
||||
await connector.setChannelUrlImagesEnabled(
|
||||
channel.index,
|
||||
urlImagesEnabled,
|
||||
);
|
||||
}
|
||||
await connector.setChannelCyr2LatProfileId(
|
||||
channel.index,
|
||||
selectedCyr2LatProfileId,
|
||||
);
|
||||
if (!context.mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
|
||||
@@ -37,6 +37,7 @@ import '../services/chat_text_scale_service.dart';
|
||||
import '../services/path_history_service.dart';
|
||||
import '../services/translation_service.dart';
|
||||
import '../widgets/chat_composer.dart';
|
||||
import '../widgets/chat_compression_selector.dart';
|
||||
import '../widgets/chat_send_pipeline.dart';
|
||||
import '../widgets/chat_zoom_wrapper.dart';
|
||||
import '../widgets/message_bubble_frame.dart';
|
||||
@@ -622,12 +623,14 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
);
|
||||
return Column(
|
||||
children: [
|
||||
_buildCompressionSelector(connector),
|
||||
Expanded(
|
||||
child: ChatBackdrop(
|
||||
key: _messageAreaKey,
|
||||
contentKey: _messageAreaKey,
|
||||
chatKey: ChatBackgroundService.contactKey(
|
||||
widget.contact,
|
||||
),
|
||||
footer: _buildInputBar(connector),
|
||||
child: Stack(
|
||||
children: [
|
||||
messages.isEmpty
|
||||
@@ -640,7 +643,6 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
_buildInputBar(connector),
|
||||
],
|
||||
);
|
||||
},
|
||||
@@ -648,6 +650,27 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
/// Compression is stored on this phone per contact, so it can change
|
||||
/// while the radio is offline.
|
||||
Widget _buildCompressionSelector(MeshCoreConnector connector) {
|
||||
final keyHex = widget.contact.publicKeyHex;
|
||||
return Consumer<AppSettingsService>(
|
||||
builder: (context, settingsService, _) {
|
||||
return ChatCompressionSelector(
|
||||
mode: connector.contactCompressionMode(keyHex),
|
||||
enabled: true,
|
||||
profiles: settingsService.settings.cyr2latProfiles,
|
||||
profileId: connector.getContactCyr2LatProfileId(keyHex),
|
||||
defaultProfileId: settingsService.settings.selectedCyr2latProfileId,
|
||||
onModeChanged: (mode) =>
|
||||
connector.setContactCompressionMode(keyHex, mode),
|
||||
onProfileChanged: (id) =>
|
||||
connector.setContactCyr2LatProfileId(keyHex, id),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildEmptyState() {
|
||||
if (_showBookmarkedOnly) return _buildBookmarkEmptyState();
|
||||
return EmptyState(
|
||||
@@ -1109,19 +1132,9 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
|
||||
void _showContactSettings(BuildContext context) {
|
||||
final connector = Provider.of<MeshCoreConnector>(context, listen: false);
|
||||
final appSettingsService = Provider.of<AppSettingsService>(
|
||||
context,
|
||||
listen: false,
|
||||
);
|
||||
connector.ensureContactSmazSettingLoaded(widget.contact.publicKeyHex);
|
||||
connector.ensureContactCyr2LatSettingLoaded(widget.contact.publicKeyHex);
|
||||
// The live contact carries the current telemetry flags; widget.contact
|
||||
// is the snapshot this screen was opened with.
|
||||
final contact = _resolveContact(connector);
|
||||
bool smazEnabled = connector.isContactSmazEnabled(contact.publicKeyHex);
|
||||
bool cyr2latEnabled = connector.isContactCyr2LatEnabled(
|
||||
contact.publicKeyHex,
|
||||
);
|
||||
bool urlImagesEnabled = connector.isContactUrlImagesEnabled(
|
||||
contact.publicKeyHex,
|
||||
);
|
||||
@@ -1129,14 +1142,11 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
.read<AppSettingsService>()
|
||||
.settings
|
||||
.loadLinkImages;
|
||||
String? selectedCyr2LatProfileId = connector.getContactCyr2LatProfileId(
|
||||
contact.publicKeyHex,
|
||||
);
|
||||
bool teleBaseEnabled = contact.teleBaseEnabled;
|
||||
bool teleLocEnabled = contact.teleLocEnabled;
|
||||
bool teleEnvEnabled = contact.teleEnvEnabled;
|
||||
// Each toggle is committed immediately, like the compression switches,
|
||||
// so dismissing the dialog by tapping outside keeps the change. All three
|
||||
// Each toggle is committed immediately, like the link-image switch, so
|
||||
// dismissing the dialog by tapping outside keeps the change. All three
|
||||
// flags are sent every time so overlapping writes can't undo each other.
|
||||
void commitTelemetryFlags() {
|
||||
connector.setContactFlags(
|
||||
@@ -1164,86 +1174,6 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
),
|
||||
const Divider(height: 8),
|
||||
],
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(context.l10n.channels_smazCompression),
|
||||
subtitle: Text(context.l10n.chat_compressOutgoingMessages),
|
||||
value: smazEnabled,
|
||||
onChanged: (value) {
|
||||
connector.setContactSmazEnabled(
|
||||
contact.publicKeyHex,
|
||||
value,
|
||||
);
|
||||
connector.setContactCyr2LatEnabled(
|
||||
contact.publicKeyHex,
|
||||
false,
|
||||
);
|
||||
setDialogState(() {
|
||||
smazEnabled = value;
|
||||
if (smazEnabled) {
|
||||
cyr2latEnabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
const Divider(height: 8),
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(context.l10n.channels_cyr2latCompression),
|
||||
subtitle: Text(context.l10n.channels_cyr2latCompressionDscr),
|
||||
value: cyr2latEnabled,
|
||||
onChanged: (value) {
|
||||
connector.setContactCyr2LatEnabled(
|
||||
contact.publicKeyHex,
|
||||
value,
|
||||
);
|
||||
connector.setContactSmazEnabled(
|
||||
contact.publicKeyHex,
|
||||
false,
|
||||
);
|
||||
setDialogState(() {
|
||||
cyr2latEnabled = value;
|
||||
if (cyr2latEnabled) {
|
||||
smazEnabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
if (cyr2latEnabled) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 8),
|
||||
child: DropdownButtonFormField<String>(
|
||||
isExpanded: true,
|
||||
initialValue: selectedCyr2LatProfileId,
|
||||
decoration: InputDecoration(
|
||||
labelText:
|
||||
context.l10n.channels_cyr2latSettingsSubheading,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: appSettingsService.settings.cyr2latProfiles.map((
|
||||
profile,
|
||||
) {
|
||||
return DropdownMenuItem(
|
||||
value: profile.id,
|
||||
child: Text(
|
||||
profile.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
connector.setContactCyr2LatProfileId(
|
||||
contact.publicKeyHex,
|
||||
value,
|
||||
);
|
||||
setDialogState(() {
|
||||
selectedCyr2LatProfileId = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
const Divider(height: 8),
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(context.l10n.urlImage_enable),
|
||||
|
||||
@@ -80,6 +80,8 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
|
||||
final List<_PendingContactOperation> _pendingOperations = [];
|
||||
final DerivedListCache<Contact> _filteredCache = DerivedListCache<Contact>();
|
||||
final Map<String, _ContactTileEntrance> _rowCache = {};
|
||||
MeshCoreConnector? _rowCacheConnector;
|
||||
|
||||
StreamSubscription<Uint8List>? _frameSubscription;
|
||||
|
||||
@@ -1098,21 +1100,12 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
itemBuilder: (context, row) {
|
||||
if (row == 0) return discoveredTile;
|
||||
final index = row - 1;
|
||||
final contact = filteredAndSorted[index];
|
||||
final unreadCount = connector.getUnreadCountForContact(
|
||||
contact,
|
||||
);
|
||||
return _ContactTileEntrance(
|
||||
index: index,
|
||||
contact: contact,
|
||||
pathHashByteWidth: connector.pathHashByteWidth,
|
||||
lastSeen: resolveContactLastSeen(contact),
|
||||
unreadCount: unreadCount,
|
||||
isFavorite: contact.isFavorite,
|
||||
onTap: () => _openChat(context, contact),
|
||||
onLongPress: () =>
|
||||
_showContactOptions(context, connector, contact),
|
||||
onManage: _manageAction(context, contact),
|
||||
return _contactRow(
|
||||
context,
|
||||
connector,
|
||||
filteredAndSorted[index],
|
||||
index,
|
||||
filteredAndSorted.length,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -1122,6 +1115,54 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
/// Returns the row built last time for [contact] when nothing it shows has
|
||||
/// changed. The connector notifies up to 20 times a second on a busy mesh
|
||||
/// and each notify rebuilds this screen; handing the list the same widget
|
||||
/// instance lets Flutter skip rebuilding those rows.
|
||||
_ContactTileEntrance _contactRow(
|
||||
BuildContext context,
|
||||
MeshCoreConnector connector,
|
||||
Contact contact,
|
||||
int index,
|
||||
int rowCount,
|
||||
) {
|
||||
if (!identical(_rowCacheConnector, connector)) {
|
||||
_rowCache.clear();
|
||||
_rowCacheConnector = connector;
|
||||
}
|
||||
final unreadCount = connector.getUnreadCountForContact(contact);
|
||||
final pathHashByteWidth = connector.pathHashByteWidth;
|
||||
// Relative ("5 mins ago"), so it can change while the contact does not.
|
||||
final lastSeenLabel = formatContactLastSeen(
|
||||
context.l10n,
|
||||
resolveContactLastSeen(contact),
|
||||
);
|
||||
final cached = _rowCache[contact.publicKeyHex];
|
||||
if (cached != null &&
|
||||
identical(cached.contact, contact) &&
|
||||
cached.index == index &&
|
||||
cached.unreadCount == unreadCount &&
|
||||
cached.pathHashByteWidth == pathHashByteWidth &&
|
||||
cached.lastSeenLabel == lastSeenLabel) {
|
||||
return cached;
|
||||
}
|
||||
// Drop rows of contacts that left the list now and then.
|
||||
if (_rowCache.length > rowCount + 100) _rowCache.clear();
|
||||
return _rowCache[contact.publicKeyHex] = _ContactTileEntrance(
|
||||
index: index,
|
||||
contact: contact,
|
||||
pathHashByteWidth: pathHashByteWidth,
|
||||
lastSeenLabel: lastSeenLabel,
|
||||
unreadCount: unreadCount,
|
||||
isFavorite: contact.isFavorite,
|
||||
// The State's context: rows outlive the list's item context while the
|
||||
// list is swapped for an empty state.
|
||||
onTap: () => _openChat(this.context, contact),
|
||||
onLongPress: () => _showContactOptions(this.context, connector, contact),
|
||||
onManage: _manageAction(this.context, contact),
|
||||
);
|
||||
}
|
||||
|
||||
List<Contact> _filterAndSortContacts(
|
||||
List<Contact> contacts,
|
||||
MeshCoreConnector connector,
|
||||
@@ -1155,7 +1196,8 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
|
||||
DateTime _lastMessageTime(MeshCoreConnector connector, Contact contact) {
|
||||
final messages = connector.getMessages(contact);
|
||||
return messages.isEmpty ? DateTime(1970) : messages.last.timestamp;
|
||||
// Local arrival time: sender clocks can be far off.
|
||||
return messages.isEmpty ? DateTime(1970) : messages.last.receivedAt;
|
||||
}
|
||||
|
||||
List<Contact> _computeFilteredContacts(
|
||||
@@ -1203,16 +1245,24 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
|
||||
switch (viewState.contactsSortOption) {
|
||||
case ContactSortOption.lastSeen:
|
||||
filtered.sort(
|
||||
(a, b) =>
|
||||
resolveContactLastSeen(b).compareTo(resolveContactLastSeen(a)),
|
||||
);
|
||||
final lastSeenAt = {
|
||||
for (final c in filtered)
|
||||
c: resolveContactLastSeen(
|
||||
c,
|
||||
addedAt: connector.contactAddedAt(c.publicKeyHex),
|
||||
),
|
||||
};
|
||||
filtered.sort((a, b) => lastSeenAt[b]!.compareTo(lastSeenAt[a]!));
|
||||
break;
|
||||
case ContactSortOption.recentMessages:
|
||||
final lastMessageAt = {
|
||||
for (final c in filtered) c: _lastMessageTime(connector, c),
|
||||
};
|
||||
filtered.sort((a, b) => lastMessageAt[b]!.compareTo(lastMessageAt[a]!));
|
||||
filtered.sort((a, b) {
|
||||
final timeCompare = lastMessageAt[b]!.compareTo(lastMessageAt[a]!);
|
||||
if (timeCompare != 0) return timeCompare;
|
||||
return a.name.toLowerCase().compareTo(b.name.toLowerCase());
|
||||
});
|
||||
break;
|
||||
case ContactSortOption.name:
|
||||
filtered.sort(
|
||||
@@ -1874,7 +1924,7 @@ void confirmRemoveContact(
|
||||
class _ContactTile extends StatelessWidget {
|
||||
final Contact contact;
|
||||
final int pathHashByteWidth;
|
||||
final DateTime lastSeen;
|
||||
final String lastSeenLabel;
|
||||
final int unreadCount;
|
||||
final bool isFavorite;
|
||||
final VoidCallback onTap;
|
||||
@@ -1884,7 +1934,7 @@ class _ContactTile extends StatelessWidget {
|
||||
const _ContactTile({
|
||||
required this.contact,
|
||||
required this.pathHashByteWidth,
|
||||
required this.lastSeen,
|
||||
required this.lastSeenLabel,
|
||||
required this.unreadCount,
|
||||
required this.isFavorite,
|
||||
required this.onTap,
|
||||
@@ -2016,7 +2066,7 @@ class _ContactTile extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
Text(
|
||||
formatContactLastSeen(context.l10n, lastSeen),
|
||||
lastSeenLabel,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: MeshTheme.mono(
|
||||
@@ -2121,7 +2171,7 @@ class _ContactTileEntrance extends StatelessWidget {
|
||||
final int index;
|
||||
final Contact contact;
|
||||
final int pathHashByteWidth;
|
||||
final DateTime lastSeen;
|
||||
final String lastSeenLabel;
|
||||
final int unreadCount;
|
||||
final bool isFavorite;
|
||||
final VoidCallback onTap;
|
||||
@@ -2132,7 +2182,7 @@ class _ContactTileEntrance extends StatelessWidget {
|
||||
required this.index,
|
||||
required this.contact,
|
||||
required this.pathHashByteWidth,
|
||||
required this.lastSeen,
|
||||
required this.lastSeenLabel,
|
||||
required this.unreadCount,
|
||||
required this.isFavorite,
|
||||
required this.onTap,
|
||||
@@ -2147,7 +2197,7 @@ class _ContactTileEntrance extends StatelessWidget {
|
||||
child: _ContactTile(
|
||||
contact: contact,
|
||||
pathHashByteWidth: pathHashByteWidth,
|
||||
lastSeen: lastSeen,
|
||||
lastSeenLabel: lastSeenLabel,
|
||||
unreadCount: unreadCount,
|
||||
isFavorite: isFavorite,
|
||||
onTap: onTap,
|
||||
|
||||
@@ -23,6 +23,7 @@ const String _encryptedBackupFormat = 'meshcore-open-encrypted-backup';
|
||||
const List<String> _contactPreferencePrefixes = [
|
||||
'contacts',
|
||||
'contact_groups',
|
||||
'contact_added_at_',
|
||||
'contact_smaz_',
|
||||
'contact_cyr2lat_',
|
||||
'contact_url_images_',
|
||||
@@ -1094,7 +1095,8 @@ class BackupService {
|
||||
return true;
|
||||
}
|
||||
if (items.contains(BackupItem.contacts) &&
|
||||
key.startsWith('contacts$devicePrefix')) {
|
||||
(key.startsWith('contacts$devicePrefix') ||
|
||||
key.startsWith('contact_added_at_$devicePrefix'))) {
|
||||
return true;
|
||||
}
|
||||
if (items.contains(BackupItem.perContactSettings) &&
|
||||
|
||||
@@ -871,14 +871,33 @@ class ImageCodecCancelled implements Exception {
|
||||
String toString() => 'Image processing stopped.';
|
||||
}
|
||||
|
||||
/// Whether this build can run the image codec at all.
|
||||
///
|
||||
/// False on web and in a build made with `scripts/onnx.sh off`, where
|
||||
/// `flutter_onnxruntime` is the pure-Dart stub whose [OnnxRuntime] constructor
|
||||
/// throws [UnsupportedError]. The real constructor has no side effects.
|
||||
final bool imageCodecRuntimeAvailable = _probeOnnxRuntime();
|
||||
|
||||
bool _probeOnnxRuntime() {
|
||||
if (kIsWeb) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
OnnxRuntime();
|
||||
return true;
|
||||
} on UnsupportedError {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// Factory used by the codec worker isolate.
|
||||
///
|
||||
/// Returns `null` on web, where there is no local model file and no isolate.
|
||||
/// Everywhere else it returns the real [OnnxImageCodecBackend]; the session
|
||||
/// turns a `null` here into an [ImageCodecUnimplemented], which the service
|
||||
/// surfaces as `lastError` and maps to `ImageCodecAvailability.unavailable`.
|
||||
/// Returns `null` when [imageCodecRuntimeAvailable] is false. Everywhere else
|
||||
/// it returns the real [OnnxImageCodecBackend]; the session turns a `null`
|
||||
/// here into an [ImageCodecUnimplemented], which the service surfaces as
|
||||
/// `lastError` and maps to `ImageCodecAvailability.unavailable`.
|
||||
ImageCodecBackend? createImageCodecBackend() {
|
||||
if (kIsWeb) {
|
||||
if (!imageCodecRuntimeAvailable) {
|
||||
return null;
|
||||
}
|
||||
return OnnxImageCodecBackend();
|
||||
|
||||
@@ -8,7 +8,8 @@ import '../models/image_codec_support.dart';
|
||||
import '../utils/app_logger.dart';
|
||||
import '../widgets/image_send_codec_binding.dart';
|
||||
import 'app_settings_service.dart';
|
||||
import 'image_codec_backend.dart' show kImageCodecBitstreamPathAvailable;
|
||||
import 'image_codec_backend.dart'
|
||||
show imageCodecRuntimeAvailable, kImageCodecBitstreamPathAvailable;
|
||||
import 'image_codec_file_store.dart';
|
||||
import 'image_codec_session.dart';
|
||||
import 'image_codec_settings_store.dart';
|
||||
@@ -177,9 +178,10 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
|
||||
|
||||
/// Why [availability] is `unavailable`, or null when it is not.
|
||||
///
|
||||
/// EXACTLY THREE CAUSES, all of them permanent properties of the build or the
|
||||
/// EXACTLY FOUR CAUSES, all of them permanent properties of the build or the
|
||||
/// platform, none of them fixable by the user:
|
||||
/// * web, which has no native inference runtime;
|
||||
/// * a build made without ONNX Runtime ([imageCodecRuntimeAvailable]);
|
||||
/// * a build compiled without the entropy path
|
||||
/// ([kImageCodecBitstreamPathAvailable]);
|
||||
/// * a backend that failed to load.
|
||||
@@ -194,6 +196,10 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
|
||||
return 'The image codec needs a native inference runtime, which the web '
|
||||
'build does not have.';
|
||||
}
|
||||
if (!imageCodecRuntimeAvailable) {
|
||||
return 'This build was made without ONNX Runtime, so it cannot send or '
|
||||
'show image messages.';
|
||||
}
|
||||
if (!kImageCodecBitstreamPathAvailable) {
|
||||
return 'This build ships the image decoder only. Encoding and decoding a '
|
||||
'bitstream also needs the entropy-side graph and the rANS coder, '
|
||||
@@ -510,7 +516,7 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
|
||||
/// works. [canEncode]/[canDecode] additionally require the entropy path.
|
||||
bool get canRunInference {
|
||||
final model = selectedModel;
|
||||
return !kIsWeb &&
|
||||
return imageCodecRuntimeAvailable &&
|
||||
!_backendMissing &&
|
||||
model != null &&
|
||||
model.localPath.isNotEmpty;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import '../utils/app_logger.dart';
|
||||
import 'prefs_manager.dart';
|
||||
|
||||
/// Phone time at which each contact was first added from a card, keyed by
|
||||
/// contact public key hex. App-side only: the radio keeps advert time 0 for
|
||||
/// these contacts, so this orders them until a real advert arrives.
|
||||
class ContactAddedAtStore {
|
||||
static const String _keyPrefix = 'contact_added_at_';
|
||||
|
||||
String publicKeyHex = '';
|
||||
set setPublicKeyHex(String value) =>
|
||||
publicKeyHex = value.length > 10 ? value.substring(0, 10) : '';
|
||||
|
||||
String get keyFor => '$_keyPrefix$publicKeyHex';
|
||||
|
||||
Map<String, DateTime> load() {
|
||||
if (publicKeyHex.isEmpty) return {};
|
||||
final jsonString = PrefsManager.instance.getString(keyFor);
|
||||
if (jsonString == null || jsonString.isEmpty) return {};
|
||||
try {
|
||||
final decoded = jsonDecode(jsonString) as Map<String, dynamic>;
|
||||
return {
|
||||
for (final entry in decoded.entries)
|
||||
if (entry.value is int)
|
||||
entry.key: DateTime.fromMillisecondsSinceEpoch(entry.value as int),
|
||||
};
|
||||
} catch (e) {
|
||||
appLogger.warn('Stored contact added times are unreadable: $e');
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> save(Map<String, DateTime> addedAt) async {
|
||||
if (publicKeyHex.isEmpty) return;
|
||||
await PrefsManager.instance.setString(
|
||||
keyFor,
|
||||
jsonEncode({
|
||||
for (final entry in addedAt.entries)
|
||||
entry.key: entry.value.millisecondsSinceEpoch,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,14 @@ class ByteCountedTextField extends StatelessWidget {
|
||||
final int? softLimitBytes;
|
||||
final String? softLimitNote;
|
||||
|
||||
/// Lines the field grows to before it scrolls internally. Null (the
|
||||
/// default) grows without limit.
|
||||
final int? maxLines;
|
||||
|
||||
/// Show the counter row only once usage passes [warningThreshold], and give
|
||||
/// it no space until then. By default the row keeps its height while hidden.
|
||||
final bool counterOnlyNearLimit;
|
||||
|
||||
const ByteCountedTextField({
|
||||
super.key,
|
||||
required this.maxBytes,
|
||||
@@ -80,6 +88,8 @@ class ByteCountedTextField extends StatelessWidget {
|
||||
this.encoder,
|
||||
this.softLimitBytes,
|
||||
this.softLimitNote,
|
||||
this.maxLines,
|
||||
this.counterOnlyNearLimit = false,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -92,7 +102,9 @@ class ByteCountedTextField extends StatelessWidget {
|
||||
: value.text;
|
||||
final usedBytes = utf8.encode(effectiveText).length;
|
||||
final ratio = maxBytes > 0 ? usedBytes / maxBytes : 0.0;
|
||||
final showCounter = !(hideCounterWhenEmpty && value.text.isEmpty);
|
||||
final showCounter = counterOnlyNearLimit
|
||||
? ratio > warningThreshold
|
||||
: !(hideCounterWhenEmpty && value.text.isEmpty);
|
||||
final showSoftLimitNote =
|
||||
softLimitNote != null &&
|
||||
softLimitBytes != null &&
|
||||
@@ -104,12 +116,27 @@ class ByteCountedTextField extends StatelessWidget {
|
||||
? Theme.of(context).colorScheme.tertiary
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
|
||||
final softNote = showSoftLimitNote
|
||||
? Text(
|
||||
softLimitNote!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.tertiary,
|
||||
),
|
||||
)
|
||||
: null;
|
||||
final counter = Text(
|
||||
'$usedBytes / $maxBytes',
|
||||
style: TextStyle(fontSize: 12, color: counterColor),
|
||||
);
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
TextField(
|
||||
maxLines: null,
|
||||
minLines: maxLines == null ? null : 1,
|
||||
maxLines: maxLines,
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
autofocus: autofocus,
|
||||
@@ -134,32 +161,32 @@ class ByteCountedTextField extends StatelessWidget {
|
||||
textInputAction: textInputAction,
|
||||
onSubmitted: onSubmitted,
|
||||
),
|
||||
Opacity(
|
||||
opacity: showCounter ? 1 : 0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 4, right: 4),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: showSoftLimitNote
|
||||
? Text(
|
||||
softLimitNote!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.tertiary,
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'$usedBytes / $maxBytes',
|
||||
style: TextStyle(fontSize: 12, color: counterColor),
|
||||
),
|
||||
],
|
||||
if (counterOnlyNearLimit && showCounter)
|
||||
// Right-aligned, and wraps rather than overflowing at large
|
||||
// text sizes in a narrow field.
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 12, 8),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.end,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 8,
|
||||
children: [?softNote, counter],
|
||||
),
|
||||
)
|
||||
else if (!counterOnlyNearLimit)
|
||||
Opacity(
|
||||
opacity: showCounter ? 1 : 0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 4, right: 4),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(child: softNote ?? const SizedBox.shrink()),
|
||||
const SizedBox(width: 8),
|
||||
counter,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
@@ -42,26 +42,79 @@ ChatBackgroundService? _maybeService(
|
||||
}
|
||||
|
||||
/// Draws [chatKey]'s background (its own, or the theme's) behind [child].
|
||||
///
|
||||
/// A [footer] (the chat composer) sits below [child] over the same
|
||||
/// background and can ask [ChatBackdrop.hasBackgroundOf] whether one is
|
||||
/// drawn. [contentKey] marks the message area above the footer.
|
||||
class ChatBackdrop extends StatelessWidget {
|
||||
final String chatKey;
|
||||
final Widget child;
|
||||
final Widget? footer;
|
||||
final Key? contentKey;
|
||||
|
||||
const ChatBackdrop({super.key, required this.chatKey, required this.child});
|
||||
const ChatBackdrop({
|
||||
super.key,
|
||||
required this.chatKey,
|
||||
required this.child,
|
||||
this.footer,
|
||||
this.contentKey,
|
||||
});
|
||||
|
||||
/// Whether the nearest [ChatBackdrop] draws a background behind its footer.
|
||||
static bool hasBackgroundOf(BuildContext context) =>
|
||||
context
|
||||
.dependOnInheritedWidgetOfExactType<_ChatBackdropScope>()
|
||||
?.hasBackground ??
|
||||
false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final background = _maybeService(context)?.resolve(chatKey);
|
||||
if (background == null) return child;
|
||||
final footer = this.footer;
|
||||
if (footer == null) {
|
||||
if (background == null) return child;
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Positioned.fill(child: ChatBackgroundLayer(background: background)),
|
||||
child,
|
||||
],
|
||||
);
|
||||
}
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Positioned.fill(child: ChatBackgroundLayer(background: background)),
|
||||
child,
|
||||
Positioned.fill(
|
||||
child: background == null
|
||||
? const SizedBox.shrink()
|
||||
: ChatBackgroundLayer(background: background),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: KeyedSubtree(key: contentKey, child: child),
|
||||
),
|
||||
_ChatBackdropScope(
|
||||
hasBackground: background != null,
|
||||
child: footer,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ChatBackdropScope extends InheritedWidget {
|
||||
final bool hasBackground;
|
||||
|
||||
const _ChatBackdropScope({required this.hasBackground, required super.child});
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(_ChatBackdropScope oldWidget) =>
|
||||
hasBackground != oldWidget.hasBackground;
|
||||
}
|
||||
|
||||
/// Paints one [ChatBackground], faded toward the theme's surface color.
|
||||
class ChatBackgroundLayer extends StatelessWidget {
|
||||
final ChatBackground background;
|
||||
|
||||
+378
-149
@@ -8,10 +8,12 @@ import '../services/app_settings_service.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../utils/radio_guard.dart';
|
||||
import 'byte_count_input.dart';
|
||||
import 'chat_background.dart';
|
||||
import 'connect_sheet.dart';
|
||||
import 'gif_message.dart';
|
||||
import 'gif_picker.dart';
|
||||
import 'mesh_ui.dart';
|
||||
import 'message_bubble_frame.dart';
|
||||
import 'message_translation_button.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
@@ -54,10 +56,60 @@ Future<void> showComposerTranslationOptions(BuildContext context) async {
|
||||
);
|
||||
}
|
||||
|
||||
/// The message composer shared by the direct and channel chat screens:
|
||||
/// "+" action menu, optional translation toggle, byte-counted text field (or
|
||||
/// GIF preview) and send button. [header] widgets (reply banner, progress)
|
||||
/// are stacked above the row.
|
||||
/// Corner radius of the compose bubble and the offline bar.
|
||||
const double kComposerBubbleRadius = 20;
|
||||
|
||||
/// Lines the compose field grows to before it scrolls.
|
||||
const int kComposerMaxLines = 5;
|
||||
|
||||
/// Fill of the compose bubble: the incoming-bubble colour over a chat
|
||||
/// background so it stays readable, otherwise a raised surface.
|
||||
Color composerBubbleColor(BuildContext context) {
|
||||
return ChatBackdrop.hasBackgroundOf(context)
|
||||
? MessageBubbleColors.of(context, isOutgoing: false).background
|
||||
: Theme.of(context).colorScheme.surfaceContainerHigh;
|
||||
}
|
||||
|
||||
/// The bottom panel holding the compose bubble: transparent over a chat
|
||||
/// background, solid surface otherwise. 12dp side and 8dp vertical margins
|
||||
/// (8dp on the trailing side, where the round button's touch target adds 2).
|
||||
class _ComposerPanel extends StatelessWidget {
|
||||
final List<Widget> header;
|
||||
final Widget child;
|
||||
|
||||
const _ComposerPanel({this.header = const [], required this.child});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final content = SafeArea(
|
||||
top: false,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
...header,
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(12, 8, 10, 8),
|
||||
child: child,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (ChatBackdrop.hasBackgroundOf(context)) return content;
|
||||
return ColoredBox(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: content,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// The message composer shared by the direct and channel chat screens.
|
||||
///
|
||||
/// A rounded compose bubble (optional [replyPreview], then the byte-counted
|
||||
/// text field or a GIF preview, with the translation toggle on its right)
|
||||
/// and one round button beside it: "+" (the [actionsBuilder] menu) while the
|
||||
/// field is empty, Send once there is text. [header] widgets (e.g. image
|
||||
/// send progress) are stacked full-width above the bubble.
|
||||
class ChatComposer extends StatelessWidget {
|
||||
final TextEditingController controller;
|
||||
final FocusNode focusNode;
|
||||
@@ -74,6 +126,12 @@ class ChatComposer extends StatelessWidget {
|
||||
final ValueChanged<String> onAction;
|
||||
final List<Widget> header;
|
||||
|
||||
/// Shown inside the top of the bubble, usually a [ChatComposerQuote].
|
||||
final Widget? replyPreview;
|
||||
|
||||
/// Marks the compose bubble (and the offline bar's bubble).
|
||||
static const bubbleKey = ValueKey('chat-composer-bubble');
|
||||
|
||||
const ChatComposer({
|
||||
super.key,
|
||||
required this.controller,
|
||||
@@ -87,6 +145,7 @@ class ChatComposer extends StatelessWidget {
|
||||
this.softLimitNote,
|
||||
this.encoder,
|
||||
this.header = const [],
|
||||
this.replyPreview,
|
||||
});
|
||||
|
||||
Future<void> _openActionMenu(BuildContext buttonContext) async {
|
||||
@@ -128,7 +187,6 @@ class ChatComposer extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
// Offline the chat is read-only. The draft stays in [controller] (owned
|
||||
// by the screen) and is back when the radio reconnects.
|
||||
if (context.radioReadOnly) return const OfflineComposerBar();
|
||||
@@ -140,26 +198,40 @@ class ChatComposer extends StatelessWidget {
|
||||
s.settings.translationTargetLanguageCode,
|
||||
),
|
||||
);
|
||||
return Container(
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final replyPreview = this.replyPreview;
|
||||
final bubble = DecoratedBox(
|
||||
key: ChatComposer.bubbleKey,
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surface,
|
||||
border: Border(top: BorderSide(color: scheme.outlineVariant, width: 1)),
|
||||
color: composerBubbleColor(context),
|
||||
borderRadius: BorderRadius.circular(kComposerBubbleRadius),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
...header,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
if (replyPreview != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
padding: const EdgeInsets.fromLTRB(6, 6, 6, 0),
|
||||
child: replyPreview,
|
||||
),
|
||||
ValueListenableBuilder<TextEditingValue>(
|
||||
valueListenable: controller,
|
||||
builder: (context, value, _) {
|
||||
final gifId = GifHelper.parseGif(value.text);
|
||||
if (gifId != null) {
|
||||
return _buildGifPreview(context, gifId, scheme);
|
||||
}
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Builder(
|
||||
builder: (buttonContext) => IconButton(
|
||||
icon: const Icon(Icons.add_circle_outline),
|
||||
tooltip: context.l10n.chat_selectSendAction,
|
||||
onPressed: () => _openActionMenu(buttonContext),
|
||||
Expanded(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) => _buildTextField(
|
||||
context,
|
||||
scheme,
|
||||
constraints.maxHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (translation.$1)
|
||||
@@ -168,50 +240,34 @@ class ChatComposer extends StatelessWidget {
|
||||
languageCode: translation.$3,
|
||||
onPressed: () => showComposerTranslationOptions(context),
|
||||
),
|
||||
Expanded(
|
||||
child: ValueListenableBuilder<TextEditingValue>(
|
||||
valueListenable: controller,
|
||||
builder: (context, value, _) {
|
||||
final gifId = GifHelper.parseGif(value.text);
|
||||
if (gifId != null) {
|
||||
return _buildGifPreview(context, gifId, scheme);
|
||||
}
|
||||
return _buildTextField(context, scheme);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
ValueListenableBuilder<TextEditingValue>(
|
||||
valueListenable: controller,
|
||||
builder: (context, value, _) {
|
||||
final hasText = value.text.trim().isNotEmpty;
|
||||
return IconButton.filled(
|
||||
icon: const ThemedIcon(ThemeIconSlot.send, size: 20),
|
||||
tooltip: sendTooltip,
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: hasText
|
||||
? scheme.primary
|
||||
: scheme.surfaceContainerHighest,
|
||||
foregroundColor: hasText
|
||||
? scheme.onPrimary
|
||||
: scheme.onSurfaceVariant,
|
||||
minimumSize: const Size(40, 40),
|
||||
shape: const CircleBorder(),
|
||||
),
|
||||
onPressed: hasText
|
||||
? () {
|
||||
HapticFeedback.lightImpact();
|
||||
onSend();
|
||||
}
|
||||
: null,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return _ComposerPanel(
|
||||
header: header,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Expanded(child: bubble),
|
||||
const SizedBox(width: 4),
|
||||
ValueListenableBuilder<TextEditingValue>(
|
||||
valueListenable: controller,
|
||||
builder: (context, value, _) => _ComposerRoundButton(
|
||||
hasText: value.text.trim().isNotEmpty,
|
||||
sendTooltip: sendTooltip,
|
||||
actionsTooltip: context.l10n.chat_selectSendAction,
|
||||
onSend: () {
|
||||
HapticFeedback.lightImpact();
|
||||
onSend();
|
||||
},
|
||||
onOpenActions: _openActionMenu,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -232,39 +288,57 @@ class ChatComposer extends StatelessWidget {
|
||||
}
|
||||
return KeyEventResult.ignored;
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: GifMessage(
|
||||
url: 'https://media.giphy.com/media/$gifId/giphy.gif',
|
||||
backgroundColor: scheme.surfaceContainerHighest,
|
||||
fallbackTextColor: scheme.onSurface.withValues(alpha: 0.6),
|
||||
maxSize: 160,
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(8, 8, 0, 8),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||
child: GifMessage(
|
||||
url: 'https://media.giphy.com/media/$gifId/giphy.gif',
|
||||
backgroundColor: scheme.surfaceContainerHighest,
|
||||
fallbackTextColor: scheme.onSurfaceVariant,
|
||||
maxSize: 160,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
tooltip: context.l10n.chat_removeGif,
|
||||
onPressed: () {
|
||||
controller.clear();
|
||||
focusNode.requestFocus();
|
||||
},
|
||||
),
|
||||
],
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
tooltip: context.l10n.chat_removeGif,
|
||||
onPressed: () {
|
||||
controller.clear();
|
||||
focusNode.requestFocus();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTextField(BuildContext context, ColorScheme scheme) {
|
||||
OutlineInputBorder border(Color color, [double width = 1]) =>
|
||||
OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||
borderSide: BorderSide(color: color, width: width),
|
||||
);
|
||||
/// [maxHeight] is the room the chat leaves the composer: above the
|
||||
/// keyboard, since the screen's body resizes for it.
|
||||
Widget _buildTextField(
|
||||
BuildContext context,
|
||||
ColorScheme scheme,
|
||||
double maxHeight,
|
||||
) {
|
||||
// Five lines, or fewer when large text and a short window leave little
|
||||
// room, so the field takes no more than about a quarter of the chat.
|
||||
// Never one line: that stops wrapping and the keyboard's newline key.
|
||||
final room = maxHeight.isFinite
|
||||
? maxHeight
|
||||
: MediaQuery.sizeOf(context).height;
|
||||
final lineHeight = MediaQuery.textScalerOf(context).scale(16) * 1.5;
|
||||
final maxLines = (room / 4 / lineHeight).floor().clamp(
|
||||
2,
|
||||
kComposerMaxLines,
|
||||
);
|
||||
return ByteCountedTextField(
|
||||
maxBytes: maxBytes,
|
||||
softLimitBytes: softLimitBytes,
|
||||
@@ -274,85 +348,240 @@ class ChatComposer extends StatelessWidget {
|
||||
hintText: context.l10n.chat_typeMessage,
|
||||
onSubmitted: (_) => onSend(),
|
||||
encoder: encoder,
|
||||
maxLines: maxLines,
|
||||
counterOnlyNearLimit: true,
|
||||
decoration: InputDecoration(
|
||||
hintText: context.l10n.chat_typeMessage,
|
||||
border: border(scheme.outlineVariant),
|
||||
enabledBorder: border(scheme.outlineVariant),
|
||||
focusedBorder: border(scheme.primary, 1.5),
|
||||
filled: true,
|
||||
fillColor: scheme.surfaceContainerLow,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 18,
|
||||
vertical: 12,
|
||||
),
|
||||
hintStyle: TextStyle(color: scheme.onSurfaceVariant),
|
||||
border: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
filled: false,
|
||||
isDense: true,
|
||||
// A 24dp line plus 12 above and below: 48dp on one line, level with
|
||||
// the round button beside the bubble.
|
||||
contentPadding: const EdgeInsetsDirectional.fromSTEB(16, 12, 8, 12),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Stands in for the composer while no radio is connected.
|
||||
class OfflineComposerBar extends StatelessWidget {
|
||||
const OfflineComposerBar({super.key});
|
||||
/// The round button beside the compose bubble: "+" while the field is
|
||||
/// empty, Send once there is text. Drawn at 44dp in a 48dp touch target.
|
||||
class _ComposerRoundButton extends StatelessWidget {
|
||||
final bool hasText;
|
||||
final String sendTooltip;
|
||||
final String actionsTooltip;
|
||||
final VoidCallback onSend;
|
||||
final ValueChanged<BuildContext> onOpenActions;
|
||||
|
||||
const _ComposerRoundButton({
|
||||
required this.hasText,
|
||||
required this.sendTooltip,
|
||||
required this.actionsTooltip,
|
||||
required this.onSend,
|
||||
required this.onOpenActions,
|
||||
});
|
||||
|
||||
static const _visualSize = Size(44, 44);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surfaceContainerLow,
|
||||
border: Border(top: BorderSide(color: scheme.outlineVariant, width: 1)),
|
||||
ButtonStyle style(Color background, Color foreground) =>
|
||||
IconButton.styleFrom(
|
||||
backgroundColor: background,
|
||||
foregroundColor: foreground,
|
||||
fixedSize: _visualSize,
|
||||
minimumSize: _visualSize,
|
||||
padding: EdgeInsets.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.padded,
|
||||
shape: const CircleBorder(),
|
||||
);
|
||||
final Widget button = hasText
|
||||
? IconButton.filled(
|
||||
key: const ValueKey('composer-send'),
|
||||
icon: const ThemedIcon(ThemeIconSlot.send, size: 22),
|
||||
tooltip: sendTooltip,
|
||||
style: style(scheme.primary, scheme.onPrimary),
|
||||
onPressed: onSend,
|
||||
)
|
||||
: Builder(
|
||||
key: const ValueKey('composer-actions'),
|
||||
builder: (buttonContext) => IconButton.filled(
|
||||
icon: const Icon(Icons.add, size: 28),
|
||||
tooltip: actionsTooltip,
|
||||
style: style(composerBubbleColor(context), scheme.onSurface),
|
||||
onPressed: () => onOpenActions(buttonContext),
|
||||
),
|
||||
);
|
||||
return SizedBox.square(
|
||||
dimension: kMinInteractiveDimension,
|
||||
child: AnimatedSwitcher(
|
||||
duration: MediaQuery.disableAnimationsOf(context)
|
||||
? Duration.zero
|
||||
: const Duration(milliseconds: 150),
|
||||
transitionBuilder: (child, animation) => FadeTransition(
|
||||
opacity: animation,
|
||||
child: ScaleTransition(
|
||||
scale: Tween<double>(begin: 0.6, end: 1).animate(animation),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
child: button,
|
||||
),
|
||||
child: SafeArea(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// A quoted message inside the top of the compose bubble ("Replying to
|
||||
/// Bob"): a coloured bar on the leading edge, [title], [content], optional
|
||||
/// [trailing] controls and a dismiss button.
|
||||
class ChatComposerQuote extends StatelessWidget {
|
||||
final String title;
|
||||
final Widget content;
|
||||
final Widget? trailing;
|
||||
final VoidCallback onDismiss;
|
||||
final String dismissTooltip;
|
||||
|
||||
const ChatComposerQuote({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.content,
|
||||
required this.onDismiss,
|
||||
required this.dismissTooltip,
|
||||
this.trailing,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final background = scheme.surfaceContainerHighest;
|
||||
final accent = readableAccent(scheme.primary, background);
|
||||
final trailing = this.trailing;
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: background,
|
||||
border: BorderDirectional(start: BorderSide(color: accent, width: 4)),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 10, 12, 10),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10, 6, 0, 6),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final message = Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.cloud_off,
|
||||
color: scheme.onSurfaceVariant,
|
||||
size: 24,
|
||||
builder: (context, constraints) => Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: accent,
|
||||
),
|
||||
),
|
||||
content,
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.l10n.chat_composerOffline,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
|
||||
),
|
||||
// The quote shares its row with Send, so a long trailing
|
||||
// control (a region chip) must not squeeze out the message
|
||||
// or the dismiss button.
|
||||
if (trailing != null)
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: constraints.maxWidth * 0.4,
|
||||
),
|
||||
child: trailing,
|
||||
),
|
||||
],
|
||||
);
|
||||
// Side by side when there is room; otherwise the button goes
|
||||
// under the message so large text never squeezes it.
|
||||
final roomy =
|
||||
constraints.maxWidth /
|
||||
MediaQuery.textScalerOf(context).scale(1) >=
|
||||
420;
|
||||
if (roomy) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(child: message),
|
||||
const SizedBox(width: 8),
|
||||
const ConnectButton(),
|
||||
],
|
||||
);
|
||||
}
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
message,
|
||||
const SizedBox(height: 8),
|
||||
const ConnectButton(),
|
||||
],
|
||||
);
|
||||
},
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
tooltip: dismissTooltip,
|
||||
color: scheme.onSurfaceVariant,
|
||||
onPressed: onDismiss,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Stands in for the composer while no radio is connected, in the same
|
||||
/// bubble and margins so the chat doesn't jump on connect or disconnect.
|
||||
class OfflineComposerBar extends StatelessWidget {
|
||||
const OfflineComposerBar({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final message = ConstrainedBox(
|
||||
constraints: const BoxConstraints(minHeight: kMinInteractiveDimension),
|
||||
child: DecoratedBox(
|
||||
key: ChatComposer.bubbleKey,
|
||||
decoration: BoxDecoration(
|
||||
color: composerBubbleColor(context),
|
||||
borderRadius: BorderRadius.circular(kComposerBubbleRadius),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.cloud_off, color: scheme.onSurfaceVariant, size: 24),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.l10n.chat_composerOffline,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
return _ComposerPanel(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
// Side by side when there is room; otherwise the button goes
|
||||
// under the message so large text never squeezes it.
|
||||
final roomy =
|
||||
constraints.maxWidth /
|
||||
MediaQuery.textScalerOf(context).scale(1) >=
|
||||
420;
|
||||
if (roomy) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Expanded(child: message),
|
||||
const SizedBox(width: 4),
|
||||
const ConnectButton(),
|
||||
],
|
||||
);
|
||||
}
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
message,
|
||||
const SizedBox(height: 8),
|
||||
const Align(
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: ConnectButton(),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,364 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
|
||||
import '../l10n/l10n.dart';
|
||||
import '../models/app_settings.dart';
|
||||
import '../models/chat_compression_mode.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import 'mesh_nav_tile.dart';
|
||||
import 'mesh_ui.dart';
|
||||
|
||||
export '../models/chat_compression_mode.dart';
|
||||
|
||||
/// Always-visible "Compression: Off / SMAZ / Cyr2Lat" strip for the top of a
|
||||
/// DM or channel chat. Tapping it opens one sheet with the three choices,
|
||||
/// what each does, and the Cyr2Lat profile picker.
|
||||
///
|
||||
/// The parent supplies the saved state and persists changes through the
|
||||
/// callbacks; this widget only shows a new mode once the parent rebuilds it
|
||||
/// with that mode. A callback that throws leaves the saved mode in place and
|
||||
/// shows an error in the sheet.
|
||||
class ChatCompressionSelector extends StatefulWidget {
|
||||
final ChatCompressionMode mode;
|
||||
|
||||
/// False disables the strip and the sheet; [disabledReason] says why.
|
||||
final bool enabled;
|
||||
final String? disabledReason;
|
||||
|
||||
final List<Cyr2LatProfile> profiles;
|
||||
|
||||
/// The Cyr2Lat profile saved for this chat, if any.
|
||||
final String? profileId;
|
||||
|
||||
/// The app-wide profile, which sending uses when [profileId] is unset or
|
||||
/// no longer exists.
|
||||
final String? defaultProfileId;
|
||||
|
||||
final Future<void> Function(ChatCompressionMode mode) onModeChanged;
|
||||
final Future<void> Function(String profileId) onProfileChanged;
|
||||
|
||||
const ChatCompressionSelector({
|
||||
super.key,
|
||||
required this.mode,
|
||||
required this.enabled,
|
||||
this.disabledReason,
|
||||
required this.profiles,
|
||||
required this.profileId,
|
||||
this.defaultProfileId,
|
||||
required this.onModeChanged,
|
||||
required this.onProfileChanged,
|
||||
});
|
||||
|
||||
/// The profile sending actually uses, matching the connector's fallback.
|
||||
String? get effectiveProfileId {
|
||||
bool known(String? id) => profiles.any((p) => p.id == id);
|
||||
if (known(profileId)) return profileId;
|
||||
if (known(defaultProfileId)) return defaultProfileId;
|
||||
return profiles.isEmpty ? null : profiles.first.id;
|
||||
}
|
||||
|
||||
@override
|
||||
State<ChatCompressionSelector> createState() =>
|
||||
_ChatCompressionSelectorState();
|
||||
}
|
||||
|
||||
String chatCompressionModeLabel(BuildContext context, ChatCompressionMode m) {
|
||||
final l10n = context.l10n;
|
||||
return switch (m) {
|
||||
ChatCompressionMode.off => l10n.chatCompression_off,
|
||||
ChatCompressionMode.smaz => l10n.chatCompression_smaz,
|
||||
ChatCompressionMode.cyr2lat => l10n.chatCompression_cyr2lat,
|
||||
};
|
||||
}
|
||||
|
||||
/// What the open sheet renders. The sheet is a separate route, so it listens
|
||||
/// to this instead of rebuilding with the strip.
|
||||
class _SelectorView {
|
||||
final ChatCompressionMode mode;
|
||||
final bool enabled;
|
||||
final List<Cyr2LatProfile> profiles;
|
||||
final String? profileId;
|
||||
final bool busy;
|
||||
final bool failed;
|
||||
|
||||
/// Counts failed saves, so the profile picker drops an unsaved choice.
|
||||
final int failures;
|
||||
|
||||
const _SelectorView({
|
||||
required this.mode,
|
||||
required this.enabled,
|
||||
required this.profiles,
|
||||
required this.profileId,
|
||||
required this.busy,
|
||||
required this.failed,
|
||||
required this.failures,
|
||||
});
|
||||
}
|
||||
|
||||
class _ChatCompressionSelectorState extends State<ChatCompressionSelector> {
|
||||
late final ValueNotifier<_SelectorView> _view = ValueNotifier(_snapshot());
|
||||
bool _busy = false;
|
||||
bool _failed = false;
|
||||
int _failures = 0;
|
||||
|
||||
_SelectorView _snapshot() => _SelectorView(
|
||||
mode: widget.mode,
|
||||
enabled: widget.enabled,
|
||||
profiles: widget.profiles,
|
||||
profileId: widget.effectiveProfileId,
|
||||
busy: _busy,
|
||||
failed: _failed,
|
||||
failures: _failures,
|
||||
);
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant ChatCompressionSelector oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
// The sheet route is not below this widget, so it can't be marked dirty
|
||||
// during this build.
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) _view.value = _snapshot();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_view.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _setBusy(bool busy, {required bool failed}) {
|
||||
setState(() {
|
||||
_busy = busy;
|
||||
_failed = failed;
|
||||
if (failed) _failures++;
|
||||
});
|
||||
_view.value = _snapshot();
|
||||
}
|
||||
|
||||
/// Runs one save; returns whether it succeeded.
|
||||
Future<bool> _save(Future<void> Function() write) async {
|
||||
if (_busy || !widget.enabled) return false;
|
||||
_setBusy(true, failed: false);
|
||||
var ok = false;
|
||||
try {
|
||||
await write();
|
||||
ok = true;
|
||||
} catch (e) {
|
||||
debugPrint('[ChatCompressionSelector] save failed: $e');
|
||||
}
|
||||
if (mounted) _setBusy(false, failed: !ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
Future<void> _openSheet() async {
|
||||
if (_failed) _setBusy(false, failed: false);
|
||||
await showMeshSheet<void>(
|
||||
context,
|
||||
builder: (sheetContext) => ValueListenableBuilder<_SelectorView>(
|
||||
valueListenable: _view,
|
||||
builder: (sheetContext, view, _) => _buildSheet(sheetContext, view),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSheet(BuildContext context, _SelectorView view) {
|
||||
final l10n = context.l10n;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final canChange = view.enabled && !view.busy;
|
||||
|
||||
MeshSheetOption option(ChatCompressionMode mode, String description) {
|
||||
return MeshSheetOption(
|
||||
label: chatCompressionModeLabel(context, mode),
|
||||
subtitle: description,
|
||||
selected: view.mode == mode,
|
||||
onTap: canChange
|
||||
? () async {
|
||||
final ok = await _save(() => widget.onModeChanged(mode));
|
||||
// Cyr2Lat stays open so its profile can be picked.
|
||||
if (ok && mode != ChatCompressionMode.cyr2lat) {
|
||||
if (context.mounted) Navigator.of(context).maybePop();
|
||||
}
|
||||
}
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
final profileValue = view.profileId;
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
BottomSheetHeader(
|
||||
title: l10n.chatCompression_title,
|
||||
subtitle: l10n.chatCompression_sheetSubtitle,
|
||||
trailing: view.busy
|
||||
? const Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: SizedBox(
|
||||
width: 18,
|
||||
height: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
if (view.failed)
|
||||
Container(
|
||||
margin: const EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.errorContainer,
|
||||
borderRadius: BorderRadius.circular(MeshRadii.sm),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.error_outline,
|
||||
color: scheme.onErrorContainer,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
l10n.chatCompression_saveFailed,
|
||||
style: Theme.of(context).textTheme.bodyMedium
|
||||
?.copyWith(color: scheme.onErrorContainer),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (!view.enabled && widget.disabledReason != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
|
||||
child: Text(
|
||||
widget.disabledReason!,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
option(
|
||||
ChatCompressionMode.off,
|
||||
l10n.chatCompression_offDescription,
|
||||
),
|
||||
option(
|
||||
ChatCompressionMode.smaz,
|
||||
l10n.chatCompression_smazDescription,
|
||||
),
|
||||
option(
|
||||
ChatCompressionMode.cyr2lat,
|
||||
l10n.chatCompression_cyr2latDescription,
|
||||
),
|
||||
if (view.mode == ChatCompressionMode.cyr2lat &&
|
||||
view.profiles.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
|
||||
child: DropdownButtonFormField<String>(
|
||||
// The field keeps a picked value internally, so rebuild
|
||||
// it with the saved value after a change or a failure.
|
||||
key: ValueKey('$profileValue#${view.failures}'),
|
||||
isExpanded: true,
|
||||
initialValue: profileValue,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.chatCompression_profile,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: [
|
||||
for (final profile in view.profiles)
|
||||
DropdownMenuItem(
|
||||
value: profile.id,
|
||||
child: Text(
|
||||
profile.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: canChange
|
||||
? (id) {
|
||||
if (id == null || id == profileValue) return;
|
||||
_save(() => widget.onProfileChanged(id));
|
||||
}
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
final l10n = context.l10n;
|
||||
final label = l10n.chatCompression_label(
|
||||
chatCompressionModeLabel(context, widget.mode),
|
||||
);
|
||||
final reason = widget.enabled ? null : widget.disabledReason;
|
||||
|
||||
// One short row: the chat already leaves little room for messages at
|
||||
// large text sizes, so a disabled strip explains itself in the sheet.
|
||||
return Material(
|
||||
color: scheme.surfaceContainerLow,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: scheme.outlineVariant)),
|
||||
),
|
||||
child: MergeSemantics(
|
||||
child: Semantics(
|
||||
button: true,
|
||||
enabled: !_busy,
|
||||
label: reason == null ? label : '$label. $reason',
|
||||
hint: l10n.chatCompression_changeHint,
|
||||
child: InkWell(
|
||||
onTap: _busy ? null : _openSheet,
|
||||
child: ExcludeSemantics(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(minHeight: 48),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
label,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
if (_busy)
|
||||
const SizedBox(
|
||||
width: 18,
|
||||
height: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
else
|
||||
Icon(
|
||||
widget.enabled
|
||||
? Icons.arrow_drop_down
|
||||
: Icons.lock_outline,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -43,14 +43,22 @@ ThemeIconSlot? contactTypeIconSlot(int type) {
|
||||
|
||||
/// The most recent activity for [contact]: for chat nodes this includes the
|
||||
/// last message, for other node types only the last advert or telemetry fix.
|
||||
DateTime resolveContactLastSeen(Contact contact) {
|
||||
final heard = contact.lastHeard;
|
||||
/// [addedAt] (the phone time the contact was added from a card) stands in
|
||||
/// while the radio has no advert time for it.
|
||||
DateTime resolveContactLastSeen(Contact contact, {DateTime? addedAt}) {
|
||||
final heard =
|
||||
addedAt != null &&
|
||||
contact.lastSeen.millisecondsSinceEpoch == 0 &&
|
||||
addedAt.isAfter(contact.lastHeard)
|
||||
? addedAt
|
||||
: contact.lastHeard;
|
||||
if (contact.type != advTypeChat) return heard;
|
||||
return contact.lastMessageAt.isAfter(heard) ? contact.lastMessageAt : heard;
|
||||
}
|
||||
|
||||
/// Short relative "last seen" label ("now", "5 mins ago", "2 days ago").
|
||||
String formatContactLastSeen(AppLocalizations l10n, DateTime lastSeen) {
|
||||
if (lastSeen.millisecondsSinceEpoch == 0) return l10n.contacts_lastSeenNever;
|
||||
final diff = DateTime.now().difference(lastSeen);
|
||||
|
||||
if (diff.isNegative || diff.inMinutes < 5) {
|
||||
|
||||
@@ -119,14 +119,18 @@ class MeshNavTile extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// One radio-style option row inside a bottom sheet picker.
|
||||
/// The selected row shows a filled radio icon and a bold title, so the
|
||||
/// choice never depends on colour alone. A null [onTap] disables the row.
|
||||
class MeshSheetOption extends StatelessWidget {
|
||||
final String label;
|
||||
final String? subtitle;
|
||||
final bool selected;
|
||||
final VoidCallback onTap;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
const MeshSheetOption({
|
||||
super.key,
|
||||
required this.label,
|
||||
this.subtitle,
|
||||
required this.selected,
|
||||
required this.onTap,
|
||||
});
|
||||
@@ -134,14 +138,23 @@ class MeshSheetOption extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
selected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
|
||||
size: 24,
|
||||
color: selected ? scheme.primary : scheme.onSurfaceVariant,
|
||||
return Semantics(
|
||||
selected: selected,
|
||||
inMutuallyExclusiveGroup: true,
|
||||
child: ListTile(
|
||||
leading: Icon(
|
||||
selected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
|
||||
size: 24,
|
||||
color: selected ? scheme.primary : scheme.onSurfaceVariant,
|
||||
),
|
||||
title: Text(
|
||||
label,
|
||||
style: selected ? const TextStyle(fontWeight: FontWeight.w700) : null,
|
||||
),
|
||||
subtitle: subtitle == null ? null : Text(subtitle!),
|
||||
enabled: onTap != null,
|
||||
onTap: onTap,
|
||||
),
|
||||
title: Text(label),
|
||||
onTap: onTap,
|
||||
);
|
||||
}
|
||||
}
|
||||
+31
-11
@@ -699,6 +699,11 @@ class ErrorRetryCard extends StatelessWidget {
|
||||
|
||||
/// Staggered fade + slide entrance for list items. Wrap each item and pass
|
||||
/// its [index]; animation only plays once per widget lifecycle.
|
||||
///
|
||||
/// Only rows built while their list is at rest at the top play it. Rows that
|
||||
/// a scroll brings into view appear at once: a delayed fade there leaves
|
||||
/// blank rows trailing the finger and adds a ticker and an opacity layer per
|
||||
/// row during a fling.
|
||||
class ListEntrance extends StatefulWidget {
|
||||
final int index;
|
||||
final Widget child;
|
||||
@@ -711,41 +716,56 @@ class ListEntrance extends StatefulWidget {
|
||||
|
||||
class _ListEntranceState extends State<ListEntrance>
|
||||
with SingleTickerProviderStateMixin {
|
||||
// Created eagerly: a lazy `late final` initializer would run on first
|
||||
// access — which can be dispose(), where ticker creation throws.
|
||||
late final AnimationController _controller;
|
||||
late final CurvedAnimation _curve;
|
||||
// Created in initState, not lazily: a lazy initializer would run on first
|
||||
// access — which can be dispose(), where ticker creation throws. Null when
|
||||
// the row skips the entrance.
|
||||
AnimationController? _controller;
|
||||
CurvedAnimation? _curve;
|
||||
|
||||
/// Whether the enclosing list has scrolled away from the top or is moving,
|
||||
/// i.e. this row is entering because of a scroll.
|
||||
bool _enteredByScroll() {
|
||||
final scrollable = context.findAncestorStateOfType<ScrollableState>();
|
||||
if (scrollable == null) return false;
|
||||
final position = scrollable.position;
|
||||
return position.isScrollingNotifier.value ||
|
||||
(position.hasPixels && position.pixels != 0);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
// Decided once: changing the tree shape later would rebuild the row.
|
||||
if (_enteredByScroll()) return;
|
||||
final controller = _controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 280),
|
||||
);
|
||||
_curve = CurvedAnimation(parent: _controller, curve: Curves.easeOutCubic);
|
||||
_curve = CurvedAnimation(parent: controller, curve: Curves.easeOutCubic);
|
||||
final delay = Duration(milliseconds: 24 * widget.index.clamp(0, 12));
|
||||
Future.delayed(delay, () {
|
||||
if (mounted) _controller.forward();
|
||||
if (mounted) controller.forward();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_curve.dispose();
|
||||
_controller.dispose();
|
||||
_curve?.dispose();
|
||||
_controller?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final curve = _curve;
|
||||
if (curve == null) return widget.child;
|
||||
return FadeTransition(
|
||||
opacity: _curve,
|
||||
opacity: curve,
|
||||
child: SlideTransition(
|
||||
position: Tween(
|
||||
begin: const Offset(0, 0.04),
|
||||
end: Offset.zero,
|
||||
).animate(_curve),
|
||||
).animate(curve),
|
||||
child: widget.child,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -72,8 +72,11 @@ appdir="$workspace/squashfs-root"
|
||||
log 'Checking extracted AppImage structure'
|
||||
[[ -x "$appdir/AppRun" && -f "$appdir/usr/bin/lib/libapp.so" && \
|
||||
-f "$appdir/usr/bin/data/icudtl.dat" && -d "$appdir/usr/bin/data/flutter_assets" ]]
|
||||
[[ -f "$appdir/usr/bin/lib/libonnxruntime.so.1" && \
|
||||
-f "$appdir/usr/share/glib-2.0/schemas/gschemas.compiled" ]]
|
||||
[[ -f "$appdir/usr/share/glib-2.0/schemas/gschemas.compiled" ]]
|
||||
# ONNX-free builds (scripts/onnx.sh off) have neither the plugin nor ORT.
|
||||
if [[ -f "$appdir/usr/bin/lib/libflutter_onnxruntime_plugin.so" ]]; then
|
||||
[[ -f "$appdir/usr/bin/lib/libonnxruntime.so.1" ]]
|
||||
fi
|
||||
|
||||
log 'Starting bundled ELF architecture audit'
|
||||
elf_count=0
|
||||
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
# Switch ONNX Runtime (the image codec's inference engine) on or off.
|
||||
#
|
||||
# scripts/onnx.sh off build without ORT: no native plugin, no downloads
|
||||
# scripts/onnx.sh on default build with ORT
|
||||
# scripts/onnx.sh status print the current mode
|
||||
#
|
||||
# "off" writes pubspec_overrides.yaml, pointing flutter_onnxruntime at the
|
||||
# pure-Dart stub in third_party/flutter_onnxruntime_stub; "on" removes it.
|
||||
# Both run `flutter pub get` (set FLUTTER to use another flutter binary).
|
||||
set -euo pipefail
|
||||
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
overrides="$root/pubspec_overrides.yaml"
|
||||
marker='# Written by scripts/onnx.sh'
|
||||
flutter_bin="${FLUTTER:-flutter}"
|
||||
|
||||
is_ours() {
|
||||
[[ -f "$overrides" ]] && grep -Fq "$marker" "$overrides"
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
off)
|
||||
if [[ -f "$overrides" ]] && ! is_ours; then
|
||||
echo "pubspec_overrides.yaml exists and was not written by this script; edit it by hand." >&2
|
||||
exit 1
|
||||
fi
|
||||
cat > "$overrides" <<EOF
|
||||
$marker off. Remove with: scripts/onnx.sh on
|
||||
dependency_overrides:
|
||||
flutter_onnxruntime:
|
||||
path: third_party/flutter_onnxruntime_stub
|
||||
EOF
|
||||
;;
|
||||
on)
|
||||
if [[ -f "$overrides" ]] && ! is_ours; then
|
||||
echo "pubspec_overrides.yaml was not written by this script; remove the flutter_onnxruntime override by hand." >&2
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$overrides"
|
||||
;;
|
||||
status)
|
||||
if is_ours; then echo off; else echo on; fi
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 off|on|status" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
cd "$root"
|
||||
"$flutter_bin" pub get
|
||||
echo "ONNX Runtime: $1"
|
||||
@@ -7,6 +7,7 @@ import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_protocol.dart';
|
||||
import 'package:meshcore_open/models/channel.dart';
|
||||
import 'package:meshcore_open/models/channel_message.dart';
|
||||
import 'package:meshcore_open/models/chat_compression_mode.dart';
|
||||
import 'package:meshcore_open/review_mode/review_frames.dart';
|
||||
import 'package:meshcore_open/review_mode/review_radio.dart';
|
||||
import 'package:meshcore_open/review_mode/review_script.dart';
|
||||
@@ -201,7 +202,7 @@ void main() {
|
||||
'another slot brings its history back', () async {
|
||||
await _connect(_TestRadio());
|
||||
await _waitFor(() => _texts(1).contains(_queuedHikingText));
|
||||
await _connector.setChannelSmazEnabled(1, true);
|
||||
await _connector.setChannelCompressionMode(1, ChatCompressionMode.smaz);
|
||||
|
||||
await _connector.setChannel(1, 'Hiking Group', ghostPsk);
|
||||
expect(_connector.channelIdForSlot(1), ghostId);
|
||||
@@ -408,7 +409,7 @@ void main() {
|
||||
expect(_texts(5), _texts(1));
|
||||
|
||||
// Settings are stored per channel, so both slots see a change.
|
||||
await _connector.setChannelSmazEnabled(5, true);
|
||||
await _connector.setChannelCompressionMode(5, ChatCompressionMode.smaz);
|
||||
expect(_connector.isChannelSmazEnabled(1), isTrue);
|
||||
await _connector.setChannelRegion(1, 'test-region');
|
||||
expect(_connector.getChannelRegion(5), 'test-region');
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/models/chat_compression_mode.dart';
|
||||
import 'package:meshcore_open/review_mode/review_radio.dart';
|
||||
import 'package:meshcore_open/services/message_retry_service.dart';
|
||||
import 'package:meshcore_open/services/path_history_service.dart';
|
||||
import 'package:meshcore_open/services/storage_service.dart';
|
||||
import 'package:meshcore_open/storage/channel_settings_store.dart';
|
||||
import 'package:meshcore_open/storage/contact_settings_store.dart';
|
||||
import 'package:meshcore_open/storage/prefs_manager.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
const _contactKey =
|
||||
'1111111111111111111111111111111111111111111111111111111111111111';
|
||||
|
||||
Future<void> _waitFor(bool Function() condition) async {
|
||||
final end = DateTime.now().add(const Duration(seconds: 8));
|
||||
while (!condition()) {
|
||||
if (DateTime.now().isAfter(end)) fail('Timed out waiting for condition');
|
||||
await Future<void>.delayed(const Duration(milliseconds: 20));
|
||||
}
|
||||
}
|
||||
|
||||
ContactSettingsStore _contactStore() =>
|
||||
ContactSettingsStore()..setPublicKeyHex = ReviewRadio.selfPublicKeyHex;
|
||||
|
||||
ChannelSettingsStore _channelStore() =>
|
||||
ChannelSettingsStore()..setPublicKeyHex = ReviewRadio.selfPublicKeyHex;
|
||||
|
||||
Future<(bool, bool)> _savedContactFlags() async => (
|
||||
await _contactStore().loadSmazEnabled(_contactKey),
|
||||
await _contactStore().loadCyr2LatEnabled(_contactKey),
|
||||
);
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
late MeshCoreConnector connector;
|
||||
|
||||
// The connector's frame streams can only be listened to once per process,
|
||||
// so the tests share one connected review radio.
|
||||
setUpAll(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
PrefsManager.reset();
|
||||
await PrefsManager.initialize();
|
||||
connector = MeshCoreConnector();
|
||||
final retryService = MessageRetryService();
|
||||
connector.initialize(
|
||||
retryService: retryService,
|
||||
pathHistoryService: PathHistoryService(StorageService()),
|
||||
);
|
||||
connector.reviewRadioFactoryForTest = () => ReviewRadio(
|
||||
scheduledMessageInterval: const Duration(hours: 1),
|
||||
ackDelay: const Duration(hours: 1),
|
||||
replyDelay: const Duration(hours: 1),
|
||||
);
|
||||
await connector.connectReview();
|
||||
await _waitFor(() => connector.channelMapConfirmed);
|
||||
addTearDown(() async {
|
||||
await connector.disconnect();
|
||||
connector.dispose();
|
||||
retryService.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
test('contact modes are mutually exclusive and saved', () async {
|
||||
expect(
|
||||
connector.contactCompressionMode(_contactKey),
|
||||
ChatCompressionMode.off,
|
||||
);
|
||||
|
||||
await connector.setContactCompressionMode(
|
||||
_contactKey,
|
||||
ChatCompressionMode.smaz,
|
||||
);
|
||||
expect(connector.isContactSmazEnabled(_contactKey), isTrue);
|
||||
expect(connector.isContactCyr2LatEnabled(_contactKey), isFalse);
|
||||
expect(await _savedContactFlags(), (true, false));
|
||||
|
||||
await connector.setContactCompressionMode(
|
||||
_contactKey,
|
||||
ChatCompressionMode.cyr2lat,
|
||||
);
|
||||
expect(
|
||||
connector.contactCompressionMode(_contactKey),
|
||||
ChatCompressionMode.cyr2lat,
|
||||
);
|
||||
expect(connector.isContactSmazEnabled(_contactKey), isFalse);
|
||||
expect(await _savedContactFlags(), (false, true));
|
||||
|
||||
await connector.setContactCompressionMode(
|
||||
_contactKey,
|
||||
ChatCompressionMode.off,
|
||||
);
|
||||
expect(
|
||||
connector.contactCompressionMode(_contactKey),
|
||||
ChatCompressionMode.off,
|
||||
);
|
||||
expect(await _savedContactFlags(), (false, false));
|
||||
});
|
||||
|
||||
test('overlapping contact choices end on the last one, never both', () async {
|
||||
final writes = [
|
||||
connector.setContactCompressionMode(
|
||||
_contactKey,
|
||||
ChatCompressionMode.smaz,
|
||||
),
|
||||
connector.setContactCompressionMode(
|
||||
_contactKey,
|
||||
ChatCompressionMode.cyr2lat,
|
||||
),
|
||||
connector.setContactCompressionMode(
|
||||
_contactKey,
|
||||
ChatCompressionMode.smaz,
|
||||
),
|
||||
];
|
||||
await Future.wait(writes);
|
||||
expect(
|
||||
connector.contactCompressionMode(_contactKey),
|
||||
ChatCompressionMode.smaz,
|
||||
);
|
||||
expect(connector.isContactCyr2LatEnabled(_contactKey), isFalse);
|
||||
expect(await _savedContactFlags(), (true, false));
|
||||
});
|
||||
|
||||
test(
|
||||
'channel modes are mutually exclusive and saved by channel ID',
|
||||
() async {
|
||||
final channelId = connector.channelIdForSlot(1)!;
|
||||
|
||||
await connector.setChannelCompressionMode(1, ChatCompressionMode.cyr2lat);
|
||||
expect(connector.channelCompressionMode(1), ChatCompressionMode.cyr2lat);
|
||||
expect(await _channelStore().loadCyr2LatEnabled(channelId), isTrue);
|
||||
expect(await _channelStore().loadSmazEnabled(channelId), isFalse);
|
||||
|
||||
await connector.setChannelCompressionMode(1, ChatCompressionMode.smaz);
|
||||
expect(connector.channelCompressionMode(1), ChatCompressionMode.smaz);
|
||||
expect(connector.isChannelCyr2LatEnabled(1), isFalse);
|
||||
expect(await _channelStore().loadCyr2LatEnabled(channelId), isFalse);
|
||||
expect(await _channelStore().loadSmazEnabled(channelId), isTrue);
|
||||
|
||||
// Other channels are untouched.
|
||||
expect(connector.channelCompressionMode(0), ChatCompressionMode.off);
|
||||
},
|
||||
);
|
||||
|
||||
test('a channel slot without a storage ID is refused', () async {
|
||||
const emptySlot = 30;
|
||||
expect(connector.channelIdForSlot(emptySlot), isNull);
|
||||
await expectLater(
|
||||
connector.setChannelCompressionMode(emptySlot, ChatCompressionMode.smaz),
|
||||
throwsStateError,
|
||||
);
|
||||
expect(
|
||||
connector.channelCompressionMode(emptySlot),
|
||||
ChatCompressionMode.off,
|
||||
);
|
||||
|
||||
// A refused write does not block later ones.
|
||||
await connector.setChannelCompressionMode(1, ChatCompressionMode.smaz);
|
||||
expect(connector.channelCompressionMode(1), ChatCompressionMode.smaz);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_protocol.dart';
|
||||
import 'package:meshcore_open/models/contact.dart';
|
||||
import 'package:meshcore_open/review_mode/review_radio.dart';
|
||||
import 'package:meshcore_open/services/message_retry_service.dart';
|
||||
import 'package:meshcore_open/services/path_history_service.dart';
|
||||
import 'package:meshcore_open/services/storage_service.dart';
|
||||
import 'package:meshcore_open/storage/contact_added_at_store.dart';
|
||||
import 'package:meshcore_open/storage/last_radio_store.dart';
|
||||
import 'package:meshcore_open/storage/prefs_manager.dart';
|
||||
import 'package:meshcore_open/utils/contact_qr.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
Future<void> _waitFor(bool Function() condition, {int seconds = 8}) async {
|
||||
final end = DateTime.now().add(Duration(seconds: seconds));
|
||||
while (!condition()) {
|
||||
if (DateTime.now().isAfter(end)) fail('Timed out waiting for condition');
|
||||
await Future<void>.delayed(const Duration(milliseconds: 25));
|
||||
}
|
||||
}
|
||||
|
||||
class _RecordingReviewRadio extends ReviewRadio {
|
||||
final List<Uint8List> sent = [];
|
||||
|
||||
_RecordingReviewRadio()
|
||||
: super(scheduledMessageInterval: const Duration(hours: 1));
|
||||
|
||||
@override
|
||||
void handle(Uint8List frame) {
|
||||
sent.add(frame);
|
||||
super.handle(frame);
|
||||
}
|
||||
}
|
||||
|
||||
// [cmd][pub_key x32][type][flags][path_len][path x64][name x32][last_advert x4]
|
||||
const _lastAdvertOffset = 1 + 32 + 1 + 1 + 1 + 64 + 32;
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
setUp(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
PrefsManager.reset();
|
||||
await PrefsManager.initialize();
|
||||
});
|
||||
|
||||
test(
|
||||
'a card add records a local added time once, never on the radio',
|
||||
() async {
|
||||
final connector = MeshCoreConnector();
|
||||
addTearDown(connector.dispose);
|
||||
final retryService = MessageRetryService();
|
||||
addTearDown(retryService.dispose);
|
||||
connector.initialize(
|
||||
retryService: retryService,
|
||||
pathHistoryService: PathHistoryService(StorageService()),
|
||||
);
|
||||
final radio = _RecordingReviewRadio();
|
||||
connector.reviewRadioFactoryForTest = () => radio;
|
||||
await connector.connectReview();
|
||||
await _waitFor(() => connector.hasLoadedContacts);
|
||||
|
||||
final key = Uint8List.fromList(List.generate(32, (i) => 0xA0 + (i % 16)));
|
||||
final keyHex = pubKeyToHex(key);
|
||||
final card = ScannedContact(publicKey: key, name: 'Card', type: 1);
|
||||
|
||||
final before = DateTime.now();
|
||||
await connector.addContactFromCard(card);
|
||||
final addedAt = connector.contactAddedAt(keyHex);
|
||||
expect(addedAt, isNotNull);
|
||||
expect(addedAt!.isBefore(before), isFalse);
|
||||
|
||||
// The radio still gets advert time 0 (its replay guard).
|
||||
final addFrame = radio.sent.lastWhere(
|
||||
(f) => f.first == cmdAddUpdateContact,
|
||||
);
|
||||
expect(
|
||||
ByteData.sublistView(
|
||||
addFrame,
|
||||
).getUint32(_lastAdvertOffset, Endian.little),
|
||||
0,
|
||||
);
|
||||
|
||||
// Re-adding keeps the first time.
|
||||
await Future<void>.delayed(const Duration(milliseconds: 5));
|
||||
await connector.addContactFromCard(card);
|
||||
expect(connector.contactAddedAt(keyHex), addedAt);
|
||||
|
||||
// Persisted per radio.
|
||||
final store = ContactAddedAtStore()
|
||||
..setPublicKeyHex = connector.selfPublicKeyHex;
|
||||
expect(
|
||||
store.load()[keyHex]?.millisecondsSinceEpoch,
|
||||
addedAt.millisecondsSinceEpoch,
|
||||
);
|
||||
final otherRadio = ContactAddedAtStore()
|
||||
..setPublicKeyHex = 'ffffffffff00';
|
||||
expect(otherRadio.load(), isEmpty);
|
||||
|
||||
// Removing the contact forgets it, so a later add starts fresh.
|
||||
await connector.removeContact(
|
||||
Contact(
|
||||
publicKey: key,
|
||||
name: 'Card',
|
||||
type: 1,
|
||||
pathLength: -1,
|
||||
path: Uint8List(0),
|
||||
lastSeen: DateTime.fromMillisecondsSinceEpoch(0),
|
||||
),
|
||||
);
|
||||
expect(connector.contactAddedAt(keyHex), isNull);
|
||||
|
||||
// So does the firmware deleting it to make room.
|
||||
await connector.addContactFromCard(card);
|
||||
expect(connector.contactAddedAt(keyHex), isNotNull);
|
||||
connector.handleFrameForTest([pushCodeContactDeleted, ...key]);
|
||||
expect(connector.contactAddedAt(keyHex), isNull);
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
expect(store.load(), isNot(contains(keyHex)));
|
||||
|
||||
await connector.disconnect(manual: true);
|
||||
},
|
||||
);
|
||||
|
||||
test('a saved radio restores its added times after a restart', () async {
|
||||
const radioHex =
|
||||
'a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf';
|
||||
final contactHex = 'c1' * 32;
|
||||
final addedAt = DateTime.fromMillisecondsSinceEpoch(1790000000000);
|
||||
await (ContactAddedAtStore()..setPublicKeyHex = radioHex).save({
|
||||
contactHex: addedAt,
|
||||
});
|
||||
await LastRadioStore().save(
|
||||
LastRadio(
|
||||
publicKeyHex: radioHex,
|
||||
name: 'Base',
|
||||
transport: LastRadio.transportBle,
|
||||
bleRemoteId: 'AA:BB:CC:DD:EE:FF',
|
||||
savedAt: addedAt,
|
||||
),
|
||||
);
|
||||
|
||||
final connector = MeshCoreConnector();
|
||||
addTearDown(connector.dispose);
|
||||
await connector.restoreLastRadio();
|
||||
|
||||
expect(connector.contactAddedAt(contactHex), addedAt);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:provider/single_child_widget.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_protocol.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations.dart';
|
||||
import 'package:meshcore_open/review_mode/review_radio.dart';
|
||||
import 'package:meshcore_open/screens/channel_chat_screen.dart';
|
||||
import 'package:meshcore_open/screens/chat_screen.dart';
|
||||
import 'package:meshcore_open/services/app_debug_log_service.dart';
|
||||
import 'package:meshcore_open/services/app_settings_service.dart';
|
||||
import 'package:meshcore_open/services/ble_debug_log_service.dart';
|
||||
import 'package:meshcore_open/services/chat_text_scale_service.dart';
|
||||
import 'package:meshcore_open/services/image_codec_service.dart';
|
||||
import 'package:meshcore_open/services/map_tile_cache_service.dart';
|
||||
import 'package:meshcore_open/services/message_retry_service.dart';
|
||||
import 'package:meshcore_open/services/path_history_service.dart';
|
||||
import 'package:meshcore_open/services/received_image_store.dart';
|
||||
import 'package:meshcore_open/services/storage_service.dart';
|
||||
import 'package:meshcore_open/services/timeout_prediction_service.dart';
|
||||
import 'package:meshcore_open/services/translation_service.dart';
|
||||
import 'package:meshcore_open/services/ui_view_state_service.dart';
|
||||
import 'package:meshcore_open/storage/prefs_manager.dart';
|
||||
import 'package:meshcore_open/theme/mesh_theme.dart';
|
||||
import 'package:meshcore_open/widgets/chat_background.dart';
|
||||
import 'package:meshcore_open/widgets/chat_composer.dart';
|
||||
import 'package:meshcore_open/widgets/message_bubble_frame.dart';
|
||||
|
||||
final _l10n = lookupAppLocalizations(const Locale('en'));
|
||||
|
||||
/// Both chat screens show the same composer, as the footer of the chat
|
||||
/// background, and the channel reply preview sits inside its bubble.
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
final tempDir = Directory.systemTemp.createTempSync('chat_composer_test');
|
||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||
.setMockMethodCallHandler(
|
||||
const MethodChannel('plugins.flutter.io/path_provider'),
|
||||
(call) async => tempDir.path,
|
||||
);
|
||||
|
||||
setUpAll(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
PrefsManager.reset();
|
||||
await PrefsManager.initialize();
|
||||
});
|
||||
|
||||
Finder composerIn(Type screen) => find.descendant(
|
||||
of: find.descendant(
|
||||
of: find.byType(screen),
|
||||
matching: find.byType(ChatBackdrop),
|
||||
),
|
||||
matching: find.byType(ChatComposer),
|
||||
);
|
||||
|
||||
testWidgets('DM chat shows the redesigned composer', (tester) async {
|
||||
final (connector, providers) = _shared ??= await _connect(tester);
|
||||
final contact = connector.contacts.firstWhere((c) => c.type == advTypeChat);
|
||||
await _pump(tester, providers, ChatScreen(contact: contact));
|
||||
|
||||
expect(composerIn(ChatScreen), findsOneWidget);
|
||||
expect(find.byTooltip(_l10n.chat_selectSendAction), findsOneWidget);
|
||||
expect(find.byIcon(Icons.add_circle_outline), findsNothing);
|
||||
|
||||
await tester.enterText(find.byType(TextField), 'hello');
|
||||
await _settle(tester);
|
||||
expect(find.byTooltip(_l10n.chat_selectSendAction), findsNothing);
|
||||
expect(find.byTooltip(_l10n.chat_sendMessageTo(contact.name)), findsOne);
|
||||
await _tearDown(tester);
|
||||
});
|
||||
|
||||
testWidgets('channel chat shows the same composer with the reply preview '
|
||||
'inside the bubble', (tester) async {
|
||||
final (connector, providers) = _shared ??= await _connect(tester);
|
||||
final channel = connector.channels[0];
|
||||
await _pump(tester, providers, ChannelChatScreen(channel: channel));
|
||||
|
||||
expect(composerIn(ChannelChatScreen), findsOneWidget);
|
||||
expect(find.byTooltip(_l10n.chat_selectSendAction), findsOneWidget);
|
||||
expect(find.byType(ChatComposerQuote), findsNothing);
|
||||
|
||||
final incoming = connector
|
||||
.getChannelMessages(channel)
|
||||
.lastWhere((m) => !m.isOutgoing);
|
||||
final bubble = find.ancestor(
|
||||
of: find.textContaining(incoming.text, findRichText: true),
|
||||
matching: find.byType(MessageBubbleFrame),
|
||||
);
|
||||
await tester.longPressAt(tester.getTopLeft(bubble) + const Offset(4, 4));
|
||||
await _settle(tester);
|
||||
await tester.tap(find.text(_l10n.chat_reply));
|
||||
await _settle(tester);
|
||||
|
||||
final quote = find.byType(ChatComposerQuote);
|
||||
expect(
|
||||
find.descendant(of: find.byKey(ChatComposer.bubbleKey), matching: quote),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text(_l10n.chat_replyingTo(incoming.senderName)), findsOne);
|
||||
|
||||
await tester.tap(find.byTooltip(_l10n.chat_cancelReply));
|
||||
await _settle(tester);
|
||||
expect(quote, findsNothing);
|
||||
await _tearDown(tester);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _pump(
|
||||
WidgetTester tester,
|
||||
List<SingleChildWidget> providers,
|
||||
Widget home,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
MultiProvider(
|
||||
providers: providers,
|
||||
child: MaterialApp(
|
||||
theme: MeshTheme.light(),
|
||||
locale: const Locale('en'),
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: home,
|
||||
),
|
||||
),
|
||||
);
|
||||
await _settle(tester);
|
||||
}
|
||||
|
||||
Future<void> _settle(WidgetTester tester) async {
|
||||
for (var i = 0; i < 10; i++) {
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _tearDown(WidgetTester tester) async {
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
await tester.pump(const Duration(minutes: 1));
|
||||
}
|
||||
|
||||
/// One review-radio connection shared by the tests.
|
||||
(MeshCoreConnector, List<SingleChildWidget>)? _shared;
|
||||
|
||||
Future<(MeshCoreConnector, List<SingleChildWidget>)> _connect(
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
final storage = StorageService();
|
||||
final connector = MeshCoreConnector();
|
||||
final retry = MessageRetryService();
|
||||
final settings = AppSettingsService();
|
||||
final translation = TranslationService(settings);
|
||||
await tester.runAsync(() async {
|
||||
await settings.loadSettings();
|
||||
connector.initialize(
|
||||
retryService: retry,
|
||||
pathHistoryService: PathHistoryService(storage),
|
||||
appSettingsService: settings,
|
||||
translationService: translation,
|
||||
);
|
||||
connector.reviewRadioFactoryForTest = () => ReviewRadio(
|
||||
scheduledMessageInterval: const Duration(hours: 1),
|
||||
ackDelay: const Duration(hours: 1),
|
||||
replyDelay: const Duration(hours: 1),
|
||||
);
|
||||
await connector.connectReview();
|
||||
final end = DateTime.now().add(const Duration(seconds: 8));
|
||||
while ((connector.contacts.isEmpty || connector.channels.isEmpty) &&
|
||||
DateTime.now().isBefore(end)) {
|
||||
await Future<void>.delayed(const Duration(milliseconds: 25));
|
||||
}
|
||||
});
|
||||
expect(connector.channels, isNotEmpty);
|
||||
|
||||
return (
|
||||
connector,
|
||||
<SingleChildWidget>[
|
||||
ChangeNotifierProvider.value(value: connector),
|
||||
ChangeNotifierProvider.value(value: retry),
|
||||
ChangeNotifierProvider.value(value: PathHistoryService(storage)),
|
||||
ChangeNotifierProvider.value(value: settings),
|
||||
ChangeNotifierProvider.value(value: BleDebugLogService()),
|
||||
ChangeNotifierProvider.value(value: AppDebugLogService()),
|
||||
ChangeNotifierProvider.value(value: ChatTextScaleService()),
|
||||
ChangeNotifierProvider.value(value: translation),
|
||||
ChangeNotifierProvider.value(value: UiViewStateService()),
|
||||
Provider.value(value: storage),
|
||||
ChangeNotifierProvider.value(
|
||||
value: MapTileCacheService(appSettingsService: settings),
|
||||
),
|
||||
ChangeNotifierProvider.value(value: TimeoutPredictionService(storage)),
|
||||
ChangeNotifierProvider.value(value: ImageCodecService(settings)),
|
||||
ChangeNotifierProvider.value(value: ReceivedImageStore()),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,356 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_protocol.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations.dart';
|
||||
import 'package:meshcore_open/models/channel.dart';
|
||||
import 'package:meshcore_open/models/channel_message.dart';
|
||||
import 'package:meshcore_open/models/contact.dart';
|
||||
import 'package:meshcore_open/screens/channels_screen.dart';
|
||||
import 'package:meshcore_open/screens/contacts_screen.dart';
|
||||
import 'package:meshcore_open/services/app_settings_service.dart';
|
||||
import 'package:meshcore_open/services/ui_view_state_service.dart';
|
||||
import 'package:meshcore_open/storage/prefs_manager.dart';
|
||||
import 'package:meshcore_open/theme/mesh_theme.dart';
|
||||
import 'package:meshcore_open/widgets/mesh_ui.dart';
|
||||
|
||||
/// Repeatable stand-in for profiling rapid scrolling on a phone: builds the
|
||||
/// contacts list with 500 contacts and the channels list with 40 channels,
|
||||
/// flings each list, and counts widget builds and rows that are not fully
|
||||
/// drawn while scrolling. Run with `flutter test
|
||||
/// test/screens/list_scroll_perf_test.dart` and read the printed lines.
|
||||
/// See documentation/performance-profiling.md for the on-device check.
|
||||
|
||||
const _contactCount = 500;
|
||||
const _channelCount = 40;
|
||||
|
||||
class _Connector extends MeshCoreConnector {
|
||||
List<Contact> nodes = [];
|
||||
List<Channel> slots = [];
|
||||
final Map<String, int> unread = {};
|
||||
final Map<int, ChannelMessage> latest = {};
|
||||
|
||||
@override
|
||||
List<Contact> get contacts => List.unmodifiable(nodes);
|
||||
|
||||
@override
|
||||
List<Channel> get channels => List.unmodifiable(slots);
|
||||
|
||||
@override
|
||||
int getUnreadCountForContact(Contact contact) =>
|
||||
unread[contact.publicKeyHex] ?? 0;
|
||||
|
||||
@override
|
||||
int getUnreadCountForChannel(Channel channel) => channel.unreadCount;
|
||||
|
||||
@override
|
||||
ChannelMessage? latestVisibleChannelMessage(Channel channel) =>
|
||||
latest[channel.index];
|
||||
|
||||
@override
|
||||
Future<void> getChannels({int? maxChannels, bool force = false}) async {}
|
||||
}
|
||||
|
||||
Contact _contact(int i, DateTime now) {
|
||||
final key = Uint8List(32)
|
||||
..[0] = i >> 8
|
||||
..[1] = i & 0xff
|
||||
..[2] = 0x5a;
|
||||
final type = i % 10 == 0
|
||||
? advTypeRepeater
|
||||
: i % 25 == 0
|
||||
? advTypeRoom
|
||||
: advTypeChat;
|
||||
return Contact(
|
||||
publicKey: key,
|
||||
name: 'Node ${i.toString().padLeft(3, '0')}',
|
||||
type: type,
|
||||
pathLength: i % 4,
|
||||
path: Uint8List.fromList(List.filled(i % 4, i & 0xff)),
|
||||
latitude: i.isEven ? 35.0 : null,
|
||||
longitude: i.isEven ? -112.0 : null,
|
||||
lastSeen: now.subtract(Duration(minutes: i * 7)),
|
||||
);
|
||||
}
|
||||
|
||||
/// Counts element builds per widget type, via the framework's debug hook.
|
||||
class _BuildCounter {
|
||||
final Map<String, int> counts = {};
|
||||
|
||||
void start() {
|
||||
counts.clear();
|
||||
debugOnRebuildDirtyWidget = (element, _) {
|
||||
final name = element.widget.runtimeType.toString();
|
||||
counts[name] = (counts[name] ?? 0) + 1;
|
||||
};
|
||||
}
|
||||
|
||||
void stop() => debugOnRebuildDirtyWidget = null;
|
||||
|
||||
int operator [](String type) => counts[type] ?? 0;
|
||||
int get total => counts.values.fold(0, (a, b) => a + b);
|
||||
}
|
||||
|
||||
/// Rows inside the visible list area whose entrance fade has not finished:
|
||||
/// they are blank or partly transparent while the user scrolls.
|
||||
int _rowsNotFullyDrawn(WidgetTester tester, Rect viewport) {
|
||||
final fades = find.descendant(
|
||||
of: find.byType(ListEntrance),
|
||||
matching: find.byType(FadeTransition),
|
||||
);
|
||||
var count = 0;
|
||||
for (final element in fades.evaluate()) {
|
||||
final fade = element.widget as FadeTransition;
|
||||
final box = element.renderObject as RenderBox?;
|
||||
if (box == null || !box.attached || !box.hasSize) continue;
|
||||
final rect = box.localToGlobal(Offset.zero) & box.size;
|
||||
if (!rect.overlaps(viewport)) continue;
|
||||
if (fade.opacity.value < 1) count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
class _ScrollResult {
|
||||
int frames = 0;
|
||||
int notFullyDrawnRowFrames = 0;
|
||||
int maxNotFullyDrawn = 0;
|
||||
int notFullyDrawnAfterStop = 0;
|
||||
}
|
||||
|
||||
/// Flings [list] like a rapid swipe and pumps 60 Hz frames until the list
|
||||
/// stops, firing a connector notify partway through.
|
||||
Future<_ScrollResult> _fling(
|
||||
WidgetTester tester,
|
||||
Finder list,
|
||||
_Connector connector, {
|
||||
required Offset offset,
|
||||
}) async {
|
||||
final viewport = tester.getRect(list);
|
||||
final position = tester.state<ScrollableState>(
|
||||
find.descendant(of: list, matching: find.byType(Scrollable)).first,
|
||||
);
|
||||
final result = _ScrollResult();
|
||||
await tester.fling(list, offset, 6000);
|
||||
for (var i = 0; i < 400; i++) {
|
||||
if (i == 10) connector.notifyListeners();
|
||||
await tester.pump(const Duration(milliseconds: 16));
|
||||
result.frames++;
|
||||
final hidden = _rowsNotFullyDrawn(tester, viewport);
|
||||
result.notFullyDrawnRowFrames += hidden;
|
||||
if (hidden > result.maxNotFullyDrawn) result.maxNotFullyDrawn = hidden;
|
||||
if (i > 12 && !position.position.isScrollingNotifier.value) break;
|
||||
}
|
||||
result.notFullyDrawnAfterStop = _rowsNotFullyDrawn(tester, viewport);
|
||||
return result;
|
||||
}
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
late _Connector connector;
|
||||
late AppSettingsService settings;
|
||||
late UiViewStateService viewState;
|
||||
final counter = _BuildCounter();
|
||||
|
||||
setUp(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
PrefsManager.reset();
|
||||
await PrefsManager.initialize();
|
||||
connector = _Connector();
|
||||
settings = AppSettingsService();
|
||||
viewState = UiViewStateService();
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
counter.stop();
|
||||
connector.dispose();
|
||||
settings.dispose();
|
||||
viewState.dispose();
|
||||
});
|
||||
|
||||
/// Opens [home] and returns how many rows played the entrance animation.
|
||||
Future<int> open(WidgetTester tester, Widget home) async {
|
||||
tester.view.physicalSize = const Size(1080, 2340);
|
||||
tester.view.devicePixelRatio = 3;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider<MeshCoreConnector>.value(value: connector),
|
||||
ChangeNotifierProvider.value(value: settings),
|
||||
ChangeNotifierProvider.value(value: viewState),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: MeshTheme.light(),
|
||||
locale: const Locale('en'),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: home,
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
final animatedRows = find
|
||||
.descendant(
|
||||
of: find.byType(ListEntrance),
|
||||
matching: find.byType(FadeTransition),
|
||||
)
|
||||
.evaluate()
|
||||
.length;
|
||||
// Let the first screen's entrance animations finish.
|
||||
for (var i = 0; i < 40; i++) {
|
||||
await tester.pump(const Duration(milliseconds: 16));
|
||||
}
|
||||
return animatedRows;
|
||||
}
|
||||
|
||||
Future<void> notifyAndSettle(WidgetTester tester) async {
|
||||
connector.notifyListeners();
|
||||
await tester.pump(const Duration(milliseconds: 60));
|
||||
await tester.pump();
|
||||
}
|
||||
|
||||
Future<void> close(WidgetTester tester) async {
|
||||
counter.stop();
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
// Drain entrance-delay timers.
|
||||
await tester.pump(const Duration(seconds: 1));
|
||||
}
|
||||
|
||||
testWidgets('contacts list: rapid fling with 500 contacts', (tester) async {
|
||||
final now = DateTime.now();
|
||||
connector.nodes = [
|
||||
for (var i = 0; i < _contactCount; i++) _contact(i, now),
|
||||
];
|
||||
for (var i = 1; i < _contactCount; i += 9) {
|
||||
connector.unread[connector.nodes[i].publicKeyHex] = i % 5 + 1;
|
||||
}
|
||||
final animatedRows = await open(tester, const ContactsScreen());
|
||||
final list = find.byType(ListView);
|
||||
expect(list, findsOneWidget);
|
||||
|
||||
counter.start();
|
||||
final down = await _fling(
|
||||
tester,
|
||||
list,
|
||||
connector,
|
||||
offset: const Offset(0, -2500),
|
||||
);
|
||||
final flingBuilds = Map.of(counter.counts);
|
||||
final flingTotal = counter.total;
|
||||
|
||||
counter.start();
|
||||
await notifyAndSettle(tester);
|
||||
final notifyTiles = counter['_ContactTile'];
|
||||
final notifyTotal = counter.total;
|
||||
|
||||
// A live change still reaches the visible tile.
|
||||
final visible = tester
|
||||
.widgetList(
|
||||
find.byWidgetPredicate(
|
||||
(w) => w.runtimeType.toString() == '_ContactTile',
|
||||
),
|
||||
)
|
||||
.map((w) => (w as dynamic).contact as Contact)
|
||||
.toList();
|
||||
final target = visible[visible.length ~/ 2];
|
||||
connector.unread[target.publicKeyHex] = 42;
|
||||
counter.start();
|
||||
await notifyAndSettle(tester);
|
||||
final changeTiles = counter['_ContactTile'];
|
||||
expect(find.text('42'), findsOneWidget);
|
||||
|
||||
// So does a replaced contact.
|
||||
final renamedAt = connector.nodes.indexOf(visible.first);
|
||||
connector.nodes = List.of(connector.nodes)
|
||||
..[renamedAt] = visible.first.copyWith(name: 'Renamed node');
|
||||
await notifyAndSettle(tester);
|
||||
expect(find.text('Renamed node'), findsOneWidget);
|
||||
|
||||
// ignore: avoid_print
|
||||
print(
|
||||
'[list-perf] contacts fling: frames=${down.frames} '
|
||||
'itemBuilds=${flingBuilds['_ContactTileEntrance'] ?? 0} '
|
||||
'tileBuilds=${flingBuilds['_ContactTile'] ?? 0} '
|
||||
'entranceBuilds=${flingBuilds['ListEntrance'] ?? 0} '
|
||||
'allBuilds=$flingTotal '
|
||||
'rowFramesNotFullyDrawn=${down.notFullyDrawnRowFrames} '
|
||||
'maxRowsNotFullyDrawn=${down.maxNotFullyDrawn} '
|
||||
'rowsNotFullyDrawnAtStop=${down.notFullyDrawnAfterStop}\n'
|
||||
'[list-perf] contacts notify (no change): tileBuilds=$notifyTiles '
|
||||
'allBuilds=$notifyTotal; one unread change: tileBuilds=$changeTiles',
|
||||
);
|
||||
|
||||
// The first screen still animates in; rows a fling brings in do not.
|
||||
expect(animatedRows, greaterThan(0));
|
||||
expect(down.notFullyDrawnRowFrames, 0);
|
||||
// A notify that changes nothing rebuilds no rows; a change rebuilds one.
|
||||
expect(notifyTiles, 0);
|
||||
expect(changeTiles, 1);
|
||||
|
||||
await close(tester);
|
||||
});
|
||||
|
||||
testWidgets('channels list: rapid fling with 40 channels', (tester) async {
|
||||
final now = DateTime.now();
|
||||
connector.slots = [
|
||||
for (var i = 0; i < _channelCount; i++)
|
||||
Channel(
|
||||
index: i,
|
||||
name: i == 0 ? 'Public' : '#topic-$i',
|
||||
psk: Uint8List.fromList(List.filled(16, i + 1)),
|
||||
unreadCount: i % 3 == 0 ? i : 0,
|
||||
),
|
||||
];
|
||||
for (var i = 0; i < _channelCount; i++) {
|
||||
connector.latest[i] = ChannelMessage(
|
||||
senderName: 'Sender $i',
|
||||
text: 'Message preview number $i on the mesh',
|
||||
timestamp: now.subtract(Duration(minutes: i * 13)),
|
||||
isOutgoing: false,
|
||||
status: ChannelMessageStatus.sent,
|
||||
channelIndex: i,
|
||||
);
|
||||
}
|
||||
viewState.setChannelsSortOption(ChannelSortOption.name);
|
||||
final animatedRows = await open(tester, const ChannelsScreen());
|
||||
final list = find.byType(ListView);
|
||||
expect(list, findsOneWidget);
|
||||
|
||||
counter.start();
|
||||
final down = await _fling(
|
||||
tester,
|
||||
list,
|
||||
connector,
|
||||
offset: const Offset(0, -2500),
|
||||
);
|
||||
final flingBuilds = Map.of(counter.counts);
|
||||
final flingTotal = counter.total;
|
||||
|
||||
counter.start();
|
||||
await notifyAndSettle(tester);
|
||||
final notifyTiles = counter['MeshCard'];
|
||||
|
||||
// ignore: avoid_print
|
||||
print(
|
||||
'[list-perf] channels fling: frames=${down.frames} '
|
||||
'itemBuilds=${flingBuilds['ListEntrance'] ?? 0} '
|
||||
'cardBuilds=${flingBuilds['MeshCard'] ?? 0} '
|
||||
'allBuilds=$flingTotal '
|
||||
'rowFramesNotFullyDrawn=${down.notFullyDrawnRowFrames} '
|
||||
'maxRowsNotFullyDrawn=${down.maxNotFullyDrawn} '
|
||||
'rowsNotFullyDrawnAtStop=${down.notFullyDrawnAfterStop}\n'
|
||||
'[list-perf] channels notify (no change): cardBuilds=$notifyTiles',
|
||||
);
|
||||
|
||||
expect(animatedRows, greaterThan(0));
|
||||
expect(down.notFullyDrawnRowFrames, 0);
|
||||
|
||||
await close(tester);
|
||||
});
|
||||
}
|
||||
@@ -34,13 +34,17 @@ import 'package:meshcore_open/services/timeout_prediction_service.dart';
|
||||
import 'package:meshcore_open/services/translation_service.dart';
|
||||
import 'package:meshcore_open/services/ui_view_state_service.dart';
|
||||
import 'package:meshcore_open/storage/channel_message_store.dart';
|
||||
import 'package:meshcore_open/storage/channel_settings_store.dart';
|
||||
import 'package:meshcore_open/storage/contact_settings_store.dart';
|
||||
import 'package:meshcore_open/storage/channel_store.dart';
|
||||
import 'package:meshcore_open/storage/contact_store.dart';
|
||||
import 'package:meshcore_open/storage/last_radio_store.dart';
|
||||
import 'package:meshcore_open/storage/message_store.dart';
|
||||
import 'package:meshcore_open/storage/prefs_manager.dart';
|
||||
import 'package:meshcore_open/theme/mesh_theme.dart';
|
||||
import 'package:meshcore_open/widgets/chat_background.dart';
|
||||
import 'package:meshcore_open/widgets/chat_composer.dart';
|
||||
import 'package:meshcore_open/widgets/chat_compression_selector.dart';
|
||||
import 'package:meshcore_open/widgets/connect_sheet.dart';
|
||||
|
||||
final _radioKey = Uint8List.fromList(List<int>.generate(32, (i) => 0xA0 + i));
|
||||
@@ -344,4 +348,246 @@ void main() {
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
await tester.pump(const Duration(minutes: 1));
|
||||
});
|
||||
|
||||
group('compression selector', () {
|
||||
Future<void> choose(WidgetTester tester, String mode) async {
|
||||
await tester.tap(find.byType(ChatCompressionSelector));
|
||||
await _settle(tester);
|
||||
await tester.tap(find.text(mode));
|
||||
await _settle(tester);
|
||||
// Connector notifications are debounced on a real timer.
|
||||
await tester.runAsync(
|
||||
() => Future<void>.delayed(const Duration(milliseconds: 200)),
|
||||
);
|
||||
await _settle(tester);
|
||||
}
|
||||
|
||||
testWidgets('DM chat shows it at the top and saves offline', (
|
||||
tester,
|
||||
) async {
|
||||
final connector = await _offlineConnector(tester);
|
||||
final alice = connector.contacts.single;
|
||||
final store = ContactSettingsStore()..setPublicKeyHex = _radioHex;
|
||||
await tester.pumpWidget(
|
||||
await _app(tester, connector, ChatScreen(contact: alice)),
|
||||
);
|
||||
await _settle(tester);
|
||||
|
||||
expect(find.byType(ChatCompressionSelector), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_label('Off')), findsOneWidget);
|
||||
// Above the transcript, outside its scroll view.
|
||||
expect(
|
||||
find.ancestor(
|
||||
of: find.byType(ChatCompressionSelector),
|
||||
matching: find.byType(Scrollable),
|
||||
),
|
||||
findsNothing,
|
||||
);
|
||||
expect(
|
||||
tester.getBottomLeft(find.byType(ChatCompressionSelector)).dy,
|
||||
lessThanOrEqualTo(tester.getTopLeft(find.byType(ChatBackdrop)).dy),
|
||||
);
|
||||
|
||||
await choose(tester, _l10n.chatCompression_smaz);
|
||||
expect(find.text(_l10n.chatCompression_label('SMAZ')), findsOneWidget);
|
||||
expect(
|
||||
await tester.runAsync(() => store.loadSmazEnabled(alice.publicKeyHex)),
|
||||
isTrue,
|
||||
);
|
||||
|
||||
await choose(tester, _l10n.chatCompression_cyr2lat);
|
||||
// Cyr2Lat keeps the sheet open for its profile picker.
|
||||
await tester.tap(find.byTooltip('Close'));
|
||||
await _settle(tester);
|
||||
expect(find.text(_l10n.chatCompression_label('Cyr2Lat')), findsOneWidget);
|
||||
expect(
|
||||
connector.contactCompressionMode(alice.publicKeyHex),
|
||||
ChatCompressionMode.cyr2lat,
|
||||
);
|
||||
expect(
|
||||
await tester.runAsync(() => store.loadSmazEnabled(alice.publicKeyHex)),
|
||||
isFalse,
|
||||
);
|
||||
expect(
|
||||
await tester.runAsync(
|
||||
() => store.loadCyr2LatEnabled(alice.publicKeyHex),
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
|
||||
// The settings dialog no longer carries the compression switches.
|
||||
await tester.tap(find.byIcon(Icons.more_vert));
|
||||
await _settle(tester);
|
||||
await tester.tap(find.text(_l10n.contact_settings).last);
|
||||
await _settle(tester);
|
||||
expect(find.byType(AlertDialog), findsOneWidget);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byType(AlertDialog),
|
||||
matching: find.textContaining(RegExp('SMAZ|Cyr2Lat')),
|
||||
),
|
||||
findsNothing,
|
||||
);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('channel chat uses the same selector and saves offline', (
|
||||
tester,
|
||||
) async {
|
||||
final connector = await _offlineConnector(tester);
|
||||
final channel = connector.channels.single;
|
||||
final store = ChannelSettingsStore()..setPublicKeyHex = _radioHex;
|
||||
await tester.pumpWidget(
|
||||
await _app(tester, connector, ChannelChatScreen(channel: channel)),
|
||||
);
|
||||
await _settle(tester);
|
||||
|
||||
expect(find.byType(ChatCompressionSelector), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_label('Off')), findsOneWidget);
|
||||
|
||||
await choose(tester, _l10n.chatCompression_smaz);
|
||||
expect(find.text(_l10n.chatCompression_label('SMAZ')), findsOneWidget);
|
||||
expect(
|
||||
await tester.runAsync(() => store.loadSmazEnabled(channel.storageId!)),
|
||||
isTrue,
|
||||
);
|
||||
expect(
|
||||
await tester.runAsync(
|
||||
() => store.loadCyr2LatEnabled(channel.storageId!),
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('saving the channel edit sheet leaves compression alone', (
|
||||
tester,
|
||||
) async {
|
||||
final connector = MeshCoreConnector();
|
||||
addTearDown(connector.dispose);
|
||||
connector.reviewRadioFactoryForTest = () => ReviewRadio(
|
||||
scheduledMessageInterval: const Duration(hours: 1),
|
||||
ackDelay: const Duration(hours: 1),
|
||||
replyDelay: const Duration(hours: 1),
|
||||
);
|
||||
await tester.runAsync(connector.connectReview);
|
||||
await _waitFor(tester, () => connector.channelMapConfirmed);
|
||||
final channel = connector.channels.firstWhere((c) => c.index == 1);
|
||||
await tester.runAsync(
|
||||
() => connector.setChannelCompressionMode(1, ChatCompressionMode.smaz),
|
||||
);
|
||||
|
||||
await tester.pumpWidget(
|
||||
await _app(
|
||||
tester,
|
||||
connector,
|
||||
Builder(
|
||||
builder: (context) => Scaffold(
|
||||
body: Center(
|
||||
child: TextButton(
|
||||
onPressed: () =>
|
||||
showEditChannelSheet(context, connector, channel),
|
||||
child: const Text('edit'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.tap(find.text('edit'));
|
||||
await _settle(tester);
|
||||
expect(find.text('SMAZ compression'), findsNothing);
|
||||
|
||||
// The chat's selector changes the mode while the sheet is open.
|
||||
await tester.runAsync(
|
||||
() =>
|
||||
connector.setChannelCompressionMode(1, ChatCompressionMode.cyr2lat),
|
||||
);
|
||||
await tester.enterText(find.byType(TextField).first, 'Hiking Crew');
|
||||
await tester.tap(find.text(_l10n.common_save));
|
||||
await tester.runAsync(
|
||||
() => Future<void>.delayed(const Duration(milliseconds: 500)),
|
||||
);
|
||||
await _settle(tester);
|
||||
|
||||
expect(
|
||||
connector.channels.firstWhere((c) => c.index == 1).name,
|
||||
'Hiking Crew',
|
||||
);
|
||||
expect(connector.channelCompressionMode(1), ChatCompressionMode.cyr2lat);
|
||||
|
||||
await tester.runAsync(connector.disconnect);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
await tester.pump(const Duration(minutes: 1));
|
||||
});
|
||||
|
||||
testWidgets('a new PSK in the channel edit sheet keeps compression', (
|
||||
tester,
|
||||
) async {
|
||||
final connector = MeshCoreConnector();
|
||||
addTearDown(connector.dispose);
|
||||
connector.reviewRadioFactoryForTest = () => ReviewRadio(
|
||||
scheduledMessageInterval: const Duration(hours: 1),
|
||||
ackDelay: const Duration(hours: 1),
|
||||
replyDelay: const Duration(hours: 1),
|
||||
);
|
||||
await tester.runAsync(connector.connectReview);
|
||||
await _waitFor(tester, () => connector.channelMapConfirmed);
|
||||
final channel = connector.channels.firstWhere((c) => c.index == 1);
|
||||
final oldId = connector.channelIdForSlot(1);
|
||||
await tester.runAsync(
|
||||
() => connector.setChannelCompressionMode(1, ChatCompressionMode.smaz),
|
||||
);
|
||||
|
||||
await tester.pumpWidget(
|
||||
await _app(
|
||||
tester,
|
||||
connector,
|
||||
Builder(
|
||||
builder: (context) => Scaffold(
|
||||
body: Center(
|
||||
child: TextButton(
|
||||
onPressed: () =>
|
||||
showEditChannelSheet(context, connector, channel),
|
||||
child: const Text('edit'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.tap(find.text('edit'));
|
||||
await _settle(tester);
|
||||
await tester.enterText(find.byType(TextField).at(1), '0f' * 16);
|
||||
await tester.tap(find.text(_l10n.common_save));
|
||||
// The save runs in the test zone and waits on the radio's real I/O.
|
||||
for (var i = 0; i < 40; i++) {
|
||||
await tester.runAsync(
|
||||
() => Future<void>.delayed(const Duration(milliseconds: 50)),
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
if (find
|
||||
.text(_l10n.channels_channelUpdated(channel.name))
|
||||
.evaluate()
|
||||
.isNotEmpty) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
await _settle(tester);
|
||||
|
||||
final newId = connector.channelIdForSlot(1);
|
||||
expect(newId, isNot(oldId));
|
||||
expect(connector.channelCompressionMode(1), ChatCompressionMode.smaz);
|
||||
final store = ChannelSettingsStore()
|
||||
..setPublicKeyHex = connector.selfPublicKeyHex;
|
||||
expect(
|
||||
await tester.runAsync(() => store.loadSmazEnabled(newId!)),
|
||||
isTrue,
|
||||
);
|
||||
|
||||
await tester.runAsync(connector.disconnect);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
await tester.pump(const Duration(minutes: 1));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,456 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_protocol.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations.dart';
|
||||
import 'package:meshcore_open/models/channel.dart';
|
||||
import 'package:meshcore_open/models/channel_message.dart';
|
||||
import 'package:meshcore_open/models/contact.dart';
|
||||
import 'package:meshcore_open/models/message.dart';
|
||||
import 'package:meshcore_open/screens/channels_screen.dart';
|
||||
import 'package:meshcore_open/screens/chat_screen.dart';
|
||||
import 'package:meshcore_open/screens/contacts_screen.dart';
|
||||
import 'package:meshcore_open/services/app_debug_log_service.dart';
|
||||
import 'package:meshcore_open/services/app_settings_service.dart';
|
||||
import 'package:meshcore_open/services/ble_debug_log_service.dart';
|
||||
import 'package:meshcore_open/services/chat_text_scale_service.dart';
|
||||
import 'package:meshcore_open/services/image_codec_service.dart';
|
||||
import 'package:meshcore_open/services/map_tile_cache_service.dart';
|
||||
import 'package:meshcore_open/services/message_filter/message_filter_service.dart';
|
||||
import 'package:meshcore_open/services/message_retry_service.dart';
|
||||
import 'package:meshcore_open/services/network_map/network_map_upload_service.dart';
|
||||
import 'package:meshcore_open/services/path_history_service.dart';
|
||||
import 'package:meshcore_open/services/received_image_store.dart';
|
||||
import 'package:meshcore_open/services/storage_service.dart';
|
||||
import 'package:meshcore_open/services/timeout_prediction_service.dart';
|
||||
import 'package:meshcore_open/services/translation_service.dart';
|
||||
import 'package:meshcore_open/services/ui_view_state_service.dart';
|
||||
import 'package:meshcore_open/storage/channel_message_store.dart';
|
||||
import 'package:meshcore_open/storage/channel_store.dart';
|
||||
import 'package:meshcore_open/storage/contact_store.dart';
|
||||
import 'package:meshcore_open/storage/last_radio_store.dart';
|
||||
import 'package:meshcore_open/storage/message_store.dart';
|
||||
import 'package:meshcore_open/storage/prefs_manager.dart';
|
||||
import 'package:meshcore_open/theme/mesh_theme.dart';
|
||||
import 'package:meshcore_open/utils/contact_filter_types.dart';
|
||||
|
||||
final _radioKey = Uint8List.fromList(List<int>.generate(32, (i) => 0xA0 + i));
|
||||
final _radioHex = pubKeyToHex(_radioKey);
|
||||
|
||||
Uint8List _key(int seed) =>
|
||||
Uint8List.fromList(List<int>.generate(32, (i) => seed + i));
|
||||
Uint8List _psk(int seed) =>
|
||||
Uint8List.fromList(List<int>.generate(16, (i) => seed + i));
|
||||
|
||||
/// Local arrival times, an hour apart. Sender clocks are set far off them.
|
||||
final _base = DateTime(2026, 11, 20, 12);
|
||||
DateTime _arrived(int hours) => _base.add(Duration(hours: hours));
|
||||
final _farFuture = DateTime(2099);
|
||||
final _farPast = DateTime(2001);
|
||||
|
||||
ChannelMessage _channelMessage(
|
||||
int slot,
|
||||
String text, {
|
||||
required DateTime sentAt,
|
||||
required DateTime receivedAt,
|
||||
String? filterReason,
|
||||
}) => ChannelMessage(
|
||||
senderName: 'Bob',
|
||||
text: text,
|
||||
timestamp: sentAt,
|
||||
receivedAt: receivedAt,
|
||||
isOutgoing: false,
|
||||
status: ChannelMessageStatus.sent,
|
||||
channelIndex: slot,
|
||||
filterReason: filterReason,
|
||||
);
|
||||
|
||||
Message _directMessage(
|
||||
Uint8List senderKey,
|
||||
String text, {
|
||||
required DateTime sentAt,
|
||||
required DateTime receivedAt,
|
||||
}) => Message(
|
||||
senderKey: senderKey,
|
||||
text: text,
|
||||
timestamp: sentAt,
|
||||
receivedAt: receivedAt,
|
||||
isOutgoing: false,
|
||||
status: MessageStatus.delivered,
|
||||
);
|
||||
|
||||
/// Seeds the remembered radio with channels (slots in map order) and
|
||||
/// contacts, each with its saved messages.
|
||||
Future<void> _seed({
|
||||
Map<String, List<ChannelMessage> Function(int slot)> channelMessages =
|
||||
const {},
|
||||
Map<String, List<Message> Function(Uint8List key)> contactMessages = const {},
|
||||
}) async {
|
||||
final channelStore = ChannelStore()..setPublicKeyHex = _radioHex;
|
||||
final messageStore = ChannelMessageStore()..setPublicKeyHex = _radioHex;
|
||||
final channels = <Channel>[];
|
||||
var slot = 0;
|
||||
for (final entry in channelMessages.entries) {
|
||||
final channel = Channel(index: slot, name: entry.key, psk: _psk(slot * 16));
|
||||
channels.add(channel);
|
||||
await messageStore.saveChannelMessages(
|
||||
channel.storageId!,
|
||||
entry.value(slot),
|
||||
);
|
||||
slot++;
|
||||
}
|
||||
await channelStore.saveChannels(channels);
|
||||
await channelStore.saveSlotChannelIds({
|
||||
for (final c in channels) c.index: c.storageId!,
|
||||
});
|
||||
|
||||
final contacts = <Contact>[];
|
||||
final directStore = MessageStore()..setPublicKeyHex = _radioHex;
|
||||
var seed = 0x10;
|
||||
for (final entry in contactMessages.entries) {
|
||||
final key = _key(seed);
|
||||
seed += 0x20;
|
||||
final contact = Contact(
|
||||
publicKey: key,
|
||||
name: entry.key,
|
||||
type: advTypeChat,
|
||||
pathLength: 1,
|
||||
path: Uint8List.fromList([0x22]),
|
||||
lastSeen: DateTime.fromMillisecondsSinceEpoch(1700000000000),
|
||||
);
|
||||
contacts.add(contact);
|
||||
await directStore.saveMessages(contact.publicKeyHex, entry.value(key));
|
||||
}
|
||||
await (ContactStore()..setPublicKeyHex = _radioHex).saveContacts(contacts);
|
||||
|
||||
await LastRadioStore().save(
|
||||
LastRadio(
|
||||
publicKeyHex: _radioHex,
|
||||
name: 'Base',
|
||||
transport: LastRadio.transportBle,
|
||||
bleRemoteId: 'AA:BB:CC:DD:EE:FF',
|
||||
savedAt: DateTime.fromMillisecondsSinceEpoch(1700000000000),
|
||||
),
|
||||
);
|
||||
ChannelMessageStore().forgetArchive();
|
||||
MessageStore().forgetArchive();
|
||||
}
|
||||
|
||||
/// Restores the seeded radio into a connector that never connects.
|
||||
Future<MeshCoreConnector> _connector(
|
||||
WidgetTester tester, {
|
||||
MessageFilterService? filter,
|
||||
}) async {
|
||||
final connector = MeshCoreConnector();
|
||||
addTearDown(connector.dispose);
|
||||
if (filter != null) {
|
||||
final retry = MessageRetryService();
|
||||
addTearDown(retry.dispose);
|
||||
connector.initialize(
|
||||
retryService: retry,
|
||||
pathHistoryService: PathHistoryService(StorageService()),
|
||||
messageFilterService: filter,
|
||||
);
|
||||
}
|
||||
await tester.runAsync(connector.restoreLastRadio);
|
||||
return connector;
|
||||
}
|
||||
|
||||
Future<void> _pumpScreen(
|
||||
WidgetTester tester,
|
||||
MeshCoreConnector connector,
|
||||
UiViewStateService viewState,
|
||||
Widget home,
|
||||
) async {
|
||||
final storage = StorageService();
|
||||
final settings = AppSettingsService();
|
||||
await tester.runAsync(settings.loadSettings);
|
||||
await tester.pumpWidget(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider.value(value: connector),
|
||||
ChangeNotifierProvider.value(value: MessageRetryService()),
|
||||
ChangeNotifierProvider.value(value: PathHistoryService(storage)),
|
||||
ChangeNotifierProvider.value(value: settings),
|
||||
ChangeNotifierProvider.value(value: BleDebugLogService()),
|
||||
ChangeNotifierProvider.value(value: AppDebugLogService()),
|
||||
ChangeNotifierProvider.value(value: ChatTextScaleService()),
|
||||
ChangeNotifierProvider.value(value: TranslationService(settings)),
|
||||
ChangeNotifierProvider.value(value: viewState),
|
||||
Provider.value(value: storage),
|
||||
ChangeNotifierProvider.value(
|
||||
value: MapTileCacheService(appSettingsService: settings),
|
||||
),
|
||||
ChangeNotifierProvider.value(value: TimeoutPredictionService(storage)),
|
||||
ChangeNotifierProvider.value(value: ImageCodecService(settings)),
|
||||
ChangeNotifierProvider.value(value: ReceivedImageStore()),
|
||||
ChangeNotifierProvider.value(
|
||||
value: NetworkMapUploadService(
|
||||
connector: connector,
|
||||
settings: settings,
|
||||
),
|
||||
),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: MeshTheme.light(),
|
||||
locale: const Locale('en'),
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: home,
|
||||
),
|
||||
),
|
||||
);
|
||||
for (var i = 0; i < 10; i++) {
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
}
|
||||
}
|
||||
|
||||
/// [names] in the order they appear on screen, top to bottom.
|
||||
List<String> _screenOrder(WidgetTester tester, List<String> names) {
|
||||
final top = {
|
||||
for (final name in names) name: tester.getTopLeft(find.text(name).first).dy,
|
||||
};
|
||||
return [...names]..sort((a, b) => top[a]!.compareTo(top[b]!));
|
||||
}
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
final tempDir = Directory.systemTemp.createTempSync('recency_sort_test');
|
||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||
.setMockMethodCallHandler(
|
||||
const MethodChannel('plugins.flutter.io/path_provider'),
|
||||
(call) async => tempDir.path,
|
||||
);
|
||||
|
||||
setUp(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
PrefsManager.reset();
|
||||
await PrefsManager.initialize();
|
||||
ChannelMessageStore().forgetArchive();
|
||||
MessageStore().forgetArchive();
|
||||
});
|
||||
|
||||
Future<void> pumpChannels(
|
||||
WidgetTester tester, {
|
||||
MessageFilterService? filter,
|
||||
}) async {
|
||||
final connector = await _connector(tester, filter: filter);
|
||||
final viewState = UiViewStateService()
|
||||
..setChannelsSortOption(ChannelSortOption.latestMessages);
|
||||
await _pumpScreen(tester, connector, viewState, const ChannelsScreen());
|
||||
}
|
||||
|
||||
Future<void> pumpContacts(WidgetTester tester) async {
|
||||
final connector = await _connector(tester);
|
||||
final viewState = UiViewStateService()
|
||||
..setContactsSortOption(ContactSortOption.recentMessages);
|
||||
await _pumpScreen(tester, connector, viewState, const ContactsScreen());
|
||||
}
|
||||
|
||||
testWidgets('Latest messages sorts channels by local arrival, not sender '
|
||||
'clocks far in the future or past', (tester) async {
|
||||
await _seed(
|
||||
channelMessages: {
|
||||
// Oldest arrival, but the sender's clock is decades ahead.
|
||||
'Future Clock': (slot) => [
|
||||
_channelMessage(
|
||||
slot,
|
||||
'from the future',
|
||||
sentAt: _farFuture,
|
||||
receivedAt: _arrived(0),
|
||||
),
|
||||
],
|
||||
// Newest arrival, but the sender's clock is decades behind.
|
||||
'Past Clock': (slot) => [
|
||||
_channelMessage(
|
||||
slot,
|
||||
'from the past',
|
||||
sentAt: _farPast,
|
||||
receivedAt: _arrived(2),
|
||||
),
|
||||
],
|
||||
'Correct Clock': (slot) => [
|
||||
_channelMessage(
|
||||
slot,
|
||||
'on time',
|
||||
sentAt: _arrived(1),
|
||||
receivedAt: _arrived(1),
|
||||
),
|
||||
],
|
||||
'Quiet': (_) => [],
|
||||
},
|
||||
);
|
||||
await pumpChannels(tester);
|
||||
|
||||
expect(
|
||||
_screenOrder(tester, [
|
||||
'Future Clock',
|
||||
'Past Clock',
|
||||
'Correct Clock',
|
||||
'Quiet',
|
||||
]),
|
||||
['Past Clock', 'Correct Clock', 'Future Clock', 'Quiet'],
|
||||
);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('A newer message hidden by the message filter does not bump '
|
||||
'its channel', (tester) async {
|
||||
await _seed(
|
||||
channelMessages: {
|
||||
'Spammed': (slot) => [
|
||||
_channelMessage(
|
||||
slot,
|
||||
'real message',
|
||||
sentAt: _arrived(0),
|
||||
receivedAt: _arrived(0),
|
||||
),
|
||||
_channelMessage(
|
||||
slot,
|
||||
'buy now',
|
||||
sentAt: _farFuture,
|
||||
receivedAt: _arrived(5),
|
||||
filterReason: 'rule',
|
||||
),
|
||||
],
|
||||
'Normal': (slot) => [
|
||||
_channelMessage(
|
||||
slot,
|
||||
'hello',
|
||||
sentAt: _arrived(1),
|
||||
receivedAt: _arrived(1),
|
||||
),
|
||||
],
|
||||
},
|
||||
);
|
||||
final filter = MessageFilterService();
|
||||
addTearDown(filter.dispose);
|
||||
await tester.runAsync(filter.load);
|
||||
await pumpChannels(tester, filter: filter);
|
||||
|
||||
expect(_screenOrder(tester, ['Spammed', 'Normal']), ['Normal', 'Spammed']);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('Channels with equal arrival times fall back to name order', (
|
||||
tester,
|
||||
) async {
|
||||
List<ChannelMessage> same(int slot) => [
|
||||
_channelMessage(slot, 'tie $slot', sentAt: _farFuture, receivedAt: _base),
|
||||
];
|
||||
await _seed(
|
||||
channelMessages: {'Charlie': same, 'Alpha': same, 'Bravo': same},
|
||||
);
|
||||
await pumpChannels(tester);
|
||||
|
||||
expect(_screenOrder(tester, ['Charlie', 'Alpha', 'Bravo']), [
|
||||
'Alpha',
|
||||
'Bravo',
|
||||
'Charlie',
|
||||
]);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('Recent messages sorts contacts by local arrival, not sender '
|
||||
'clocks far in the future or past', (tester) async {
|
||||
await _seed(
|
||||
contactMessages: {
|
||||
'Fiona': (key) => [
|
||||
_directMessage(
|
||||
key,
|
||||
'from the future',
|
||||
sentAt: _farFuture,
|
||||
receivedAt: _arrived(0),
|
||||
),
|
||||
],
|
||||
'Paul': (key) => [
|
||||
_directMessage(
|
||||
key,
|
||||
'from the past',
|
||||
sentAt: _farPast,
|
||||
receivedAt: _arrived(2),
|
||||
),
|
||||
],
|
||||
'Carl': (key) => [
|
||||
_directMessage(
|
||||
key,
|
||||
'on time',
|
||||
sentAt: _arrived(1),
|
||||
receivedAt: _arrived(1),
|
||||
),
|
||||
],
|
||||
},
|
||||
);
|
||||
await pumpContacts(tester);
|
||||
|
||||
expect(_screenOrder(tester, ['Fiona', 'Paul', 'Carl']), [
|
||||
'Paul',
|
||||
'Carl',
|
||||
'Fiona',
|
||||
]);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('Contacts with equal arrival times fall back to name order', (
|
||||
tester,
|
||||
) async {
|
||||
List<Message> same(Uint8List key) => [
|
||||
_directMessage(key, 'tie', sentAt: _farPast, receivedAt: _base),
|
||||
];
|
||||
await _seed(contactMessages: {'Zed': same, 'Amy': same, 'Mo': same});
|
||||
await pumpContacts(tester);
|
||||
|
||||
expect(_screenOrder(tester, ['Zed', 'Amy', 'Mo']), ['Amy', 'Mo', 'Zed']);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('Contact rows still open after the list was replaced by an '
|
||||
'empty search result', (tester) async {
|
||||
List<Message> none(Uint8List key) => [];
|
||||
await _seed(
|
||||
contactMessages: {
|
||||
'Amy': none,
|
||||
'Ben': none,
|
||||
'Cal': none,
|
||||
'Dee': none,
|
||||
'Eve': none,
|
||||
},
|
||||
);
|
||||
final connector = await _connector(tester);
|
||||
final viewState = UiViewStateService();
|
||||
await _pumpScreen(tester, connector, viewState, const ContactsScreen());
|
||||
expect(find.text('Amy'), findsOneWidget);
|
||||
|
||||
viewState.setContactsSearchText('no such contact');
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Amy'), findsNothing);
|
||||
viewState.setContactsSearchText('');
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.longPress(find.text('Amy'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(find.byType(BottomSheet), findsOneWidget);
|
||||
Navigator.of(tester.element(find.byType(BottomSheet))).pop();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.text('Amy'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(find.byType(ChatScreen), findsOneWidget);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
}
|
||||
@@ -132,6 +132,32 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
test('keeps contact added times out of app settings', () async {
|
||||
SharedPreferences.setMockInitialValues({
|
||||
'app_settings': jsonEncode({'theme_mode': 'dark'}),
|
||||
'contact_added_at_0011223344': jsonEncode({'aa': 1}),
|
||||
});
|
||||
PrefsManager.reset();
|
||||
await PrefsManager.initialize();
|
||||
addTearDown(PrefsManager.reset);
|
||||
final connector = MeshCoreConnector();
|
||||
addTearDown(connector.dispose);
|
||||
|
||||
final json = await const BackupService().createBackup(
|
||||
items: {BackupItem.appSettings},
|
||||
connector: connector,
|
||||
settings: AppSettings(),
|
||||
password: '',
|
||||
);
|
||||
final payload = jsonDecode(json) as Map<String, dynamic>;
|
||||
final section =
|
||||
(payload['sections'] as Map<String, dynamic>)['appSettings']
|
||||
as Map<String, dynamic>;
|
||||
final preferences = section['preferences'] as Map<String, dynamic>;
|
||||
expect(preferences, contains('app_settings'));
|
||||
expect(preferences, isNot(contains('contact_added_at_0011223344')));
|
||||
});
|
||||
|
||||
test('backs up a sensitive key without unrelated app settings', () async {
|
||||
SharedPreferences.setMockInitialValues({
|
||||
'app_settings': jsonEncode({
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/models/image_codec_support.dart';
|
||||
import 'package:meshcore_open/services/app_settings_service.dart';
|
||||
import 'package:meshcore_open/services/image_codec_backend.dart';
|
||||
import 'package:meshcore_open/services/image_codec_service.dart';
|
||||
import 'package:meshcore_open/services/image_codec_settings_store.dart';
|
||||
import 'package:meshcore_open/widgets/image_send_codec_binding.dart';
|
||||
|
||||
/// Runs in both build modes; each half skips in the other (`scripts/onnx.sh`).
|
||||
void main() {
|
||||
ImageCodecService newService() {
|
||||
final service = ImageCodecService(
|
||||
AppSettingsService(),
|
||||
settingsStore: InMemoryImageCodecSettingsStore(
|
||||
const ImageCodecPreferences(enabled: true),
|
||||
),
|
||||
);
|
||||
addTearDown(service.dispose);
|
||||
return service;
|
||||
}
|
||||
|
||||
test('ONNX-free build reports the image codec unavailable', () {
|
||||
final service = newService();
|
||||
expect(createImageCodecBackend(), isNull);
|
||||
expect(service.availability, ImageCodecAvailability.unavailable);
|
||||
expect(service.unavailableReason, contains('without ONNX Runtime'));
|
||||
expect(service.canRunInference, isFalse);
|
||||
}, skip: imageCodecRuntimeAvailable ? 'ONNX Runtime is compiled in' : false);
|
||||
|
||||
test('ONNX build has a codec backend', () {
|
||||
final service = newService();
|
||||
expect(createImageCodecBackend(), isA<OnnxImageCodecBackend>());
|
||||
expect(service.unavailableReason, isNull);
|
||||
}, skip: imageCodecRuntimeAvailable ? false : 'built without ONNX Runtime');
|
||||
}
|
||||
@@ -0,0 +1,512 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/helpers/gif_helper.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations.dart';
|
||||
import 'package:meshcore_open/models/chat_background.dart';
|
||||
import 'package:meshcore_open/services/app_settings_service.dart';
|
||||
import 'package:meshcore_open/services/chat_background_service.dart';
|
||||
import 'package:meshcore_open/services/chat_background_image_store.dart';
|
||||
import 'package:meshcore_open/storage/prefs_manager.dart';
|
||||
import 'package:meshcore_open/theme/mesh_theme.dart';
|
||||
import 'package:meshcore_open/widgets/byte_count_input.dart';
|
||||
import 'package:meshcore_open/widgets/chat_background.dart';
|
||||
import 'package:meshcore_open/widgets/chat_composer.dart';
|
||||
import 'package:meshcore_open/widgets/connect_sheet.dart';
|
||||
import 'package:meshcore_open/widgets/gif_message.dart';
|
||||
import 'package:meshcore_open/widgets/message_translation_button.dart';
|
||||
|
||||
final _l10n = lookupAppLocalizations(const Locale('en'));
|
||||
|
||||
class _Connector extends MeshCoreConnector {
|
||||
bool connected = true;
|
||||
|
||||
@override
|
||||
bool get isConnected => connected;
|
||||
}
|
||||
|
||||
class _Harness {
|
||||
final controller = TextEditingController();
|
||||
final focusNode = FocusNode();
|
||||
final connector = _Connector();
|
||||
late final AppSettingsService settings;
|
||||
late final ChatBackgroundService backgrounds;
|
||||
int sends = 0;
|
||||
final actions = <String>[];
|
||||
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
focusNode.dispose();
|
||||
connector.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Future<_Harness> _harness(WidgetTester tester) async {
|
||||
final h = _Harness();
|
||||
// A date with no holiday nearby, so no holiday chat background applies.
|
||||
h.settings = AppSettingsService(clock: () => DateTime(2026, 7, 1));
|
||||
await tester.runAsync(h.settings.loadSettings);
|
||||
h.backgrounds = ChatBackgroundService(
|
||||
h.settings,
|
||||
imageStore: InMemoryChatBackgroundImageStore(),
|
||||
);
|
||||
addTearDown(h.dispose);
|
||||
return h;
|
||||
}
|
||||
|
||||
Widget _app(
|
||||
_Harness h, {
|
||||
int maxBytes = 160,
|
||||
Widget? replyPreview,
|
||||
bool disableAnimations = false,
|
||||
Brightness brightness = Brightness.light,
|
||||
}) {
|
||||
final composer = ChatComposer(
|
||||
controller: h.controller,
|
||||
focusNode: h.focusNode,
|
||||
maxBytes: maxBytes,
|
||||
onSend: () => h.sends++,
|
||||
sendTooltip: _l10n.chat_sendMessage,
|
||||
actionsBuilder: () => [
|
||||
ChatComposerAction(
|
||||
id: 'gif',
|
||||
icon: Icons.gif_box,
|
||||
label: _l10n.chat_sendGif,
|
||||
),
|
||||
],
|
||||
onAction: h.actions.add,
|
||||
replyPreview: replyPreview,
|
||||
);
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider<MeshCoreConnector>.value(value: h.connector),
|
||||
ChangeNotifierProvider.value(value: h.settings),
|
||||
ChangeNotifierProvider.value(value: h.backgrounds),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: brightness == Brightness.light
|
||||
? MeshTheme.light()
|
||||
: MeshTheme.dark(),
|
||||
locale: const Locale('en'),
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
builder: (context, child) => MediaQuery(
|
||||
data: MediaQuery.of(
|
||||
context,
|
||||
).copyWith(disableAnimations: disableAnimations),
|
||||
child: child!,
|
||||
),
|
||||
home: Scaffold(
|
||||
body: ChatBackdrop(
|
||||
chatKey: 'contact:test',
|
||||
footer: composer,
|
||||
child: const SizedBox.expand(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Finder get _plus => find.byTooltip(_l10n.chat_selectSendAction);
|
||||
Finder get _send => find.byTooltip(_l10n.chat_sendMessage);
|
||||
Finder get _bubble => find.byKey(ChatComposer.bubbleKey);
|
||||
|
||||
Future<void> _type(WidgetTester tester, String text) async {
|
||||
await tester.enterText(find.byType(TextField), text);
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
void main() {
|
||||
setUp(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
PrefsManager.reset();
|
||||
await PrefsManager.initialize();
|
||||
});
|
||||
|
||||
testWidgets('right circle is + when empty and Send with text', (
|
||||
tester,
|
||||
) async {
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// No separate "+" on the left: one round button only.
|
||||
expect(_plus, findsOneWidget);
|
||||
expect(_send, findsNothing);
|
||||
expect(find.byIcon(Icons.add_circle_outline), findsNothing);
|
||||
|
||||
// "+" opens the screen's action menu.
|
||||
await tester.tap(_plus);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text(_l10n.chat_sendGif));
|
||||
await tester.pumpAndSettle();
|
||||
expect(h.actions, ['gif']);
|
||||
|
||||
// Whitespace doesn't count as text.
|
||||
await _type(tester, ' ');
|
||||
expect(_plus, findsOneWidget);
|
||||
|
||||
await _type(tester, 'On my way');
|
||||
expect(_plus, findsNothing);
|
||||
expect(_send, findsOneWidget);
|
||||
await tester.tap(_send);
|
||||
expect(h.sends, 1);
|
||||
|
||||
await _type(tester, '');
|
||||
expect(_plus, findsOneWidget);
|
||||
expect(_send, findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('round button has a 48dp touch target and sits right of the '
|
||||
'bubble', (tester) async {
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final plus = find.widgetWithIcon(IconButton, Icons.add);
|
||||
final size = tester.getSize(plus);
|
||||
expect(size.width, greaterThanOrEqualTo(48));
|
||||
expect(size.height, greaterThanOrEqualTo(48));
|
||||
expect(
|
||||
tester.getTopLeft(plus).dx,
|
||||
greaterThanOrEqualTo(tester.getTopRight(_bubble).dx),
|
||||
);
|
||||
// Single-line bubble is about one touch target tall.
|
||||
expect(tester.getSize(_bubble).height, inInclusiveRange(44, 52));
|
||||
});
|
||||
|
||||
testWidgets('swap animates, and is instant with animations disabled', (
|
||||
tester,
|
||||
) async {
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.enterText(find.byType(TextField), 'hi');
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 50));
|
||||
// Mid-transition both icons are on screen.
|
||||
expect(_plus, findsOneWidget);
|
||||
expect(_send, findsOneWidget);
|
||||
await tester.pumpAndSettle();
|
||||
expect(_plus, findsNothing);
|
||||
|
||||
final reduced = await _harness(tester);
|
||||
await tester.pumpWidget(_app(reduced, disableAnimations: true));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.enterText(find.byType(TextField), 'hi');
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(_plus, findsNothing);
|
||||
expect(_send, findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('field grows to 5 lines then scrolls, buttons stay at the '
|
||||
'bottom', (tester) async {
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h, maxBytes: 1000));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final field = tester.widget<TextField>(find.byType(TextField));
|
||||
expect(field.minLines, 1);
|
||||
expect(field.maxLines, kComposerMaxLines);
|
||||
|
||||
await _type(tester, 'one');
|
||||
final oneLine = tester.getSize(find.byType(TextField)).height;
|
||||
final sendBottom = tester.getBottomLeft(_send).dy;
|
||||
final bubbleBottom = tester.getBottomLeft(_bubble).dy;
|
||||
|
||||
await _type(tester, List.filled(5, 'line').join('\n'));
|
||||
final fiveLines = tester.getSize(find.byType(TextField)).height;
|
||||
expect(fiveLines, greaterThan(oneLine * 2));
|
||||
|
||||
await _type(tester, List.filled(12, 'line').join('\n'));
|
||||
expect(tester.getSize(find.byType(TextField)).height, fiveLines);
|
||||
|
||||
// The panel grows upwards; the send button keeps its place at the
|
||||
// bottom of the bubble.
|
||||
expect(tester.getBottomLeft(_send).dy, sendBottom);
|
||||
expect(tester.getBottomLeft(_bubble).dy, bubbleBottom);
|
||||
});
|
||||
|
||||
testWidgets('a short window still lets the field wrap onto two lines', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(600, 260);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
tester.platformDispatcher.textScaleFactorTestValue = 2.0;
|
||||
addTearDown(tester.view.reset);
|
||||
addTearDown(tester.platformDispatcher.clearTextScaleFactorTestValue);
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h, maxBytes: 1000));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
tester.widget<TextField>(find.byType(TextField)).maxLines,
|
||||
greaterThanOrEqualTo(2),
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('byte counter shows only past the warning threshold and '
|
||||
'takes no space before', (tester) async {
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h, maxBytes: 20));
|
||||
await tester.pumpAndSettle();
|
||||
final emptyHeight = tester.getSize(_bubble).height;
|
||||
|
||||
await _type(tester, 'a' * 14); // 70 %: not past the threshold
|
||||
expect(find.text('14 / 20'), findsNothing);
|
||||
expect(tester.getSize(_bubble).height, emptyHeight);
|
||||
|
||||
await _type(tester, 'a' * 15);
|
||||
final counter = find.text('15 / 20');
|
||||
expect(counter, findsOneWidget);
|
||||
expect(find.descendant(of: _bubble, matching: counter), findsOneWidget);
|
||||
// Bottom-right of the bubble.
|
||||
expect(
|
||||
tester.getCenter(counter).dx,
|
||||
greaterThan(tester.getCenter(_bubble).dx),
|
||||
);
|
||||
expect(
|
||||
tester.getCenter(counter).dy,
|
||||
greaterThan(tester.getCenter(find.byType(TextField)).dy),
|
||||
);
|
||||
|
||||
// The byte limit itself is unchanged.
|
||||
await _type(tester, 'a' * 30);
|
||||
expect(h.controller.text.length, 20);
|
||||
});
|
||||
|
||||
testWidgets('ByteCountedTextField defaults are unchanged for other '
|
||||
'screens', (tester) async {
|
||||
final controller = TextEditingController();
|
||||
addTearDown(controller.dispose);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: ByteCountedTextField(maxBytes: 20, controller: controller),
|
||||
),
|
||||
),
|
||||
);
|
||||
final field = tester.widget<TextField>(find.byType(TextField));
|
||||
expect(field.maxLines, isNull);
|
||||
// The counter row keeps its place while hidden.
|
||||
expect(find.text('0 / 20'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('reply preview renders inside the top of the bubble and can '
|
||||
'be dismissed', (tester) async {
|
||||
final h = await _harness(tester);
|
||||
var dismissed = false;
|
||||
await tester.pumpWidget(
|
||||
_app(
|
||||
h,
|
||||
replyPreview: ChatComposerQuote(
|
||||
title: _l10n.chat_replyingTo('Bob'),
|
||||
content: const Text('see you at camp'),
|
||||
onDismiss: () => dismissed = true,
|
||||
dismissTooltip: _l10n.chat_cancelReply,
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final quote = find.byType(ChatComposerQuote);
|
||||
expect(find.descendant(of: _bubble, matching: quote), findsOneWidget);
|
||||
expect(find.text(_l10n.chat_replyingTo('Bob')), findsOneWidget);
|
||||
expect(
|
||||
tester.getBottomLeft(quote).dy,
|
||||
lessThanOrEqualTo(tester.getTopLeft(find.byType(TextField)).dy),
|
||||
);
|
||||
|
||||
await tester.tap(find.byTooltip(_l10n.chat_cancelReply));
|
||||
expect(dismissed, isTrue);
|
||||
});
|
||||
|
||||
testWidgets('GIF preview sits in the bubble, sends on Enter and can be '
|
||||
'removed', (tester) async {
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
h.controller.text = GifHelper.encodeGif('abc123');
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
|
||||
expect(
|
||||
find.descendant(of: _bubble, matching: find.byType(GifMessage)),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.byType(TextField), findsNothing);
|
||||
expect(_send, findsOneWidget);
|
||||
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
|
||||
expect(h.sends, 1);
|
||||
|
||||
await tester.tap(find.byTooltip(_l10n.chat_removeGif));
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
expect(h.controller.text, isEmpty);
|
||||
expect(find.byType(TextField), findsOneWidget);
|
||||
expect(_plus, findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('translate button sits inside the bubble when enabled', (
|
||||
tester,
|
||||
) async {
|
||||
final h = await _harness(tester);
|
||||
await tester.runAsync(() => h.settings.setTranslationEnabled(true));
|
||||
await tester.pumpWidget(_app(h));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final translate = find.byType(MessageTranslationButton);
|
||||
expect(find.descendant(of: _bubble, matching: translate), findsOneWidget);
|
||||
expect(
|
||||
tester.getCenter(translate).dx,
|
||||
greaterThan(tester.getCenter(find.byType(TextField)).dx),
|
||||
);
|
||||
expect(
|
||||
find.descendant(of: translate, matching: find.byType(Tooltip)),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('panel is solid without a chat background and transparent '
|
||||
'over one', (tester) async {
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final scheme = MeshTheme.light().colorScheme;
|
||||
Color bubbleColor() =>
|
||||
((tester.widget<DecoratedBox>(_bubble).decoration as BoxDecoration)
|
||||
.color)
|
||||
as Color;
|
||||
final panelFill = find.ancestor(
|
||||
of: _bubble,
|
||||
matching: find.byWidgetPredicate(
|
||||
(w) => w is ColoredBox && w.color == scheme.surface,
|
||||
),
|
||||
);
|
||||
expect(panelFill, findsOneWidget);
|
||||
expect(bubbleColor(), scheme.surfaceContainerHigh);
|
||||
|
||||
await tester.runAsync(
|
||||
() => h.backgrounds.setChatBackground(
|
||||
'contact:test',
|
||||
const ChatBackground.color(Color(0xFF1E3A8A)),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(ChatBackgroundLayer), findsOneWidget);
|
||||
expect(panelFill, findsNothing);
|
||||
// Incoming-bubble colour keeps the text readable over the background.
|
||||
expect(bubbleColor(), scheme.surfaceContainerLow);
|
||||
});
|
||||
|
||||
testWidgets('offline bar uses the same bubble and height as the composer', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(1200, 600);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
final h = await _harness(tester);
|
||||
await tester.pumpWidget(_app(h));
|
||||
await tester.pumpAndSettle();
|
||||
final composerTop = tester.getTopLeft(_bubble).dy;
|
||||
final composerHeight = tester.getSize(_bubble).height;
|
||||
|
||||
h.connector.connected = false;
|
||||
h.connector.notifyListeners();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byType(OfflineComposerBar), findsOneWidget);
|
||||
expect(find.byType(TextField), findsNothing);
|
||||
expect(find.byType(ConnectButton), findsOneWidget);
|
||||
expect(find.text(_l10n.chat_composerOffline), findsOneWidget);
|
||||
final decoration =
|
||||
tester.widget<DecoratedBox>(_bubble).decoration as BoxDecoration;
|
||||
expect(
|
||||
decoration.borderRadius,
|
||||
BorderRadius.circular(kComposerBubbleRadius),
|
||||
);
|
||||
expect(tester.getSize(_bubble).height, composerHeight);
|
||||
expect(tester.getTopLeft(_bubble).dy, composerTop);
|
||||
|
||||
// The draft survives and comes back with the radio.
|
||||
h.controller.text = 'draft';
|
||||
h.connector.connected = true;
|
||||
h.connector.notifyListeners();
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
tester.widget<TextField>(find.byType(TextField)).controller?.text,
|
||||
'draft',
|
||||
);
|
||||
});
|
||||
|
||||
for (final scale in [1.3, 2.0]) {
|
||||
for (final brightness in Brightness.values) {
|
||||
testWidgets('fits 320dp at ${scale}x text (${brightness.name})', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(320, 568);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
tester.platformDispatcher.textScaleFactorTestValue = scale;
|
||||
addTearDown(tester.view.reset);
|
||||
addTearDown(tester.platformDispatcher.clearTextScaleFactorTestValue);
|
||||
final h = await _harness(tester);
|
||||
await tester.runAsync(() => h.settings.setTranslationEnabled(true));
|
||||
await tester.pumpWidget(
|
||||
_app(
|
||||
h,
|
||||
maxBytes: 20,
|
||||
brightness: brightness,
|
||||
replyPreview: ChatComposerQuote(
|
||||
title: _l10n.chat_replyingTo('A very long sender name here'),
|
||||
content: const Text(
|
||||
'a long quoted message that must ellipsize',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onDismiss: () {},
|
||||
dismissTooltip: _l10n.chat_cancelReply,
|
||||
// A long region chip, as a channel reply shows.
|
||||
trailing: Text(
|
||||
_l10n.channels_regionSetTo('north-west-valley'),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(find.byTooltip(_l10n.chat_cancelReply), findsOneWidget);
|
||||
await _type(tester, 'a' * 19);
|
||||
expect(tester.takeException(), isNull);
|
||||
|
||||
// With the keyboard up, a long draft still fits: the field caps its
|
||||
// lines to the room left.
|
||||
tester.view.viewInsets = const FakeViewPadding(bottom: 260);
|
||||
await _type(tester, List.filled(8, 'line').join('\n'));
|
||||
expect(tester.takeException(), isNull);
|
||||
tester.view.resetViewInsets();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
h.connector.connected = false;
|
||||
h.connector.notifyListeners();
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations.dart';
|
||||
import 'package:meshcore_open/models/app_settings.dart';
|
||||
import 'package:meshcore_open/theme/mesh_theme.dart';
|
||||
import 'package:meshcore_open/widgets/chat_compression_selector.dart';
|
||||
|
||||
final _l10n = lookupAppLocalizations(const Locale('en'));
|
||||
|
||||
final _profiles = [
|
||||
Cyr2LatProfile(id: 'ru', name: 'Russian', charMap: const {'А': 'A'}),
|
||||
Cyr2LatProfile(id: 'sr', name: 'Serbian', charMap: const {'З': '3'}),
|
||||
];
|
||||
|
||||
/// Stands in for a chat screen: keeps the "saved" state and applies a change
|
||||
/// only when the test completes the pending write.
|
||||
class _Host extends StatefulWidget {
|
||||
final ChatCompressionMode initialMode;
|
||||
final bool enabled;
|
||||
final String? initialProfileId;
|
||||
final List<ChatCompressionMode> modeCalls;
|
||||
final List<String> profileCalls;
|
||||
final List<Completer<void>> pending;
|
||||
|
||||
const _Host({
|
||||
this.initialMode = ChatCompressionMode.off,
|
||||
this.enabled = true,
|
||||
this.initialProfileId,
|
||||
required this.modeCalls,
|
||||
required this.profileCalls,
|
||||
required this.pending,
|
||||
});
|
||||
|
||||
@override
|
||||
State<_Host> createState() => _HostState();
|
||||
}
|
||||
|
||||
class _HostState extends State<_Host> {
|
||||
late ChatCompressionMode _mode = widget.initialMode;
|
||||
late String? _profileId = widget.initialProfileId;
|
||||
|
||||
Future<void> _write(void Function() apply) async {
|
||||
final completer = Completer<void>();
|
||||
widget.pending.add(completer);
|
||||
await completer.future;
|
||||
if (mounted) setState(apply);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Chat')),
|
||||
body: Column(
|
||||
children: [
|
||||
ChatCompressionSelector(
|
||||
mode: _mode,
|
||||
enabled: widget.enabled,
|
||||
disabledReason: widget.enabled
|
||||
? null
|
||||
: _l10n.chatCompression_noStorageId,
|
||||
profiles: _profiles,
|
||||
profileId: _profileId,
|
||||
defaultProfileId: 'ru',
|
||||
onModeChanged: (mode) {
|
||||
widget.modeCalls.add(mode);
|
||||
return _write(() => _mode = mode);
|
||||
},
|
||||
onProfileChanged: (id) {
|
||||
widget.profileCalls.add(id);
|
||||
return _write(() => _profileId = id);
|
||||
},
|
||||
),
|
||||
const Expanded(child: Placeholder()),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
late List<ChatCompressionMode> modeCalls;
|
||||
late List<String> profileCalls;
|
||||
late List<Completer<void>> pending;
|
||||
|
||||
setUp(() {
|
||||
modeCalls = [];
|
||||
profileCalls = [];
|
||||
pending = [];
|
||||
});
|
||||
|
||||
Future<void> pumpHost(
|
||||
WidgetTester tester, {
|
||||
ChatCompressionMode mode = ChatCompressionMode.off,
|
||||
bool enabled = true,
|
||||
String? profileId,
|
||||
Size size = const Size(400, 800),
|
||||
double textScale = 1.0,
|
||||
}) async {
|
||||
tester.view.physicalSize = size;
|
||||
tester.view.devicePixelRatio = 1.0;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: MeshTheme.light(),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
builder: (context, child) => MediaQuery(
|
||||
data: MediaQuery.of(
|
||||
context,
|
||||
).copyWith(textScaler: TextScaler.linear(textScale)),
|
||||
child: child!,
|
||||
),
|
||||
home: _Host(
|
||||
initialMode: mode,
|
||||
enabled: enabled,
|
||||
initialProfileId: profileId,
|
||||
modeCalls: modeCalls,
|
||||
profileCalls: profileCalls,
|
||||
pending: pending,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> openSheet(WidgetTester tester) async {
|
||||
await tester.tap(find.byType(ChatCompressionSelector));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
Finder optionRow(String label) =>
|
||||
find.ancestor(of: find.text(label), matching: find.byType(ListTile));
|
||||
|
||||
bool isSelected(WidgetTester tester, String label) {
|
||||
final row = optionRow(label);
|
||||
return find
|
||||
.descendant(of: row, matching: find.byIcon(Icons.radio_button_checked))
|
||||
.evaluate()
|
||||
.isNotEmpty;
|
||||
}
|
||||
|
||||
testWidgets('shows the saved mode and announces it', (tester) async {
|
||||
final semantics = tester.ensureSemantics();
|
||||
await pumpHost(tester, mode: ChatCompressionMode.smaz);
|
||||
|
||||
expect(find.text(_l10n.chatCompression_label('SMAZ')), findsOneWidget);
|
||||
expect(
|
||||
tester.getSemantics(
|
||||
find.bySemanticsLabel(_l10n.chatCompression_label('SMAZ')),
|
||||
),
|
||||
isSemantics(
|
||||
label: _l10n.chatCompression_label('SMAZ'),
|
||||
hint: _l10n.chatCompression_changeHint,
|
||||
isButton: true,
|
||||
isEnabled: true,
|
||||
hasTapAction: true,
|
||||
),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byType(ChatCompressionSelector)).height,
|
||||
greaterThanOrEqualTo(48),
|
||||
);
|
||||
semantics.dispose();
|
||||
});
|
||||
|
||||
testWidgets('one sheet lists the three modes with their explanations', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpHost(tester);
|
||||
await openSheet(tester);
|
||||
|
||||
expect(find.text(_l10n.chatCompression_title), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_off), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_smaz), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_cyr2lat), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_offDescription), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_smazDescription), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_cyr2latDescription), findsOneWidget);
|
||||
expect(isSelected(tester, _l10n.chatCompression_off), isTrue);
|
||||
expect(isSelected(tester, _l10n.chatCompression_smaz), isFalse);
|
||||
// No profile picker unless Cyr2Lat is chosen.
|
||||
expect(find.text(_l10n.chatCompression_profile), findsNothing);
|
||||
expect(find.byType(Dialog), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('a choice shows only after it is saved, then the sheet closes', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpHost(tester);
|
||||
await openSheet(tester);
|
||||
|
||||
await tester.tap(find.text(_l10n.chatCompression_smaz));
|
||||
await tester.pump();
|
||||
expect(modeCalls, [ChatCompressionMode.smaz]);
|
||||
// Still saving: old mode shown, options locked against rapid taps.
|
||||
expect(isSelected(tester, _l10n.chatCompression_off), isTrue);
|
||||
expect(
|
||||
tester.widget<ListTile>(optionRow(_l10n.chatCompression_cyr2lat)).enabled,
|
||||
isFalse,
|
||||
);
|
||||
await tester.tap(find.text(_l10n.chatCompression_cyr2lat));
|
||||
await tester.pump();
|
||||
expect(modeCalls, [ChatCompressionMode.smaz]);
|
||||
|
||||
pending.single.complete();
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text(_l10n.chatCompression_title), findsNothing);
|
||||
expect(find.text(_l10n.chatCompression_label('SMAZ')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Cyr2Lat keeps the sheet open with its profile picker', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpHost(tester);
|
||||
await openSheet(tester);
|
||||
|
||||
await tester.tap(find.text(_l10n.chatCompression_cyr2lat));
|
||||
await tester.pump();
|
||||
pending.removeAt(0).complete();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text(_l10n.chatCompression_title), findsOneWidget);
|
||||
expect(isSelected(tester, _l10n.chatCompression_cyr2lat), isTrue);
|
||||
expect(find.text(_l10n.chatCompression_profile), findsOneWidget);
|
||||
// No profile saved for the chat: the app-wide one is what sending uses.
|
||||
expect(find.text('Russian'), findsOneWidget);
|
||||
|
||||
await tester.ensureVisible(find.text('Russian'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Russian'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Serbian').last);
|
||||
await tester.pump();
|
||||
expect(profileCalls, ['sr']);
|
||||
pending.removeAt(0).complete();
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Serbian'), findsOneWidget);
|
||||
expect(find.text(_l10n.chatCompression_label('Cyr2Lat')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('a failed save keeps the saved mode and says so', (tester) async {
|
||||
await pumpHost(tester, mode: ChatCompressionMode.smaz);
|
||||
await openSheet(tester);
|
||||
|
||||
await tester.tap(find.text(_l10n.chatCompression_cyr2lat));
|
||||
await tester.pump();
|
||||
pending.single.completeError(StateError('disk full'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text(_l10n.chatCompression_saveFailed), findsOneWidget);
|
||||
expect(isSelected(tester, _l10n.chatCompression_smaz), isTrue);
|
||||
expect(isSelected(tester, _l10n.chatCompression_cyr2lat), isFalse);
|
||||
expect(
|
||||
tester.widget<ListTile>(optionRow(_l10n.chatCompression_off)).enabled,
|
||||
isTrue,
|
||||
);
|
||||
await tester.tap(find.byTooltip('Close'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text(_l10n.chatCompression_label('SMAZ')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('a failed profile save shows the saved profile again', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpHost(tester, mode: ChatCompressionMode.cyr2lat, profileId: 'ru');
|
||||
await openSheet(tester);
|
||||
|
||||
await tester.ensureVisible(find.text('Russian'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Russian'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Serbian').last);
|
||||
await tester.pump();
|
||||
expect(profileCalls, ['sr']);
|
||||
pending.single.completeError(StateError('disk full'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text(_l10n.chatCompression_saveFailed), findsOneWidget);
|
||||
expect(find.text('Russian'), findsOneWidget);
|
||||
expect(find.text('Serbian'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('disabled shows the saved mode, and the sheet says why and '
|
||||
'allows no change', (tester) async {
|
||||
final semantics = tester.ensureSemantics();
|
||||
await pumpHost(tester, mode: ChatCompressionMode.smaz, enabled: false);
|
||||
|
||||
final label = _l10n.chatCompression_label('SMAZ');
|
||||
expect(find.text(label), findsOneWidget);
|
||||
expect(find.byIcon(Icons.lock_outline), findsOneWidget);
|
||||
expect(
|
||||
find.bySemanticsLabel('$label. ${_l10n.chatCompression_noStorageId}'),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
await openSheet(tester);
|
||||
expect(find.text(_l10n.chatCompression_noStorageId), findsOneWidget);
|
||||
expect(isSelected(tester, _l10n.chatCompression_smaz), isTrue);
|
||||
for (final mode in [
|
||||
_l10n.chatCompression_off,
|
||||
_l10n.chatCompression_smaz,
|
||||
_l10n.chatCompression_cyr2lat,
|
||||
]) {
|
||||
expect(tester.widget<ListTile>(optionRow(mode)).enabled, isFalse);
|
||||
}
|
||||
await tester.tap(find.text(_l10n.chatCompression_off), warnIfMissed: false);
|
||||
await tester.pumpAndSettle();
|
||||
expect(modeCalls, isEmpty);
|
||||
semantics.dispose();
|
||||
});
|
||||
|
||||
for (final scale in [1.3, 2.0]) {
|
||||
testWidgets('fits a 320dp phone at ${scale}x text', (tester) async {
|
||||
await pumpHost(
|
||||
tester,
|
||||
mode: ChatCompressionMode.cyr2lat,
|
||||
enabled: true,
|
||||
size: const Size(320, 568),
|
||||
textScale: scale,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
await openSheet(tester);
|
||||
expect(tester.takeException(), isNull);
|
||||
// The sheet scrolls to its last option and the profile picker.
|
||||
await tester.scrollUntilVisible(
|
||||
find.text(_l10n.chatCompression_profile),
|
||||
200,
|
||||
scrollable: find.byType(Scrollable).last,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations_en.dart';
|
||||
import 'package:meshcore_open/models/contact.dart';
|
||||
import 'package:meshcore_open/widgets/contact_visuals.dart';
|
||||
|
||||
Contact _contact(int seed, {required DateTime lastSeen, DateTime? message}) =>
|
||||
Contact(
|
||||
publicKey: Uint8List.fromList(List.filled(32, seed)),
|
||||
name: 'c$seed',
|
||||
type: 1,
|
||||
pathLength: -1,
|
||||
path: Uint8List(0),
|
||||
lastSeen: lastSeen,
|
||||
lastMessageAt: message,
|
||||
);
|
||||
|
||||
void main() {
|
||||
final epoch = DateTime.fromMillisecondsSinceEpoch(0);
|
||||
final now = DateTime.now();
|
||||
|
||||
test('added time orders a contact the radio has no advert time for', () {
|
||||
final added = now.subtract(const Duration(minutes: 1));
|
||||
final fromCard = _contact(1, lastSeen: epoch);
|
||||
final heardHourAgo = _contact(
|
||||
2,
|
||||
lastSeen: now.subtract(const Duration(hours: 1)),
|
||||
);
|
||||
final addedAt = {fromCard: added};
|
||||
final sorted = [heardHourAgo, fromCard]
|
||||
..sort(
|
||||
(a, b) => resolveContactLastSeen(
|
||||
b,
|
||||
addedAt: addedAt[b],
|
||||
).compareTo(resolveContactLastSeen(a, addedAt: addedAt[a])),
|
||||
);
|
||||
|
||||
expect(resolveContactLastSeen(fromCard, addedAt: added), added);
|
||||
expect(sorted.first, fromCard);
|
||||
});
|
||||
|
||||
test('a real advert time is never replaced by the added time', () {
|
||||
final advert = now.subtract(const Duration(days: 30));
|
||||
final contact = _contact(3, lastSeen: advert);
|
||||
|
||||
expect(resolveContactLastSeen(contact, addedAt: now), advert);
|
||||
});
|
||||
|
||||
test('a newer message still wins over the added time', () {
|
||||
final message = now;
|
||||
final contact = _contact(4, lastSeen: epoch, message: message);
|
||||
|
||||
expect(
|
||||
resolveContactLastSeen(
|
||||
contact,
|
||||
addedAt: now.subtract(const Duration(hours: 1)),
|
||||
),
|
||||
message,
|
||||
);
|
||||
});
|
||||
|
||||
test('a contact never heard shows "not heard yet", not decades ago', () {
|
||||
final l10n = AppLocalizationsEn();
|
||||
|
||||
expect(formatContactLastSeen(l10n, epoch), l10n.contacts_lastSeenNever);
|
||||
expect(
|
||||
resolveContactLastSeen(_contact(5, lastSeen: epoch)),
|
||||
epoch,
|
||||
reason: 'display label is driven by the advert/message time only',
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/// Stand-in for `flutter_onnxruntime` in builds made without ONNX Runtime.
|
||||
///
|
||||
/// Mirrors only the API MeshCore Open uses. [OnnxRuntime] cannot be
|
||||
/// constructed, which is how the app detects this build.
|
||||
library;
|
||||
|
||||
UnsupportedError _unsupported() =>
|
||||
UnsupportedError('This build was made without ONNX Runtime.');
|
||||
|
||||
class OnnxRuntime {
|
||||
OnnxRuntime() {
|
||||
throw _unsupported();
|
||||
}
|
||||
|
||||
Future<OrtSession> createSession(String modelPath) => throw _unsupported();
|
||||
}
|
||||
|
||||
abstract class OrtSession {
|
||||
List<String> get inputNames;
|
||||
|
||||
List<String> get outputNames;
|
||||
|
||||
Future<Map<String, OrtValue>> run(Map<String, OrtValue> inputs);
|
||||
|
||||
Future<void> close();
|
||||
}
|
||||
|
||||
abstract class OrtValue {
|
||||
List<int> get shape;
|
||||
|
||||
static Future<OrtValue> fromList(dynamic data, List<int> shape) =>
|
||||
throw _unsupported();
|
||||
|
||||
Future<List<dynamic>> asFlattenedList();
|
||||
|
||||
Future<void> dispose();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
name: flutter_onnxruntime
|
||||
description: >-
|
||||
Pure-Dart stand-in for flutter_onnxruntime, used by `scripts/onnx.sh off` to
|
||||
build MeshCore Open without ONNX Runtime. No native plugin, no downloads.
|
||||
version: 1.9.0
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: ^3.7.0
|
||||
+285
-19
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"bg": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -19,11 +20,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"cs": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -42,11 +57,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"de": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -65,11 +94,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"es": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -88,11 +131,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"fr": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -111,11 +168,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"hu": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -134,11 +205,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"it": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -157,11 +242,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"ja": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -180,11 +279,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"ko": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -203,11 +316,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"nl": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -226,11 +353,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"pl": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -249,11 +390,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"pt": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -272,11 +427,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"pt_PT": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -295,11 +464,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"ru": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -318,11 +501,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"sk": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -341,11 +538,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"sl": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -364,11 +575,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"sv": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -387,11 +612,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"uk": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -410,11 +649,25 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
],
|
||||
|
||||
"zh": [
|
||||
"backupRestore_bookmarks",
|
||||
"contacts_lastSeenNever",
|
||||
"chat_bookmark",
|
||||
"chat_removeBookmark",
|
||||
"chat_showBookmarks",
|
||||
@@ -433,6 +686,19 @@
|
||||
"imageSend_tryAnother",
|
||||
"imageSend_versionsHint",
|
||||
"imageSend_versionLabel",
|
||||
"imageSend_versionPackets"
|
||||
"imageSend_versionPackets",
|
||||
"chatCompression_title",
|
||||
"chatCompression_label",
|
||||
"chatCompression_off",
|
||||
"chatCompression_smaz",
|
||||
"chatCompression_cyr2lat",
|
||||
"chatCompression_changeHint",
|
||||
"chatCompression_sheetSubtitle",
|
||||
"chatCompression_offDescription",
|
||||
"chatCompression_smazDescription",
|
||||
"chatCompression_cyr2latDescription",
|
||||
"chatCompression_profile",
|
||||
"chatCompression_noStorageId",
|
||||
"chatCompression_saveFailed"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user