Connection panel helpers¶
Developer reference for ConnectionPanel error humanization, last-connection rehydrate, storage migrations, or MeshCore chat-channel filtering. Repo-wide rules live in AGENTS.md.
- Error humanization:
connectionPanelErrorHumanize.ts— serial/HTTP/BLE user-facing hints (i18n); useselectronAPI.getPlatform(). - Last connection / reconnect rehydrate:
lastConnectionStorage.ts—mesh-client:lastConnection:<protocol>and BLE fallback keys; rebuild RF params after wake or GATT disconnect. The single last-connection record remains the auto-connect / wake MRU. - Saved device history:
connectionHistoryStorage.ts—mesh-client:connectionHistory:<protocol>list (BLE / serial / HTTP / TCP / UDP).useConnectionHistoryRecorder(mounted once fromApp) upserts on any LoRa identity reachingconfigured, even when ConnectionPanel shows another protocol; the panel also upserts for the visible protocol so form fields stay accurate. Device → Connection shows the Saved devices list (Reconnect / Delete) while connected or disconnected; the panel reloads from storage onconfigured/disconnectedso recorder writes are visible. Seeds fromlastConnectionwhen the history key is missing, or when the stored list is empty but an MRU still exists. Serial and WiFi rows also store the radio's owndeviceName(long name / callsign) via the panel'smyNodeNameprop and show it as the primary label with the endpoint underneath;upsertConnectionHistorykeeps an existing name when a later write omits it. BLE rows keepbleDeviceName(advertised device name). Names are display-only — dedup and reconnect still key off the transport endpoint. - Storage migrations:
connectionPanelStorageMigrations.ts— idempotent localStorage fixes on ConnectionPanel mount and frommain.tsxbefore React mount (MeshCore MQTT preset reconcile, Colorado port 443 migration, Colorado region-ack auto-launch gate, and IATA topic-prefix normalization). - MeshCore chat channel filter:
meshcoreConfiguredChatChannels.ts— zero-PSK slots excluded from unread badges and chat channel pills. - Planned-reboot reconnect (MeshCore): a companion reboot from the CLI settings sets
meshcorePlannedRebootRef; the reconnect cycle then setsplannedRebooton the connection record (connectionStore→useConnectionView) and the App banner showsconnectionBanner.rebootingReconnectAttemptinstead of a connection-loss message. The first reconnect attempt waits at leastMESHCORE_PLANNED_REBOOT_RECONNECT_DELAY_MS(8 s,firstAttemptMinDelayMs) for boot and BLE re-advertising; exhaustion or a manual disconnect clears the flag. See meshcore-companion-cli.md.
First-run protocol wizard (localStorage)¶
The welcome picker/tour is not SQLite-backed. Progress lives in renderer localStorage under mesh-client:firstRunWizard (FIRST_RUN_WIZARD_STORAGE_KEY in firstRunWizard.ts):
| Status | Meaning |
|---|---|
unseen |
Existing installs default here; wizard does not open until a fresh DB is detected. |
pending |
Shown on a new install but not finished; opens again on the next launch until done/skipped. |
done |
Finished or skipped; never shown again. |
useFirstRunWizardLauncher (mounted from App.tsx) decides when to surface the wizard. It opens when status is pending, or when status is unseen and window.electronAPI.db.wasCreatedThisLaunch is strictly true (fresh SQLite on this boot). IPC/read failures are intentionally fail-open — a broken wasCreatedThisLaunch call must not block startup. See firstRunWizardStore.ts and renderer-storage.md for durable vs ephemeral storage boundaries.