mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-21 10:26:45 +00:00
feat(ui): make favourites mean one thing across every list
Three names had grown around one idea. "Favourite" was a filter in Settings, an invisible app-only flag on a contact, a device-settable bit on a channel, and — on the Nodes screen — a menu row that actually pinned to the Favourites dial. Nothing marked a favourite on screen, and the dial only took chat contacts. A favourite is now the starred flag (ContactInfo::flags bit 0 for contacts and rooms, ch_fav_bitmask for channels), settable on the device everywhere via a Fav: ON/OFF row, marked with a star on its row, and sorted to the top of the list — in Messages, Tools > Nodes and the Locator target picker. Settings > Contacts > "Favs top" turns the sorting off; it defaults on, and is stored inverted so an upgraded prefs file reads back as on rather than off. MyMesh::setContactFavourite() writes the same bit the app sets and bumps lastmod, so the two stay in sync. The DMs/Rooms = Fav list filters no longer depend on having starred someone in the app first. Pinning is now separate and explicit, and the dial takes contacts, room servers and channels. Slots carry a kind (NodePrefs::favourite_kinds, schema 0xC0DE0029) — a channel slot holds an index, so emptiness is decided by the kind first, since channel 0's payload is all zeroes. Choosing what to pin reuses the Messages screen's own Direct/Channels/Rooms browse instead of a second picker built on the dial, which drops that picker, its key/label tables and the now-unused getRecentDMContacts(). A filled tile gained Unpin/Replace under Hold Enter. Fixes a room server being pinnable and then unremovable: the picker's recent-conversations tier didn't filter by contact type and room posts share the DM history, opening one from the dial skipped the login handshake, and Unpin only existed in the chat contact list that rooms never appear in. Also: PopupMenu::_visible was written and never read (render recomputes the cap from display height), which is why menus with more items than the "visible" argument always worked; Settings' all/fav values and the dm_show_all comment said things that were not true. Built for Heltec V3, Wio Tracker L1, Wio Tracker L1 e-ink and T-Echo Card. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -109,18 +109,23 @@ Selecting the row opens a read-only list of the resolved hops — each shown as
|
||||
| Item | Action |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------ |
|
||||
| Mark as read | Clears unread counter for this contact |
|
||||
| Notif: default / OFF / ON | Per-contact notification override — **LEFT/RIGHT** to cycle |
|
||||
| Melody: global / M1 / M2 | Per-contact melody override — **LEFT/RIGHT** to cycle |
|
||||
| Notif: Default / OFF / ON | Per-contact notification override — **LEFT/RIGHT** to cycle |
|
||||
| Melody: Global / M1 / M2 | Per-contact melody override — **LEFT/RIGHT** to cycle |
|
||||
| Fav: ON / OFF | Mark this contact as a favourite — **LEFT/RIGHT** to toggle |
|
||||
| Pin to dial / Unpin (slot N) | Pin this contact to a Favourites Dial slot; if already pinned shows which slot |
|
||||
|
||||
**Fav** and **Pin to dial** are separate. **Fav** is the starred flag shared with the companion app: it marks the row with a ★, sorts it above the rest of the list (unless **Settings › Contacts › Favs top** is off), and drives the `DMs = Fav` list filter. **Pin to dial** puts the contact on the [Favourites Dial](../favourites_dial/favourites_dial.md) page and changes nothing about the list.
|
||||
|
||||
When **Pin to dial** is selected, a slot picker opens (Slot 1–6 showing current occupant name or "empty"). Choosing a slot that already holds another contact moves the new contact there.
|
||||
|
||||
In the **Rooms** list the context menu instead offers:
|
||||
|
||||
| Item | Action |
|
||||
| ------- | ---------------------------------------------------------------------------- |
|
||||
| Login… | Opens the password prompt to (re-)log in to this room (see Rooms — logging in) |
|
||||
| Logout | Only shown once logged in. Forgets the saved password so the next open prompts for one again |
|
||||
| Item | Action |
|
||||
| ------------- | ---------------------------------------------------------------------------- |
|
||||
| Login… | Opens the password prompt to (re-)log in to this room (see Rooms — logging in) |
|
||||
| Logout | Only shown once logged in. Forgets the saved password so the next open prompts for one again |
|
||||
| Fav: ON / OFF | Mark this room as a favourite — **LEFT/RIGHT** to toggle; drives the **Rooms = Fav** list filter |
|
||||
| Pin to dial / Unpin (slot N) | Pin this room to a [Favourites Dial](../favourites_dial/favourites_dial.md) slot |
|
||||
|
||||
---
|
||||
|
||||
@@ -135,9 +140,10 @@ In the **Rooms** list the context menu instead offers:
|
||||
| Item | Action |
|
||||
| ------------------------- | --------------------------------------------------------------------- |
|
||||
| Mark all read | Clears all unread for this channel |
|
||||
| Notif: default / OFF / ON | Per-channel notification override — **LEFT/RIGHT** to cycle |
|
||||
| Melody: global / M1 / M2 | Per-channel melody override — **LEFT/RIGHT** to cycle |
|
||||
| Notif: Default / OFF / ON | Per-channel notification override — **LEFT/RIGHT** to cycle |
|
||||
| Melody: Global / M1 / M2 | Per-channel melody override — **LEFT/RIGHT** to cycle |
|
||||
| Fav: ON / OFF | Add or remove this channel from favourites — **LEFT/RIGHT** to toggle |
|
||||
| Pin to dial / Unpin (slot N) | Pin this channel to a [Favourites Dial](../favourites_dial/favourites_dial.md) slot |
|
||||
| Edit | Opens the Add/Edit form below, pre-filled with the channel's name |
|
||||
| Delete | Removes the channel immediately (no confirm prompt) |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user