Commit Graph
915 Commits
Author SHA1 Message Date
zjs81 2d56d5e349 Store histories and the tile index in SQLite
Message, channel and route histories move from whole-blob preferences to
indexed SQLite rows on native platforms, so chats page from storage instead
of loading a full conversation. Web keeps the preferences store. Existing
histories are imported once on the first launch.

Linux and Windows keep the map tile index in SQLite and import the old JSON
index on first use.

Unreadable legacy data no longer blocks saves, migrations or startup: it is
left in place and skipped. If the database cannot be opened, the run keeps
histories in preferences and the next launch merges them in.

Also adds a performance profiling reference and a script that clears the
Dart HTTP profile.
2026-11-09 22:32:40 -07:00
zjs81 b276b9daf3 Apply segment label colour changes to the painted text
A colour-only style change (selected, unselected or disabled) only
scheduled a repaint, but the text painter takes its style during
layout, so the label kept its old colour until something else caused a
layout. Request layout for every style change.
2026-11-09 21:27:17 -07:00
zjs81 6daa85edae Translate strings left in English and fix garbled translations
- Translate about 120 strings that were still English in individual
  locales (for example "Done", "Delete All Paths", "Path", "Location",
  "Public Key", the background notification text and error messages).
  Cognates, technical terms and language names are left as they were.
- Replace leaked machine-translation output: the image-send "Original"
  label in eleven locales, loop detection "Off" in Italian, Polish and
  Chinese, the Hungarian region label and duration formats, the Slovak
  OK button, and firmware, CLI and region labels in several others.
2026-11-09 21:24:15 -07:00
zjs81 462159e803 Tester feedback: offline mode, pt-PT, menus, layout and translations
Offline (read-only) mode
- The last connected radio is remembered; with no radio the app opens on
  its saved contacts, channels, messages and unread counts.
- Main screens stay open on disconnect. A Connect button replaces the
  battery and signal indicators, with a sheet to reconnect, choose a
  radio or stop a pending reconnect.
- While disconnected everything is read-only: the composer becomes a
  "connect to send" bar (drafts kept) and controls that change the radio
  or stored history are disabled or hidden.
- Resending while disconnected no longer deletes the message; a
  different radio no longer shows the previous radio's channels.
- Notification taps open the saved chat while offline.

Chats and menus
- Channel chat menu: notifications, edit channel, delete channel; the
  filter row lines up with the others; bell moved out of the app bar.
- DM and room menus: remove from contacts; rooms get room management.
- Search field uses the full app bar; long-press a result to copy.
- Hashtag channel titles no longer read "# #name"; more room around the
  radio activity dot.
- Repeat filter: short messages from one sender are caught at the same
  count as long ones.

Layout
- Shared menu row (wraps to two lines) and segment label (never splits
  a word) used across the app.
- One Scan button on the scanner; consistent settings tile titles;
  contact "last seen" wraps instead of truncating; unfetched repeater
  settings are dimmed.

Localization
- New European Portuguese locale (pt_PT); regional locales are handled
  by the language picker, notifications and the background service.
- Fill 67 missing strings per locale, including backup and restore.
- Keep "Flood" and "Zero Hop" untranslated, shorten "last seen" and
  routing labels, and fix mistranslated scan, theme and hop strings.
- Received-image strings, badge and caption come from translations.
- Regenerate the Czech localizations, which were missing strings.

Docs
- Add documentation/design.md (UI reference) and offline-mode.md;
  update channel, chat, navigation and scanner docs.
2026-11-09 21:18:29 -07:00
zjs81 47f2293a5c Merge pull request #646 from ericszimmermann/ez_backup-restore
Backup and Restore functionality
2026-11-09 07:08:40 -07:00
zjs81 5ea44d6ce9 Tester feedback: routing, bulk select, notifications, map crash
Routing
- Auto routing picks routes by Thompson sampling over faded delivery
  stats (24 h half-life, capped evidence), weighted by what the radio
  currently hears; retries prefer a different route; last attempt floods.
- Route failures are held until a message's fate is known, so an offline
  contact no longer wrecks its route history; failing routes are only
  deleted after a week without a delivery.
- Direct (zero-hop) path is a rotation candidate (#643) and a new Direct
  mode in the routing sheet; history routes are used for repeater logins.
- Remove the route-weight sliders the new chooser no longer uses.

Chats
- Bulk selection in channel chats (spam / not spam / delete / copy) and
  in the Filtered messages list.
- Tapping a search result jumps to the message.
- Swipe-to-reply ignores vertical scrolls.
- Active conversation follows route lifecycle, so covered chats count
  unread again.

Notifications
- Tapping a notification opens its conversation.
- Per-conversation coalescing and one alert per queued-message sync.
- Monochrome status-bar icon; background service stops when the app is
  swiped away; stale notifications cleared on radio or slot change.

Other
- Online map: opaque links and painted dots for dense areas to avoid an
  Impeller GPU crash; expandable hop list on path maps.
- Contact share: clipboard import of shared contacts, "Add again".
- Android: enableEdgeToEdge and scrolling-screenshot support.
- Translations for all new strings; fix mistranslated routing labels.
2026-11-08 23:19:15 -07:00
ericz ef31136711 Stabilize TCP reconnect retry test 2026-11-08 14:41:45 +01:00
ericz cc12e2eb96 Make spam example test deterministic 2026-11-08 14:30:20 +01:00
ericz a020eb30d0 ask for download models and fix problem with reloading discovered list after import. 2026-11-08 14:13:33 +01:00
zjs81 ddf0b9f553 Fix false repeat flags, add repeat-sends setting, limit holiday animations
Message filter:
- Ignore copies of a message already seen (same sender, text and send
  second). Switching between companions re-synced messages the first one
  had delivered; they missed per-radio storage dedup and were flagged as
  repeats.
- Exempt replies and @[name] mentions from repeat detection.
- New "Sends to count as a repeat" setting (2-5, default 2). Each send
  must fall within 10 minutes of the previous one.
- Translations for the new strings in all locales.

Holiday animations:
- Only one plays at a time; greetings arriving while one is playing or
  within 5 seconds after it ends are dropped, not queued.
- Christmas map "self" marker: Santa hat was upside down.
2026-11-08 01:33:05 -07:00
zjs81 80ead2fc2d Address review: trace request size and contact-share translation
- Manual path trace validates the request that will actually be sent
  (round trips become 2n-1 hops, 3-byte hops go out as 4-byte prefixes)
  against the 172-byte frame and 64-hop firmware limits, and disables Run
  with an explanation when it does not fit. PathTraceMapScreen also refuses
  to send an oversized request.
- Contact-share tokens are never passed through message translation, so
  the share cannot be mangled before sending.
2026-11-07 22:53:42 -07:00
zjs81 c939f7a29c Add Czech, in-chat search, typed-hash path trace and contact sharing
- Czech UI locale (app_cs.arb), selectable in the language picker and as a
  message translation language; language names added to every locale.
- Fix wrong language names: Slovak shown as Slovenian in it/ja/pt/sl,
  garbled Slovak/Bulgarian in pl, Ukrainian in ru, Hungarian in ko/zh.
- Search inside DM and channel chats across the full stored history, with
  highlighted matches; filtered channel messages are excluded.
- Path trace by typed hashes (e.g. A1,B2,C3) from the Contacts and map
  menus, without needing node locations; the map trace panel can hand its
  hops to it.
- Share contacts in chats using the official app's <pubkey:type:name>
  format; received cards have a one-tap Add contact button that reuses the
  QR card import path.
- Translations for all new strings in every locale; docs updated.
2026-11-07 22:31:14 -07:00
ericz be28a1a258 add device name to backup-file name. 2026-11-08 04:04:04 +01:00
ericz 76232c1ad7 clear contacts and channels before restoring. 2026-11-08 03:15:32 +01:00
ericz 79109c2c5c more granular selection and import of official meshcore file. 2026-11-08 02:47:34 +01:00
ericz aae2bf6d60 Backup&Restore 2026-11-08 00:40:23 +01:00
zjs81 ff8b0e0722 Verify advert signatures and refresh known contact keys after sync
- Check the Ed25519 signature of every received advert (chat, repeater,
  room, sensor) via a shared verifyAdvertSignature helper before it can
  add or update a contact; forged adverts are dropped
- Rebuild known contact keys after a full contact sync so nodes the radio
  dropped reappear in discovery instead of vanishing from both lists
- Remove unused importContact advert parser
2026-11-06 21:16:34 -07:00
zjs81 03495effe6 Address tester feedback: snackbar, filter dialog, text scaling
- Rule-deleted snackbar now auto-dismisses (persist: false) and snackbar
  actions use a high-contrast colour in both themes
- Add-rule dialog keeps the floating label visible with the keyboard up
- Dismiss focus/keyboard before swapping tab routes
- Repeater status: full-width tiles on phones, no shrink-to-fit values,
  multi-part stats on separate lines, drop "0 days" from durations
- App bar titles respect the system font size instead of scaling down;
  contacts controls grow with text scale; larger nav labels
- Fix duplicated flood value in Japanese duplicates string
2026-11-06 21:00:12 -07:00
zjs81 394df3109b Merge pull request #640 from zjs81/feature/message-filter
Add channel message filter for spam and repeated messages
2026-11-06 00:54:27 -07:00
zjs81 a9d369f42f Address message filter review findings
False positives
- Same-sender repeats need at least 3 words and 10 characters, so short
  replies ("ok", "test") repeated within 10 minutes stay visible.
- Repeated characters needs a run of 20+ of one non-digit character;
  "Noooooooo!", separators, a row of emoji and long numbers are chat.

Correctness
- Rules apply to stored messages: adding a rule hides matching messages
  already in the chat, and removing or disabling one shows again what only
  it was hiding. Other filter reasons are left alone. Also applied when
  history is loaded.
- The filter runs after mesh dedup, inside _addChannelMessage, so each
  message is evaluated and counted by the duplicate tracker once.
- Channels excluded from filtering no longer feed implicit clean examples
  to the classifier.
- Unread counting and the unread anchor treat filtered messages as normal
  when filtering is off for the channel.

Performance
- Classifier training runs in a background isolate (injectable trainer for
  widget tests); app start-up no longer waits for it.
- Reply previews look up the quoted message through an id index instead
  of scanning the channel per bubble.
- The latest-messages channel sort computes each channel's latest visible
  message once.

Cleanup
- Use MessageFilterText.isStructuredPayload instead of a screen copy.

Docs: message-filter.md explains how each check works, including the
learned classifier, and drops the outdated "new messages only" limit.
2026-11-06 00:54:09 -07:00
zjs81 4862966e47 Keep older history reachable and skip notifying spam marked mid-translation
- Channel chat: when the message filter hides or collapses loaded messages
  and the list is too short to scroll (so the load-older trigger can't
  fire), load older pages automatically until it can scroll, storage runs
  out, or 20 pages have loaded. Past that cap an empty channel offers a
  "Load older messages" button instead of a dead end.
- Notifications: incoming channel messages notify after awaiting
  translation; marking one as spam meanwhile replaced the stored copy but
  not the captured one, so the spam still notified. Check the stored
  message's filter state before notifying.
2026-11-06 00:34:49 -07:00
zjs81 1332c35884 Add channel message filter for spam and repeated messages
Client-side filter for channel messages, with no model download:
- User rules on message text and/or sender name (contains, whole word,
  exact), normalised for case, accents, zero-width and look-alike letters.
- Automatic checks: repeated characters, same-sender repeats within 10
  minutes, and the same sentence (>= 6 words) from 3+ senders within 30
  minutes. Windows use send times, so synced history is not a flood.
- On-device n-gram classifier trained by Mark as spam / Not spam taps.

Filtered messages are kept, never notify or count as unread, are not
auto-translated or used for channel previews, and are concealed in reply
quotes. They show as a calm, collapsible placeholder that animates open
and closed, or can be hidden completely. Includes a Filtered messages
list, per-channel toggle, settings screen, translations for all locales
and documentation.
2026-11-05 23:35:27 -07:00
zjs81 3eeb15cbff Merge pull request #623 from wared2003/issue-622-reset-default-routing-algo-settings
Implements Issue #622: Add ability to reset routing algorithm settings to factory defaults.
2026-11-05 23:09:19 -07:00
ericz 512bc1952c guessed location filter applies to estimated online nodes. 2026-11-02 18:00:15 +01:00
ericz e073f6bd52 dart format 2026-11-01 15:10:21 +01:00
ericz 7baf29ca62 small addition, to not display option in local map filter. 2026-11-01 15:06:02 +01:00
ericz b82d5d6aab Add online map filtering controls 2026-11-01 14:13:27 +01:00
zjs81 7202cdedfc Translate theme, background and holiday strings into all languages
Fill the 70 new theme, chat background and holiday strings in all 17
locales and review the holiday greeting phrasings. Prefer the longest
matching greeting so combined greetings pick the right holiday.
2026-10-31 13:49:52 -07:00
zjs81 f0ca703dfb Merge remote-tracking branch 'origin/dev' into feat/custom-themes 2026-10-31 13:43:51 -07:00
zjs81 4a574185e8 Add custom themes, holiday themes, chat backgrounds and holiday animations
- Themes: name + background + accent, derived surfaces/text/bubbles; editor
  with live preview; share codes and .jsonl import/export
- Theme icons: swap tab, send, settings, node avatar and map marker icons for
  named icons or pictures (lossless JPEG XL)
- Chat backgrounds per channel/DM (color or JPEG XL picture with fade);
  themes can set one, optionally for every chat
- Map follows custom themes (panels, accent, tile tint, markers)
- Holiday themes (Halloween, Thanksgiving, Christmas, New Year's) with
  generated backgrounds, icons and map markers; automatic switching from
  17 days before each holiday
- Holiday greeting animations (bats, turkeys, Santa, fireworks) matched
  across all app languages via translation strings
2026-10-31 13:43:34 -07:00
zjs81 41fa841e74 Merge pull request #617 from cano64/map-performance
Speed improvements for the Online Node Map,
2026-10-31 13:42:30 -07:00
zjs81 55cac5ce16 Merge pull request #618 from ericszimmermann/ez_image_notification
ipfs and image notification changes
2026-10-31 13:41:48 -07:00
zjs81 821479742d Fix repeater settings grey box, nameless discovered nodes and chip contrast
Repeater settings:
- The Advanced and Identity Keys cards store their expanded flag in
  PageStorage. Their TextFields' inner Scrollables shared that identifier,
  read the bool as a scroll offset and failed to build, which showed as a
  large grey box in release builds. Give each card's body its own storage
  scope. Regression test added.

Discovered contacts:
- Adverts parse the two optional 16-bit feature fields before the name,
  as MeshCore's AdvertDataParser does, so their bytes are no longer read
  as the name (a zero byte gave an empty name).
- A nameless advert or removal no longer wipes a known name.
- The discovery tile gives the name the full width (the type chip beside
  it squeezed it to nothing at large text sizes); the type moves to the
  key line as plain text, and an unnamed node shows its key prefix.
- The node scan sheet's type chip can shrink instead of the name.

Contrast:
- StatusChip draws its label in the normal text color; the icon or dot
  keeps the accent, adjusted to 3:1 against its tint. Avatar icons and
  initials get the same adjustment. Amber on its tint in the light theme
  was about 2:1.

Channel chat:
- Hashtag channels drop the redundant "Hashtag" subtitle label, and the
  region action moves into the overflow menu (tapping the title still
  opens it) so the channel name keeps its room.
2026-10-31 12:09:42 -07:00
edouard 3032be9bad feat: add reset to default for routing algorithm settings (#622)
- Add Reset button in routing settings with Icons.restart_alt
- Extract default values as constants in AppSettings to avoid duplication
- Add translations for all 18 supported languages
- Update documentation in settings.md
2026-10-31 04:53:21 +01:00
ericz 838773ba69 BigPicture image notification again. 2026-10-28 19:10:09 +01:00
ericz f415f0ad4e remove non Hotlink ipfs gateways 2026-10-28 18:48:48 +01:00
cano ca7b0e5813 Speed improvements for the Online Node Map, When there are too many objects on the map, some fancy stuff such as shadows or line borders are dropped. 2026-10-27 12:33:46 +01:00
zjs81 705267d98f Build repeater settings from a spec list and stop fetching them on open
Repeater settings:
- Each setting is declared once in repeaterSettingSpecs (key, section,
  input type, range, step, labels); the screen builds its control,
  refresh and save command from that list.
- Add flood.max.advert, flood.max.unscoped, rxdelay, cad, adc.multiplier
  and extra.sf. adc.multiplier and extra.sf note their hardware limits
  (extra.sf is LR2021 only and its get reply has no "> " prefix).
- Settings can be edited before they are fetched; only edited ones are
  sent. set radio needs freq, bw, sf and cr together, so a missing one
  is reported instead of silently skipping the radio.
- Check tx delays against the firmware's 0-2 range.
- Keep the not-loaded hint's list slot so the Advanced card doesn't
  collapse when the first value arrives.
- New "Auto-fetch repeater settings" app setting, off by default: each
  get is a LoRa round trip.

Fixes:
- Adding a discovered contact sent its advert time as lastmod, making it
  the oldest contact; with overwrite-oldest on a full table the next add
  evicted it and it reappeared in the discovered list. Let the radio
  stamp its own clock.
- Snackbars replace each other instead of queueing.

Translations: add the new strings in all locales and fix widespread
mistranslations in hu, ko, sk, sl and uk.
2026-10-25 14:46:31 -07:00
zjs81 82dcab1d92 Fix timeout observations, drop the last-rx feature and evict weak paths
- Record delivery observations with the path of the attempt the ACK
  belongs to, and skip ambiguous ACKs, so a late direct ACK is not
  learned as a flood delivery.
- Remove secondsSinceLastRx from the timeout model: it measured time
  since any companion frame, which was near zero at train and predict.
- When a contact's path history is full, evict the lowest-scoring path
  instead of silently dropping new discoveries.
2026-10-25 11:36:13 -07:00
zjs81 6213da118e Arm the telemetry send ack only after preparing the path
A background retry's RESP_CODE_SENT arriving while the path was being
prepared was taken as the telemetry request's ack, so its tag and timeout
replaced ours and a sensor's tagged reply was rejected.
2026-10-25 11:26:15 -07:00
zjs81 dfc4cd54d8 Keep telemetry fixes off the advert timestamp and across full syncs
Writing the telemetry time into lastSeen sent the phone's clock back to
the radio as the node's advert timestamp on the next path or flag write,
which could later make the radio's record look newer and drop the fix.
The fix now records its own telemetryFixAt and leaves lastSeen as the
advert time; the map and lists show the later of the two as last heard.

A full contact sync (pull to refresh, reconnect) cleared the list before
the radio resent it, so fixes were lost even for an unchanged advert.
They are now held for the sync and restored onto matching records.
2026-10-25 11:17:44 -07:00
zjs81 979e1a7d2a Fix layouts on small screens and large text, and test every screen
Contact rows give the name its own line (wrapping to two) with route and
last seen below, right-aligned on wide windows. Fixes overflows found by a
new widget test that renders every screen at 320x568 with text scales up to
2.0 and on a desktop window: region dropdown, contacts list, repeater CLI,
status grid and settings card, map cache buttons, and empty states.
Dropdowns truncate long labels, and option sheets and dialogs scroll.
2026-10-25 11:10:27 -07:00
zjs81 f0144ca959 Show telemetry GPS fixes on the map and add a map location request
Telemetry replies carried a GPS fix that was only shown on the telemetry
screen, so the map kept the node at its last advert position. The fix now
updates the contact and survives radio contact refreshes until the node
adverts again (compared on the node's own advert clock). The map node card
gains an "Update location" button for companions and sensors; repeaters
and rooms only share GPS with logged-in admins, so they don't get it.
2026-10-25 11:10:27 -07:00
zjs81 603172b3ec Batch per-frame persistence so busy meshes don't stall the UI isolate
Every received packet copy re-saved its channel's whole history, every
unread change re-saved the channel list, and adverts/path records re-saved
full contact and path-history blobs. Under load the SharedPreferences
backlog starved the Dart event loop (frames and timers stopped), the radio's
offline queue overflowed, and CPU stayed pinned after traffic ended.

- Add CoalescedWrites: keeps the latest write per key and runs them once
  per window (750 ms; 5 s for path history). Writes start synchronously so
  stores still read the current scoped key.
- Flush before the app is backgrounded, on disconnect, before switching
  radios, before the channel slot map changes, before channel history
  reloads, before deleteChannel drops a list, and before path history
  reloads an evicted contact.
- Cap in-memory channel history at ChannelMessageStore.maxStoredMessages;
  storage already kept only that many, but the list grew unbounded during a
  session and every save grew with it.
- Cache Contact.publicKeyHex and build pubKeyToHex from a hex-digit lookup; it was
  rebuilt on every equality/hash and per-advert contact scan.

Load test (fake TCP radio, 350 contacts, 17 channels, 10-150 packets/s,
Linux profile build): CPU at 10 packets/s 104% -> 45%, recovers to idle
after traffic instead of staying at 160%, and queued messages drained went
from 555 to 3237 over the same run.
2026-10-24 23:38:28 -07:00
zjs81 f58a76904a Reject malformed channel QR links and document channel QR scanning
A name with invalid percent-encoding (e.g. name=%FF) made
Uri.queryParameters throw from the scanner's validator. The parser now
returns null for it, with a regression test.

Update the channels and additional-features guides for the renamed
"Scan a QR Code" option, the supported channel link format, and its
limits.
2026-10-24 22:30:51 -07:00
zjs81 b1e968e7bf Scan official MeshCore channel QR codes
The QR scanner only read community codes, so the standard
meshcore://channel/add?name=...&secret=... links used by the official
app and sites like ipnt.uk were rejected as invalid community codes.

The scanner now also accepts channel links. It skips channels already on
the radio, asks before adding, and only uses a free slot after the
channel sync has finished. Also fills in the 59 untranslated strings in
all 17 locales.

Fixes #604
2026-10-24 22:26:09 -07:00
zjs81 a4670a9275 Add a setting to show link images in all chats by default
'Show link images in all chats by default' (default off) applies to
every channel and contact without an explicit per-chat choice: the
per-chat setting is now unset/on/off and resolves to perChat ?? default.
The 'Load images from links' master switch still overrides it.
2026-10-24 22:01:30 -07:00
zjs81 79e3668c18 Add a global switch to stop loading images from links
'Load images from links' (default on) gates every link image fetch in
MessageUrlImageHelper: chat previews, notification images, ipfs://
resolution and pyx/ibb scraping. Per-chat toggles keep their values but
are disabled while it is off. IPFS uploads are unaffected.
2026-10-24 22:01:29 -07:00
zjs81 7f5f71d070 Hide the IPFS API key and keep keyboard focus from corrupting it
Obscure the key with a show/hide toggle like the map API key dialog,
clear and restore the mask on focus changes instead of onTap, and only
save a key the user actually edited. Add ipfs.io as a named public
gateway preset now that it is the default.
2026-10-24 22:01:11 -07:00
zjs81 ee302f647b Keep the public IPFS gateway the user chose
Default to https://ipfs.io/ipfs/ like dev, keep saved gateways as they
are, and keep an explicitly cleared gateway deactivated across restarts
instead of rewriting public gateways to empty on every load.
2026-10-24 22:01:11 -07:00