diff --git a/README.md b/README.md
index 3435b71..f8076f8 100644
--- a/README.md
+++ b/README.md
@@ -390,8 +390,9 @@ to" picker on the Keychain screen and cannot be moved yet.
**A group can be moved too, and it takes its contents with it** — "Move to another vault…" on the group
card's right-click menu, beside Open, Edit and Delete, which is the whole of what can be done to a group on
-the desktop. That is the desktop only, because the phone draws groups as headings in the host list and has
-never had a way to delete or move one. It is the same re-seal
+the desktop. The phone has the same three on a sheet raised from the group's heading, since it draws no
+cards and has no right-click; it does not have Open, because its list shows the whole tree flat and there is
+nothing to open a group into. It is the same re-seal
and tombstone underneath, applied to every item involved: the group, the groups nested inside it, and every
host filed under any of them, each taking a new id in the destination. Moving less than that was never
coherent — the machines and the child groups are items of the vault the group is leaving, so a group that
@@ -500,9 +501,12 @@ transfer starts, the download runs into the cache, and the finished bytes are co
chose. That order has one visible cost, and the screen says it rather than leaving it to be discovered: the
picker creates the file when you dismiss it, so a download that then fails leaves an empty one there. The
alternative is a picker that appears minutes later over whatever you moved on to — and often while the app
-is in the background, where Android will not show one at all. Hosts and groups are made and corrected here now, from
-a floating + on the Hosts screen, and both editors are cards in the list's own row rather than dialogs, so
-the form never covers the thing it is about. The keychain has no editor of its own: SSH keys and buckets are
+is in the background, where Android will not show one at all. Hosts and groups are made, corrected and taken
+away here now, from a floating + on the Hosts screen and a menu on each group's heading, and both editors are
+cards in the list's own row rather than dialogs, so the form never covers the thing it is about. Every
+question a deletion asks is the desktop's, counted the same way and drawn in the place the buttons that
+asked it were — including the tick deciding whether a group's machines go with it. The keychain has no
+editor of its own: SSH keys and buckets are
created on the desktop and sync down, and the phone will delete an item — behind the same counted
confirmation — without offering to change it. What this head does make, it makes where the need arises
rather than in an editor: a tag from inside a host's editor, and a credential from the connect bar's
diff --git a/docs/android-port.md b/docs/android-port.md
index dbebd99..4ae7fc9 100644
--- a/docs/android-port.md
+++ b/docs/android-port.md
@@ -604,8 +604,20 @@ What is left, in the order it matters:
the decision above for the shape and for the one thing about it a person will notice — an empty file where
a failed download was pointed. What is *not* built is a folder picker for several downloads at once: the
save picker names one destination, so SAVE FILE takes the selected row.
-- **Editors.** There is no host editor and no keychain item editor on the phone, so both are create-on-
- desktop-and-sync. That is why the v2 design's `+` buttons on HOSTS and on the keychain are not drawn.
+- ~~**Editors.**~~ **Half built.** The v3 hosts screen has both a host editor and a group editor — cards in
+ the list's own row, swapped for the list rather than stacked over it — reached from the design's floating
+ `+` through a sheet asking which of the two is being added. The keychain still has none, so keys,
+ passwords and buckets remain create-on-desktop-and-sync; its one action is DELETE.
+
+ **And everything can now be taken away as well as made.** DELETE under a host, and a group menu on the
+ heading carrying Edit, Move to another vault and Delete — the desktop's card menu, as a bottom sheet,
+ because this head draws no group cards and has no right-click. Both questions replace the controls that
+ asked them rather than stacking over them, which is the rule this document's step 7 already recorded for
+ the keychain's. A screen that could fill a keychain and never empty one was the shape before it.
+
+ The one entry the phone's menu does not carry is Open. The desktop's grid holds one level of the group
+ tree at a time and this list holds all of it flattened, so there is nothing here to open a group *into* —
+ see the correction under *Sidebar* above, which is the same difference stated from the other end.
- **Pins and import**, which v2 does not draw either. Teams *is* drawn, behind MORE — it was the one of
the three whose view model needed nothing new on the phone, because none of that screen is vault content.
- **The App Link upgrade**, unchanged from step 5.
diff --git a/docs/design-import-gaps.md b/docs/design-import-gaps.md
index 131b6c3..c307536 100644
--- a/docs/design-import-gaps.md
+++ b/docs/design-import-gaps.md
@@ -52,6 +52,9 @@ the chrome, hosts and terminals, file transfer, the vault, teams, and preference
> | A 14px rounded inset around the terminal | Not drawn. The renderer is a native child view composited above everything Avalonia draws, so a rounded frame behind it clips nothing. What the design was after comes from the page's own background, which is the design's `#171A26`. |
> | Instrument Sans / Fira Code | Inter and the system monospace stack, as before and for the same reason — see the note on `MonoFont` in `Palette.axaml`. |
> | A theme toggle (`☀`) in the header, and the desktop v2's light theme | Omitted. There is one theme by decision, and a switch with one position is a control that does nothing. |
+> | Nothing at all on a group beyond its heading | ◆ **A menu on the heading, which is the second thing on this list the design had no slot for.** The desktop puts Edit, Move to another vault and Delete on the group's own card; this head draws no group cards and has no right-click, so the `⋯` raises the add sheet's shape with the same three entries in the same order — Move above the rule because it is not a deletion, Delete below it. Open is the one entry it does not carry: the desktop's grid holds one level of the tree and this list holds all of it flattened, so there is nowhere to open a group *into*. It was a pencil alone while Edit was the only thing behind it. |
+> | Nothing that removes a host | ◆ **DELETE, on a row of its own under EDIT and MOVE.** A phone has no hover and no tooltip, so where a thumb lands is the only thing separating a destructive button from an ordinary one — full width in the danger colour, below both, is the same arrangement KEYCHAIN uses. The counted question takes the bar's controls in place rather than stacking over them, which is what stops DELETE being pressed a second time under its own confirmation. Until v3 this head could fill a keychain and never empty one. |
+> | PREFERENCES, which v2 draws as a list of settings | ◆ **One setting, one fact, and a paragraph of absences.** The setting is whether this phone may unlock with a fingerprint — see the screen. The fact is the running version, which matters more here than on the desktop: there it sits beside a CHECK NOW that will say whether it is current, and this head does not replace itself at all. What it says instead is where a newer one comes from, which is ADR 0011 rule 2 in plain words — never from the server you sign in to. |
> | TERMINAL's empty state: a sentence saying nothing is open | ◆ **More than the design asked for, which is rare enough on this list to say out loud.** The tab is called **Connections** and with nothing running the screen is where one is made: a box taking `user@host` or `user@host:port` with a password, and the machines most recently connected to underneath it, read from the vault's own connection log. The box is the only path in the product to a machine that is not in the keychain — the design assumes every connection starts from a saved host, and the case it has no answer for is an address somebody was handed five minutes ago. Nothing typed there is saved, and the screen says so. |
>
> ## The desktop's v2
diff --git a/docs/manual-checks.md b/docs/manual-checks.md
index a8f5109..f7a1b9c 100644
--- a/docs/manual-checks.md
+++ b/docs/manual-checks.md
@@ -847,10 +847,10 @@ add a bucket — then come back.
---
-## Phase 8 — Adding hosts on the phone
+## Phase 8 — Adding and removing on the phone's host list
-Nine checks, and the reason there are nine rather than none is worth stating: **the layout suite cannot see
-any of this and structurally never will.** `DodoSSH.Client.App.Layout.Tests` targets `net10.0` and
+Thirteen checks, and the reason there are thirteen rather than none is worth stating: **the layout suite
+cannot see any of this and structurally never will.** `DodoSSH.Client.App.Layout.Tests` targets `net10.0` and
`DodoSSH.Client.Android` targets `net10.0-android`, so a project reference is impossible; Avalonia's
application, dispatcher and platform are one-shot process globals, so a second head cannot share the
process either; and the phone's numbers only mean anything measured under the phone's own style graph.
@@ -936,15 +936,87 @@ Tap + → New host, then use the back gesture.
**Pass:** the editor closes and the list is back, with the boxes cleared. Back again leaves the application
— HOSTS is the screen the app opens on and back from it should exit, as it always did.
+Repeat with the group menu: tap the `⋯` on a group heading, then back.
+
+**Pass:** the menu closes and nothing is armed behind it — no editor, no question, no move panel.
+
### 8.9 Every target is a thumb's size
-Walk the sheet's two rows, the editor's fields, both pickers, the checkbox and the four buttons.
+Walk both sheets' rows, the editor's fields, both pickers, the checkbox and the four buttons.
**Pass:** nothing is under 44 effective pixels tall.
**Failure means:** a control took its size from its glyph. The desktop suite's only tap-target assertion has
a floor of 20 pixels — set for a mouse — so copying it here would certify a target no thumb can hit.
+### 8.10 The group menu names its group, and the heading still fits
+
+Needs a vault with at least one group holding a host. On HOSTS, look at the group's heading row first.
+
+**Pass:** chevron, name, count and a `⋯` all on one line, with the name trimmed rather than pushing the
+count off the right edge. On a shared session the vault badge is between the name and the count and the name
+gives way before the badge does.
+
+Tap the `⋯`.
+
+**Pass:** a sheet rises carrying **GROUP** and the group's own name, then three rows — Edit, Move to another
+vault, a rule, and Delete in the danger colour — each with a sentence under it, and CANCEL. Tapping the
+scrim closes it.
+
+**Failure means:** if the name is missing, the sheet is bound to the wrong thing; the whole point of naming
+it is that the heading it was raised from may have scrolled away under the scrim.
+
+### 8.11 Deleting a group asks the second question
+
+`⋯` → Delete on a group with at least two hosts filed under it.
+
+**Pass:** a question above the list, naming the group, saying how many hosts are filed under it and that
+left alone they move to UNGROUPED — with an **unticked** box offering to delete them as well, below the
+count and not above it. DELETE and KEEP under that.
+
+Press KEEP, then raise the question again on a *different* group.
+
+**Pass:** the box is unticked again. A tick carried over from the last question would delete a second
+group's machines on the strength of a decision about the first.
+
+Now tick it and press DELETE.
+
+**Pass:** the group and its hosts are gone. Untick it on a third group and the hosts survive under UNGROUPED.
+
+### 8.12 Moving a group names the shelf · **needs a second writable vault**
+
+`⋯` → Move to another vault.
+
+**Pass:** a panel above the list reading **MOVE GROUP** and the group's name, a vault picker that does not
+offer the vault it is already in, the paragraph about what stays behind, and MOVE / CANCEL.
+
+Press MOVE.
+
+**Pass:** the group, the groups nested inside it and every host under any of them are in the other vault,
+the group is at the top level, and the status line says so.
+
+**Failure means:** if MOVE appears to do nothing at all, the command is reading the desktop's group
+selection, which this head never sets. That is the exact failure the header-aimed commands exist to prevent
+— see `VaultViewModel.MoveGroupFromHeading`.
+
+With only one writable vault, the entry answers on the status line instead and no panel opens. That is the
+intended answer, not a failure.
+
+### 8.13 DELETE under a host is not beside EDIT
+
+Select a host so the connect bar rises.
+
+**Pass:** CONNECT, then EDIT and MOVE side by side, then DELETE full width in the danger colour on a row of
+its own beneath them. On a host with nowhere to move to, MOVE is absent and the row is EDIT alone.
+
+Press DELETE.
+
+**Pass:** the question takes the whole bar — no CONNECT, no EDIT, no second DELETE underneath it — and KEEP
+puts them back with the host still there.
+
+**Failure means:** a bar that kept its buttons under the question is one where DELETE can be pressed twice,
+the second press landing on whatever the list rebuilt underneath.
+
---
## Phase 9 — Tag chips and the picker
@@ -1406,6 +1478,18 @@ rather than two. There is no confirmation prompt, deliberately.
**Failure means:** a phone that still unlocks itself after this is the local half not happening, which is the
half that matters when the handset is the thing that was lost.
+### 13.6 The phone says which build it is
+
+Scroll the same screen to **THIS BUILD**.
+
+**Pass:** a VERSION row carrying a real version rather than `1.0.0`, matching the tag the APK was built
+from, with the paragraph under it saying this head does not replace itself and that no DodoSSH server will
+ever offer you a newer one.
+
+**Failure means:** `1.0.0` is MinVer answering from a checkout with no tags — see check 16.5 for the same
+failure on the desktop. A missing paragraph means `Updates.IsUnsupported` came back false on a head that
+has no updater at all, which would be the null channel not being the one composed.
+
---
## Phase 14 — Moving files to and from the phone's remote
diff --git a/src/DodoSSH.Client.Android/Views/HostsScreen.axaml b/src/DodoSSH.Client.Android/Views/HostsScreen.axaml
index 684f2fd..ad837cd 100644
--- a/src/DodoSSH.Client.Android/Views/HostsScreen.axaml
+++ b/src/DodoSSH.Client.Android/Views/HostsScreen.axaml
@@ -89,6 +89,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -144,16 +232,21 @@
VerticalAlignment="Center" />
-
@@ -470,12 +563,14 @@
-
+
@@ -522,7 +617,7 @@
so it is a re-seal into one and a tombstone in the other — nothing a SAVE could do. It shows only
where there is somewhere to move to; see VaultViewModel.CanMoveSelectedHost.
-->
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/DodoSSH.Client.Android/Views/PhoneShell.axaml.cs b/src/DodoSSH.Client.Android/Views/PhoneShell.axaml.cs
index 244edd8..344ff27 100644
--- a/src/DodoSSH.Client.Android/Views/PhoneShell.axaml.cs
+++ b/src/DodoSSH.Client.Android/Views/PhoneShell.axaml.cs
@@ -370,8 +370,8 @@ internal sealed partial class PhoneShell : UserControl
/// Whether anything was closed, and so whether back has been spent.
///
///
- /// Order is the whole of it. The add sheet sits over the list and the two editors sit in place of it, so
- /// the sheet has to go first — closing an editor while a sheet was open would leave the sheet floating
+ /// Order is the whole of it. The two sheets sit over the list and the two editors sit in place of it, so
+ /// a sheet has to go first — closing an editor while a sheet was open would leave the sheet floating
/// over a list nobody asked to see, and the second back would then close the sheet rather than the
/// editor the user was looking at.
///
@@ -394,6 +394,16 @@ internal sealed partial class PhoneShell : UserControl
return true;
}
+ // The other sheet, and it is checked beside the first rather than after the editors for the same
+ // reason: it is raised over the list, so it is the nearest thing on screen. The two cannot be open
+ // at once — one is raised by the +, the other by a heading, and each hides the list the other's
+ // control is on — so their order between themselves decides nothing.
+ if (vault.GroupSheet is not null)
+ {
+ vault.CloseGroupSheetCommand.Execute(null);
+ return true;
+ }
+
if (vault.IsEditing)
{
vault.CancelEditCommand.Execute(null);
diff --git a/src/DodoSSH.Client.Android/Views/PreferencesScreen.axaml b/src/DodoSSH.Client.Android/Views/PreferencesScreen.axaml
index 74c6b00..678d599 100644
--- a/src/DodoSSH.Client.Android/Views/PreferencesScreen.axaml
+++ b/src/DodoSSH.Client.Android/Views/PreferencesScreen.axaml
@@ -81,6 +81,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/DodoSSH.Client.Shell/ViewModels/VaultViewModel.cs b/src/DodoSSH.Client.Shell/ViewModels/VaultViewModel.cs
index ef68f96..342cc6e 100644
--- a/src/DodoSSH.Client.Shell/ViewModels/VaultViewModel.cs
+++ b/src/DodoSSH.Client.Shell/ViewModels/VaultViewModel.cs
@@ -1994,6 +1994,7 @@ internal sealed partial class VaultViewModel(
///
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(ShowsHostPaneActions))]
+ [NotifyPropertyChangedFor(nameof(ShowsConnectControls))]
private bool isMovingHost;
/// Which host the open move panel is about. Null when it is closed.
@@ -2056,11 +2057,22 @@ internal sealed partial class VaultViewModel(
[ObservableProperty]
private VaultChoiceViewModel? selectedMoveGroupVault;
+ /// The group the open move panel is about, by name.
+ ///
+ /// For the phone, which draws this panel over its host list rather than beside the card it was opened
+ /// from — so unlike the desktop, where the group's own tile is on screen underneath the picker, there is
+ /// nothing left saying which shelf is about to move. The same reason its connect bar names the host.
+ /// Held rather than read back through , which is a desktop selection and is
+ /// null on the head that needs this.
+ ///
+ [ObservableProperty]
+ private string movingGroupLabel = string.Empty;
+
// There is deliberately no CanMoveGroup to match CanMoveSelectedHost. That one exists so the phone can
- // leave a button out rather than draw one that answers with a refusal; a group is reached through the
- // card's right-click menu, which is not drawn until it is opened and whose entries do not move. The one
- // place the question decides anything is MoveGroup, which asks it by building the picker and saying so
- // when it comes back empty.
+ // leave a button out rather than draw one that answers with a refusal; a group is reached through a menu
+ // on both heads — the desktop's right-click, the phone's sheet — and a menu is not drawn until it is
+ // opened and its entries do not move. The one place the question decides anything is MoveGroup, which
+ // asks it by building the picker and saying so when it comes back empty.
///
/// What the drawer's header says it is about.
@@ -2118,16 +2130,47 @@ internal sealed partial class VaultViewModel(
[NotifyPropertyChangedFor(nameof(ShowsConnectBar))]
private bool isAddSheetOpen;
+ ///
+ /// The group heading the phone's action sheet is open on, or null when it is closed.
+ ///
+ ///
+ ///
+ /// The phone's answer to the desktop's right-click menu, and it holds a heading rather than a row
+ /// because a heading is what its list draws — see for why a group
+ /// there is not a thing that can be selected, which is what leaves the three commands with nothing to
+ /// aim at unless the gesture carries it.
+ ///
+ ///
+ /// One nullable property rather than a flag beside a field, so that "open" and "open on what" cannot
+ /// disagree — the sheet names the group in its own title, and a flag left true beside a cleared header
+ /// would be a menu about nothing.
+ ///
+ ///
+ /// The heading is not resolved to a group until one of the entries is pressed. A sheet is a menu and
+ /// deciding not to use it is a perfectly good outcome, so nothing is looked up on the way in; a heading
+ /// whose group has gone by the time an entry is pressed is dropped there. See .
+ ///
+ ///
+ [ObservableProperty]
+ [NotifyPropertyChangedFor(nameof(AnEditorIsOpen))]
+ [NotifyPropertyChangedFor(nameof(ShowsConnectBar))]
+ [NotifyPropertyChangedFor(nameof(GroupSheetLabel))]
+ private SidebarGroupHeader? groupSheet;
+
+ /// Which group the sheet says it is about.
+ internal string GroupSheetLabel => GroupSheet?.Label ?? string.Empty;
+
///
/// Whether anything the host screen can put over its list is showing.
///
///
- /// One property rather than three tests at each call site, and it exists because two controls need
+ /// One property rather than four tests at each call site, and it exists because two controls need
/// exactly this question and would otherwise each answer it their own way: the floating + hides
/// while any of them is up — a button that opens an editor on top of an open editor is a button that
/// does nothing — and the back gesture closes them before it considers leaving the screen.
///
- internal bool AnEditorIsOpen => IsAddSheetOpen || IsEditing || IsEditingGroup;
+ internal bool AnEditorIsOpen =>
+ IsAddSheetOpen || GroupSheet is not null || IsEditing || IsEditingGroup;
///
/// Whether the phone's connect bar has anything to be about.
@@ -2140,6 +2183,22 @@ internal sealed partial class VaultViewModel(
///
internal bool ShowsConnectBar => SelectedHost is not null && !AnEditorIsOpen;
+ ///
+ /// Whether the phone's connect bar is showing its own controls rather than one of the two panels that
+ /// take their place.
+ ///
+ ///
+ /// The bar carries three things and draws one of them: connecting to the host, the picker asking which
+ /// vault to move it to, and the question asking whether to delete it. This is the first, and the reason
+ /// it is a property rather than two conditions in the markup is that Avalonia's bindings have no "and".
+ ///
+ /// It is the same rule carries for the desktop's drawer, minus that
+ /// one's IsShowingHostDetail: the phone has no pane to open, so its bar's own
+ /// already answers whether there is a host at all.
+ ///
+ ///
+ internal bool ShowsConnectControls => !IsMovingHost && !IsConfirmingHostDeletion;
+
[ObservableProperty]
private string editorLabel = string.Empty;
@@ -4985,6 +5044,62 @@ internal sealed partial class VaultViewModel(
Status = $"Editing {row.Label}.";
}
+ ///
+ /// Raises the phone's menu of the three things that can be done to a group.
+ ///
+ ///
+ ///
+ /// The desktop's right-click menu, as a bottom sheet, and the same three entries in the same order for
+ /// the same reasons: opening is a gesture on the desktop and so is offered here as well, moving sits
+ /// above the separator because it is not a deletion, and deleting sits below it.
+ ///
+ ///
+ /// Open is the entry this one does not carry, and the difference is real rather than an
+ /// abbreviation: the desktop's grid holds one level of the tree at a time and the phone's list holds all
+ /// of it flattened, so there is nothing on this head to open a group into. See the note on
+ /// SidebarRows in the desktop's HostsScreen.
+ ///
+ ///
+ /// It is a menu rather than three buttons on the heading row, and that is a width decision before it is
+ /// a taste one: the row already carries a chevron, a name, a vault badge and a count at 360dp, and three
+ /// icons after them would leave the name a dozen characters. It is also what makes the two destructive
+ /// entries reachable without either of them being a control a thumb can brush.
+ ///
+ ///
+ [RelayCommand]
+ private void OpenGroupSheet(SidebarGroupHeader? header)
+ {
+ // The ungrouped heading has no group behind it, so there is nothing for the three entries to act on.
+ // The button is left off that row as well; this is the guard for the path a stale row would take.
+ if (header?.GroupId is not null)
+ {
+ GroupSheet = header;
+ }
+ }
+
+ /// Closes the group's menu without doing anything.
+ ///
+ /// Reached from CANCEL and from a tap on the scrim, and the sheet is dismissible that way for the reason
+ /// the add sheet is and the host key sheet deliberately is not: "which of these three" has no wrong
+ /// answer, and none of them is one of them.
+ ///
+ [RelayCommand]
+ private void CloseGroupSheet() => GroupSheet = null;
+
+ ///
+ /// The group a heading in the host list names, or null where it names none.
+ ///
+ ///
+ /// A heading carries an id, a label and a count; every one of the three commands below needs the record.
+ /// A heading whose group has gone — the ungrouped heading, or one a sync deleted between the list being
+ /// drawn and the entry being pressed — resolves to nothing and is dropped, rather than opening an editor
+ /// or arming a question on nothing.
+ ///
+ private HostGroupRowViewModel? GroupOf(SidebarGroupHeader? header) =>
+ header?.GroupId is { } groupId
+ ? Groups.FirstOrDefault(row => row.EntityId == groupId)
+ : null;
+
///
/// Opens a group's editor from its heading in the host list.
///
@@ -4994,8 +5109,8 @@ internal sealed partial class VaultViewModel(
/// desktop reaches the group editor through the groups panel, which selects a
/// HostGroupRowViewModel; the phone draws no such panel, and its host list draws
/// SidebarGroupHeader rows whose selection deliberately bounces back to the host — a heading is
- /// not a thing to be selected. So the heading needs a button, and the button needs a command that takes
- /// the header rather than the selection.
+ /// not a thing to be selected. So the heading needs a menu, and the menu's entries need commands that
+ /// take the header rather than the selection.
///
///
/// A + that adds groups with no way to correct one is the same strange thing to ship as a
@@ -5003,28 +5118,66 @@ internal sealed partial class VaultViewModel(
/// inherited: getting one wrong is wrong for every host beneath it at once.
///
///
- /// Resolves the heading back to a row rather than trusting it, because a heading carries an id and a
- /// label and the editor needs the record. A heading whose group has gone — the ungrouped heading, or one
- /// deleted by a sync between the list being drawn and the button being pressed — is ignored rather than
- /// opening an editor on nothing.
- ///
- ///
/// The row is handed to rather than selected first, which it used to be. A group
/// selection now clears the host selection — the two grids share one mark — and the phone draws no group
/// cards, so selecting one here would have taken the highlight off the machine in the list with nothing
/// on screen to say where it had gone.
///
+ ///
+ /// The sheet is closed first and unconditionally, including where the heading resolves to nothing. A
+ /// menu left standing over a command that declined to run is a menu somebody presses again.
+ ///
///
[RelayCommand]
private void EditGroupFromHeading(SidebarGroupHeader? header)
{
- if (header?.GroupId is not { } groupId
- || Groups.FirstOrDefault(row => row.EntityId == groupId) is not { } row)
- {
- return;
- }
+ var row = GroupOf(header);
- EditGroupCommand.Execute(row);
+ GroupSheet = null;
+
+ if (row is not null)
+ {
+ EditGroupCommand.Execute(row);
+ }
+ }
+
+ /// Opens the group's move panel from its heading in the host list.
+ ///
+ /// Aimed by the header rather than by , which is the whole reason this exists:
+ /// that property reads the selected card or the open group, and the phone has neither — so
+ /// called bare on this head would silently do nothing at all. The sheet is
+ /// closed first, on 's terms.
+ ///
+ [RelayCommand]
+ private void MoveGroupFromHeading(SidebarGroupHeader? header)
+ {
+ var row = GroupOf(header);
+
+ GroupSheet = null;
+
+ if (row is not null)
+ {
+ MoveGroupCommand.Execute(row);
+ }
+ }
+
+ /// Asks the group's deletion question from its heading in the host list.
+ ///
+ /// Aimed by the header for the reason is, and it matters more here:
+ /// a that quietly aimed at nothing would be a DELETE that appeared to have
+ /// been pressed and had not.
+ ///
+ [RelayCommand]
+ private void DeleteGroupFromHeading(SidebarGroupHeader? header)
+ {
+ var row = GroupOf(header);
+
+ GroupSheet = null;
+
+ if (row is not null)
+ {
+ DeleteGroupCommand.Execute(row);
+ }
}
/// Starts a new group, inside whichever one the screen is showing.
@@ -5325,14 +5478,21 @@ internal sealed partial class VaultViewModel(
/// refuses for the same reason.
///
///
- /// Aims where Edit does: at the selected card, which on the desktop is the one the menu opened on. See
- /// .
+ /// Aims where Edit does: at the group it is handed, and failing that at the selected card, which on the
+ /// desktop is the one the menu opened on. See .
+ ///
+ ///
+ /// The argument is the phone's and the fallback is the desktop's. The desktop's menu passes
+ /// nothing, because the code-behind has already selected whatever was right-clicked; the phone has no
+ /// group selection to make — a heading is not a thing its list can select — so its sheet passes the row
+ /// it was opened on. See .
///
///
+ /// The group to ask about, or null to use .
[RelayCommand]
- private void DeleteGroup()
+ private void DeleteGroup(HostGroupRowViewModel? group)
{
- if (GroupTarget is not { } row)
+ if ((group ?? GroupTarget) is not { } row)
{
return;
}
@@ -5850,11 +6010,16 @@ internal sealed partial class VaultViewModel(
/// Refused for a group written by a newer client, as editing one is, and refused with a host editor open,
/// as is: this rewrites hosts.
///
+ ///
+ /// The argument is the phone's and the fallback is the desktop's, exactly as it is on
+ /// . See .
+ ///
///
+ /// The group to move, or null to use .
[RelayCommand]
- private void MoveGroup()
+ private void MoveGroup(HostGroupRowViewModel? group)
{
- if (GroupTarget is not { } row || AHostEditorIsInTheWay() || AGroupEditorIsInTheWay())
+ if ((group ?? GroupTarget) is not { } row || AHostEditorIsInTheWay() || AGroupEditorIsInTheWay())
{
return;
}
@@ -5877,6 +6042,7 @@ internal sealed partial class VaultViewModel(
// As MoveHost disarms a deletion aimed at the same host.
PendingDeletion = null;
movingGroupId = row.EntityId;
+ MovingGroupLabel = row.Label;
IsMovingGroup = true;
Status = string.Empty;
}
@@ -5892,6 +6058,7 @@ internal sealed partial class VaultViewModel(
IsMovingGroup = false;
movingGroupId = null;
+ MovingGroupLabel = string.Empty;
MoveGroupVaultChoices.Clear();
SelectedMoveGroupVault = null;
Status = string.Empty;
@@ -5928,12 +6095,20 @@ internal sealed partial class VaultViewModel(
/// exist for. What is reported is a binding now outside the destination, since that is precisely what
/// the other holders of it will not be able to resolve.
///
+ ///
+ /// The group is resolved from the panel's own id rather than from . That
+ /// property is the desktop's selection and is null on the phone, whose sheet aims the move by handing
+ /// the row in — so reading it here would leave the phone's MOVE button doing nothing at all. It also
+ /// says the honest thing on both heads: what this moves is the shelf the panel was opened on, and a
+ /// selection that has since gone elsewhere has already folded the panel away. See
+ /// .
+ ///
///
[RelayCommand]
private async Task ConfirmMoveGroupAsync(CancellationToken cancellationToken)
{
- if (GroupTarget is not { } row
- || movingGroupId != row.EntityId
+ if (movingGroupId is not { } moved
+ || Groups.FirstOrDefault(group => group.EntityId == moved) is not { } row
|| SelectedMoveGroupVault is not { } target)
{
return;
@@ -8831,6 +9006,7 @@ internal sealed partial class VaultViewModel(
OnPropertyChanged(nameof(IsConfirmingGroupDeletion));
OnPropertyChanged(nameof(ShowsHostActions));
OnPropertyChanged(nameof(ShowsHostPaneActions));
+ OnPropertyChanged(nameof(ShowsConnectControls));
OnPropertyChanged(nameof(ShowsItemActions));
}
diff --git a/tests/DodoSSH.Client.App.Tests/ShellFlowTests.cs b/tests/DodoSSH.Client.App.Tests/ShellFlowTests.cs
index 535664f..252f6f1 100644
--- a/tests/DodoSSH.Client.App.Tests/ShellFlowTests.cs
+++ b/tests/DodoSSH.Client.App.Tests/ShellFlowTests.cs
@@ -4576,6 +4576,180 @@ public sealed class ShellFlowTests : IAsyncLifetime
vault.IsEditingGroup.ShouldBeFalse();
}
+ ///
+ ///
+ /// The load-bearing half of giving the phone a group menu, and the reason the commands take a header at
+ /// all. DeleteGroup and MoveGroup aim at GroupTarget, which is the selected card or
+ /// the open group — and the phone has neither, because its list draws headings and a heading is not a
+ /// thing that list can select. Called bare on that head they would return having done nothing, which is
+ /// a DELETE that appears to have been pressed and has not.
+ ///
+ ///
+ /// The tick is asserted off as well as present. Off is "the machines stay and turn up under
+ /// UNGROUPED", which is recoverable; on is not, and a question that arrived with the destructive answer
+ /// already given would be worse than one that never asked.
+ ///
+ ///
+ [Fact]
+ public async Task AGroupsHeading_AsksAboutThatGroupWithNothingSelected()
+ {
+ await UnlockedAsync();
+ var vault = shell.Vault!;
+
+ await AddHostAsync(vault, "prod-db");
+ await AddGroupAsync(vault, "production");
+ await FileAsync(vault, "prod-db", "production");
+
+ var heading = vault.SidebarRows.OfType().Single(
+ row => string.Equals(row.Label, "production", StringComparison.Ordinal));
+
+ vault.GroupTarget.ShouldBeNull("the phone selects no card and opens no group");
+
+ vault.OpenGroupSheetCommand.Execute(heading);
+
+ vault.GroupSheetLabel.ShouldBe("production", "the menu names what it is about");
+ vault.AnEditorIsOpen.ShouldBeTrue("so the + stands down, as it does under the add sheet");
+
+ vault.DeleteGroupFromHeadingCommand.Execute(heading);
+
+ vault.GroupSheet.ShouldBeNull("the menu closes behind the entry that was pressed");
+ vault.IsConfirmingGroupDeletion.ShouldBeTrue();
+ vault.PendingDeletion!.Question.ShouldContain("production");
+ vault.PendingDeletion.HasChoice.ShouldBeTrue("a host is filed under it, so it has a second question");
+ vault.DeletionTakesTheHostsToo.ShouldBeFalse("keeping them is the answer that needs no decision");
+ }
+
+ ///
+ /// A menu is a thing you are allowed to decide against, which is why this one is dismissible where the
+ /// host key sheet deliberately is not. Nothing may be left armed behind it.
+ ///
+ [Fact]
+ public async Task TheGroupsMenu_WavedAway_LeavesEverythingAsItWas()
+ {
+ await UnlockedAsync();
+ var vault = shell.Vault!;
+
+ await AddHostAsync(vault, "prod-db");
+ await AddGroupAsync(vault, "production");
+ await FileAsync(vault, "prod-db", "production");
+
+ var heading = vault.SidebarRows.OfType().Single(
+ row => string.Equals(row.Label, "production", StringComparison.Ordinal));
+
+ vault.OpenGroupSheetCommand.Execute(heading);
+ vault.CloseGroupSheetCommand.Execute(null);
+
+ vault.GroupSheet.ShouldBeNull();
+ vault.AnEditorIsOpen.ShouldBeFalse();
+ vault.IsConfirmingDeletion.ShouldBeFalse();
+ vault.IsMovingGroup.ShouldBeFalse();
+ vault.IsEditingGroup.ShouldBeFalse();
+ }
+
+ [Fact]
+ public async Task TheUngroupedHeading_RaisesNoMenu()
+ {
+ // Nothing behind it for the three entries to act on. The button is left off that row, so this is the
+ // guard for the path the markup does not control.
+ await UnlockedAsync();
+ var vault = shell.Vault!;
+
+ await AddHostAsync(vault, "prod-db");
+ await AddGroupAsync(vault, "production");
+
+ var ungrouped = vault.SidebarRows.OfType()
+ .Single(row => row.GroupId is null);
+
+ vault.OpenGroupSheetCommand.Execute(ungrouped);
+
+ vault.GroupSheet.ShouldBeNull();
+ }
+
+ // ---- Deleting a host, from the phone's bar ----
+
+ ///
+ ///
+ /// The phone's bar carries three things and draws one of them: connecting, the picker asking which vault
+ /// to move the host to, and this question. What is pinned here is that the question takes the
+ /// controls rather than appearing under them — DELETE pressable a second time underneath its own
+ /// confirmation is the reason the desktop's drawer has the same rule.
+ ///
+ ///
+ /// The bar itself stays up, and that is the other half: it is where the question is drawn. A question in
+ /// a bar that had collapsed would be a question nobody could answer.
+ ///
+ ///
+ [Fact]
+ public async Task DeletingAHostFromThePhonesBar_TakesTheControlsWhileItAsks()
+ {
+ await UnlockedAsync();
+ var vault = shell.Vault!;
+
+ await AddHostAsync(vault, "prod-db");
+
+ vault.SelectedHost = vault.Hosts.Single();
+
+ vault.ShowsConnectBar.ShouldBeTrue();
+ vault.ShowsConnectControls.ShouldBeTrue();
+
+ vault.DeleteHostCommand.Execute(null);
+
+ vault.IsConfirmingHostDeletion.ShouldBeTrue();
+ vault.ShowsConnectBar.ShouldBeTrue("the bar is where the question is drawn");
+ vault.ShowsConnectControls.ShouldBeFalse("so DELETE cannot be pressed under its own question");
+
+ vault.CancelDeleteCommand.Execute(null);
+
+ vault.ShowsConnectControls.ShouldBeTrue();
+ vault.Hosts.ShouldHaveSingleItem("KEEP keeps it");
+ }
+
+ [Fact]
+ public async Task DeletingAHostFromThePhonesBar_RemovesItOnceItIsAgreedTo()
+ {
+ await UnlockedAsync();
+ var vault = shell.Vault!;
+
+ await AddHostAsync(vault, "prod-db");
+
+ vault.SelectedHost = vault.Hosts.Single();
+ vault.DeleteHostCommand.Execute(null);
+
+ await vault.ConfirmDeleteCommand.ExecuteAsync(null);
+
+ vault.Hosts.ShouldBeEmpty(vault.Status);
+ vault.ShowsConnectBar.ShouldBeFalse("and there is nothing left for the bar to be about");
+ }
+
+ ///
+ /// The other panel that takes the bar, asserted here rather than left to the move's own tests: the two
+ /// share one property, and a change that put the controls back under one of them would be a CONNECT
+ /// button in a bar that is asking something else.
+ ///
+ [Fact]
+ public async Task MovingAHostFromThePhonesBar_TakesTheControlsToo()
+ {
+ await UnlockedAsync();
+ var vault = shell.Vault!;
+
+ await AddHostAsync(vault, "prod-db");
+
+ vault.SelectedHost = vault.Hosts.Single();
+
+ vault.MoveHostCommand.Execute(null);
+
+ // One writable vault, so there is nowhere to move it and the panel does not open — which is exactly
+ // the state that must still leave the controls showing rather than a bar with nothing in it.
+ vault.IsMovingHost.ShouldBeFalse(vault.Status);
+ vault.ShowsConnectControls.ShouldBeTrue();
+
+ // Set rather than reached through a second vault, which is VaultSharingTests' job and needs a server
+ // to make one. What is being pinned here is the one line joining the flag to the bar.
+ vault.IsMovingHost = true;
+
+ vault.ShowsConnectControls.ShouldBeFalse();
+ }
+
// ---- Tags ----
//
// The type has been storable since the domain landed and unreachable until now. What these pin is the
diff --git a/tests/DodoSSH.Client.App.Tests/VaultSharingTests.cs b/tests/DodoSSH.Client.App.Tests/VaultSharingTests.cs
index ef311d7..d5b5b52 100644
--- a/tests/DodoSSH.Client.App.Tests/VaultSharingTests.cs
+++ b/tests/DodoSSH.Client.App.Tests/VaultSharingTests.cs
@@ -981,6 +981,64 @@ public sealed class VaultSharingTests : IAsyncLifetime
vault.Status.ShouldContain("only vault you can write to");
}
+ ///
+ ///
+ /// The phone's route into the same move, and it is a different route rather than the same one reached
+ /// differently. That head's list draws group headings rather than cards, a heading is deliberately not
+ /// something it can select, and nothing there opens a group — so GroupTarget is null and a move
+ /// that only read it would leave the menu entry doing nothing at all. The panel is aimed by the heading
+ /// the menu was raised on instead.
+ ///
+ ///
+ /// The innermost shelf is the one moved, because it is the one with a machine on it and so the one with
+ /// a heading. That it arrives at the top level is the same rule the card's move follows: the group it
+ /// was nested under belongs to the vault it is leaving.
+ ///
+ ///
+ [Fact]
+ public async Task MovingAGroupFromItsHeading_TakesItsHostsWithNothingSelected()
+ {
+ await UnlockedAsync();
+
+ var vaults = shell.Vaults;
+
+ await CreateVaultAsync(vaults, "Platform secrets");
+
+ var vault = shell.Vault!;
+ var sharedVaultId = vaults.SelectedVault!.VaultId;
+
+ await vault.LoadAsync(Token);
+
+ await SeedNestedShelfAsync(vault);
+
+ var heading = vault.SidebarRows.OfType().Single(
+ row => string.Equals(row.Label, "web", StringComparison.Ordinal));
+
+ vault.GroupTarget.ShouldBeNull("the phone selects no card and opens no group");
+
+ vault.OpenGroupSheetCommand.Execute(heading);
+ vault.MoveGroupFromHeadingCommand.Execute(heading);
+
+ vault.GroupSheet.ShouldBeNull("the menu closes behind the entry that was pressed");
+ vault.IsMovingGroup.ShouldBeTrue(vault.Status);
+ vault.MovingGroupLabel.ShouldBe("web", "the panel names the shelf, having left the list behind");
+
+ vault.SelectedMoveGroupVault =
+ vault.MoveGroupVaultChoices.Single(choice => choice.VaultId == sharedVaultId);
+
+ await vault.ConfirmMoveGroupCommand.ExecuteAsync(null);
+
+ var moved = Named(vault, "web");
+
+ moved.VaultId.ShouldBe(sharedVaultId, vault.Status);
+ moved.Group.ParentId.ShouldBeNull("a parent belongs to the vault the group came from");
+
+ var host = vault.Hosts.Single(row => string.Equals(row.Label, "prod-db", StringComparison.Ordinal));
+
+ host.VaultId.ShouldBe(sharedVaultId, "the machine came with the shelf");
+ host.Host.GroupId.ShouldBe(moved.EntityId);
+ }
+
/// The group card with a given name, re-found because every row is replaced on every reload.
private static HostGroupRowViewModel Named(VaultViewModel vault, string label) =>
vault.Groups.Single(row => string.Equals(row.Label, label, StringComparison.Ordinal));