Show current group members first in the group editor

Members are listed first with a remove button each, followed by a searchable
list of contacts that are not in the group yet.
This commit is contained in:
zjs81 committed 2026-11-20 16:37:57 -07:00
1 parent 34ea0cb7ca
commit 7e04dda4d9
26 files changed
+881 -204

No files matched your search

+4 -2
View File
@@ -54,14 +54,16 @@ A toolbar at the top provides:
Groups are a client-side organizational feature for grouping contacts.
- **Create a group**: Tap the group dropdown → "+" icon → enter name → select members → Save
- **Create a group**: Tap the group dropdown → "+" icon → enter name → add members → Save
- **Edit a group**: Group dropdown → pencil icon next to the group
- **Delete a group**: Group dropdown → trash icon next to the group
- **Filter by group**: Select a group from the dropdown to show only its members
Groups are stored per radio identity (scoped by public key).
**Validation rules**: Group names cannot be empty, cannot be "all" (reserved, case-insensitive), and must be unique (case-insensitive). The group creation dialog includes a built-in search field to filter contacts when selecting members. Creating a new group automatically selects it as the active filter.
The group editor lists **Current members (N)** first, each with a remove button. Below it, **Add contacts** has a search field and lists only contacts that are not members yet; tap a row or its add button to add it. Changes apply when you tap Save. Removing a member only changes the group; the contact stays on the radio.
**Validation rules**: Group names cannot be empty, cannot be "all" (reserved, case-insensitive), and must be unique (case-insensitive). Creating a new group automatically selects it as the active filter.
## Tap Actions
+1
View File
@@ -119,6 +119,7 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act
| 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 |
| 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:)` |
| Editing a set of members | Current items first, then a searchable add list | Group editor (`contact_group_editor_dialog.dart`). Wrapping upper-case section label with the count ("Current members (N)"); each member row has a trailing `IconButton` remove (`error` colour, tooltip names the item); the add list excludes current members, and tapping the row or its `primary` add button adds it |
| 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 |
| Status | `StatusChip` | Mono label, coloured dot or icon |