mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
2.2 KiB
2.2 KiB
Local display names for nodes
Users can set a local display name for any node. That name is shown in the app instead of the device’s long/short name, and is stored only on the device (not sent over the mesh).
Summary
| Storage | NodeDisplayNameStore (UserDefaults), keyed by node number |
| Scope | Node list, node detail, messages (user list & relay), compass waypoint name |
| Edit entry points | Long-press node → “Set display name”; Node detail → “Display name” row |
UI
- Node list – Rows show the custom display name when set, otherwise the device long/short name.
- Long-press menu – “Set display name” opens a sheet to set or clear the name.
- Node detail – Navigation title and a “Display name” row; tapping the row opens the edit sheet.
- Edit sheet – Text field for the local name, with options to save or clear the display name.
- Messages – User list and relay text use
displayLongName/displayShortName.
Technical details
- Key: Display names are stored and looked up by node number (
num), the unique node ID. - Persistence: UserDefaults key
nodeDisplayNames; JSON dictionary[String: String]with node num as string key. - Model:
UserEntityextensionsdisplayLongNameanddisplayShortName; they return the stored name if set, otherwise the existinglongName/shortName. - UI refresh:
NodeDisplayNameStore.didChangeNotificationis posted when a name is set or cleared; detail view subscribes to refresh the title.
Checklist
- Display name keyed by node number only
- Shown in list, detail, and messages; editable from list context menu and detail row
- Clear display name restores device name
- No change to device identity or protocol; local-only