Public Access
Merge branch 'claude/remove-group-edit-delete-buttons-3d38ec'
This commit is contained in:
@@ -226,25 +226,14 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<TextBlock Grid.Column="0" Classes="label" Text="GROUPS"
|
||||
Foreground="{StaticResource TextDim}" VerticalAlignment="Center" />
|
||||
|
||||
<!--
|
||||
The group's own two actions, beside the group cards rather than in the toolbar, because they
|
||||
act on the card that is selected — and this is where the selection is made. Hidden rather
|
||||
than disabled while DELETE's question is up, as every other pair in this application is, so
|
||||
it cannot be pressed twice, and hidden again when there is nothing for them to act on. What
|
||||
that is, with no card selected, is the group the trail above ends with; see
|
||||
VaultViewModel.GroupTarget.
|
||||
-->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="6">
|
||||
<Button Classes="ghost" Content="EDIT" Command="{Binding EditGroupCommand}"
|
||||
IsVisible="{Binding ShowsGroupActions}" />
|
||||
<Button Classes="ghost" Content="DELETE" Command="{Binding DeleteGroupCommand}"
|
||||
IsVisible="{Binding ShowsGroupActions}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!--
|
||||
The heading and nothing else. This used to be a row with EDIT and DELETE at the far end of it,
|
||||
and the card's own menu is where both live now — see the note on it below. They were a second
|
||||
control for the job that menu already does, and the harder of the two to read: a button beside
|
||||
a heading has to say which card it means, and with none selected it meant the group the trail
|
||||
ends with rather than anything on screen.
|
||||
-->
|
||||
<TextBlock Classes="label" Text="GROUPS" Foreground="{StaticResource TextDim}" />
|
||||
|
||||
<Border Padding="10" Background="{StaticResource DangerWash}" CornerRadius="6"
|
||||
IsVisible="{Binding IsConfirmingGroupDeletion}">
|
||||
@@ -269,8 +258,8 @@
|
||||
|
||||
◆ THIS IS ONE LEVEL, NOT EVERY GROUP. It binds VisibleGroups: what is inside the group the
|
||||
trail above ends with, or the outermost groups when it ends at ALL HOSTS. Folded away entirely
|
||||
at a group with nothing inside it, which is an ordinary thing to open — the trail and the two
|
||||
buttons stay, because leaving it is a gesture and editing it is a button.
|
||||
at a group with nothing inside it, which is an ordinary thing to open — the trail stays, and
|
||||
it is also the way back to the level where that group has a card of its own to be edited from.
|
||||
|
||||
◆ THESE CARDS ARE THE DROP TARGET. A host card dragged onto one is filed under that group, and
|
||||
that is the whole of what a drag does on this screen. It used to be a heading inside the host
|
||||
@@ -295,11 +284,11 @@
|
||||
context; the code-behind selects whatever was right-clicked before the menu opens, and
|
||||
cancels it outright over the space around the cards.
|
||||
|
||||
Open is here as well as on the double-click, and Edit and Delete as well as on the two
|
||||
buttons above, and neither is a duplicate for its own sake: a gesture is unreachable without
|
||||
a pointer, and the buttons act on GroupTarget — which with no card selected is the group the
|
||||
trail ends with rather than the one under the pointer. This menu is the one place all three
|
||||
act on the card that was right-clicked.
|
||||
Open is here as well as on the double-click, which is not a duplicate for its own sake: a
|
||||
gesture is unreachable without a pointer. Edit and Delete are here and nowhere else — they
|
||||
were also a pair of buttons beside the heading above, which acted on GroupTarget and so with
|
||||
no card selected meant the group the trail ends with rather than any card on screen. All
|
||||
three act on the card that was right-clicked, which is the whole of what this menu is for.
|
||||
|
||||
Only Open takes a parameter, because OpenGroupCommand's null means ALL HOSTS rather than
|
||||
nothing; Edit and Delete read GroupTarget, which the selection the code-behind has just made
|
||||
|
||||
@@ -217,8 +217,8 @@ internal sealed partial class HostsScreen : UserControl
|
||||
/// The host grid's rule, applied to the cards above it — see <see cref="OnContextRequested"/>. What is
|
||||
/// different is what an unaimed menu would have done: <c>GroupTarget</c> falls back to the open group
|
||||
/// when no card is selected, so Edit and Delete over a card would have been offered about the group whose
|
||||
/// contents are showing rather than the one the pointer is on. That fallback is right for a pair of
|
||||
/// buttons that sit beside the heading and wrong for a menu that opened on a card.
|
||||
/// contents are showing rather than the one the pointer is on. This menu is the only way to either of
|
||||
/// them now, so aiming it is the whole of aiming them.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Cancelled outright over the space around the cards, as the host grid's is. That is not a group, and
|
||||
|
||||
@@ -1483,7 +1483,7 @@ internal sealed partial class VaultViewModel(
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Separate from <see cref="SelectedGroup"/>, and no longer sets it.</b> The two answer different
|
||||
/// questions — "what is on screen" and "what would EDIT and DELETE act on" — and while one click meant
|
||||
/// questions — "what is on screen" and "which card is chosen" — and while one click meant
|
||||
/// both there was no way to name a group without also narrowing the grid to it. Two gestures, two
|
||||
/// properties; <see cref="GroupTarget"/> is where the two meet.
|
||||
/// </para>
|
||||
@@ -2601,26 +2601,23 @@ internal sealed partial class VaultViewModel(
|
||||
internal bool IsConfirmingGroupDeletion => PendingDeletion?.Target is DeletionTarget.Group;
|
||||
|
||||
/// <summary>
|
||||
/// What the group panel's EDIT and DELETE act on: the card that is selected, or the group that is open.
|
||||
/// What a group command with no argument acts on: the card that is selected, or the group that is open.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Two answers, because a card is no longer where the user is. Selecting one aims the buttons at it,
|
||||
/// which is what a click has always done; with nothing selected they aim at the group whose contents are
|
||||
/// on screen — the one the trail ends with. Without that fallback a group with no groups inside it could
|
||||
/// be opened and then never edited, because opening a group is exactly what takes its own card off the
|
||||
/// screen. It is also what a file manager does: act on the selection, and on the current folder when
|
||||
/// there is none.
|
||||
/// Two answers, because a card is no longer where the user is. Selecting one aims at it, which is what a
|
||||
/// click has always done; with nothing selected the answer is the group whose contents are on screen —
|
||||
/// the one the trail ends with. That fallback is what makes + NEW HOST open on the group somebody is
|
||||
/// standing in rather than on none, and it is what a file manager does: act on the selection, and on the
|
||||
/// current folder when there is none.
|
||||
/// <para>
|
||||
/// The desktop's Edit and Delete reach this through the card menu, which selects whatever was
|
||||
/// right-clicked first, so the fallback is not what they read — see <c>HostsScreen.OnGroupContextRequested</c>.
|
||||
/// They used to be a pair of buttons beside the GROUPS heading, which had no card under a pointer to
|
||||
/// mean and so leaned on it.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
internal HostGroupRowViewModel? GroupTarget => SelectedGroup ?? GroupFilter;
|
||||
|
||||
/// <summary>Whether the group panel's buttons are showing.</summary>
|
||||
/// <remarks>
|
||||
/// Hidden with nothing to act on as well as while the question is up. A pair of buttons over a grid of
|
||||
/// cards nobody has chosen between is a pair whose subject the user has to work out, and the answer
|
||||
/// would be "neither" — see <see cref="GroupTarget"/>.
|
||||
/// </remarks>
|
||||
internal bool ShowsGroupActions => GroupTarget is not null && !IsConfirmingGroupDeletion;
|
||||
|
||||
/// <summary>Whether this vault has any groups, which is what makes the sidebar draw headings.</summary>
|
||||
internal bool HasGroups => Groups.Count > 0;
|
||||
|
||||
@@ -4859,8 +4856,9 @@ internal sealed partial class VaultViewModel(
|
||||
/// <summary>Loads the group being acted on into the box, so saving renames it.</summary>
|
||||
/// <param name="group">
|
||||
/// The group to edit, or null for whatever the screen is aimed at — the selected card, or the open group
|
||||
/// when no card is selected. See <see cref="GroupTarget"/>. The desktop's EDIT button passes nothing and
|
||||
/// means the second; the phone has no card to select and passes the group its heading names.
|
||||
/// when no card is selected. See <see cref="GroupTarget"/>. The desktop's card menu passes nothing and
|
||||
/// means the card that was right-clicked, which opening the menu has already selected; the phone has no
|
||||
/// card to select and passes the group its heading names.
|
||||
/// </param>
|
||||
/// <remarks>
|
||||
/// Taking it as an argument is what keeps the phone from having to select a group in order to edit one.
|
||||
@@ -5226,7 +5224,7 @@ internal sealed partial class VaultViewModel(
|
||||
/// up under the ungrouped heading — so what the user needs to know is exactly how many machines are about
|
||||
/// to move, and that none of them are going anywhere else.
|
||||
/// <para>
|
||||
/// Aims where EDIT does: at the selected card, or at the open group when no card is selected. See
|
||||
/// Aims where Edit does: at the selected card, which on the desktop is the one the menu opened on. See
|
||||
/// <see cref="GroupTarget"/>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
@@ -8183,7 +8181,6 @@ internal sealed partial class VaultViewModel(
|
||||
DisarmIfAimedElsewhere(DeletionTarget.Group, GroupTarget?.EntityId);
|
||||
|
||||
OnPropertyChanged(nameof(GroupTarget));
|
||||
OnPropertyChanged(nameof(ShowsGroupActions));
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
@@ -8204,7 +8201,6 @@ internal sealed partial class VaultViewModel(
|
||||
DisarmIfAimedElsewhere(DeletionTarget.Group, GroupTarget?.EntityId);
|
||||
|
||||
OnPropertyChanged(nameof(GroupTarget));
|
||||
OnPropertyChanged(nameof(ShowsGroupActions));
|
||||
|
||||
RebuildGroupLevel();
|
||||
RebuildVisibleHosts();
|
||||
@@ -8217,7 +8213,6 @@ internal sealed partial class VaultViewModel(
|
||||
OnPropertyChanged(nameof(IsConfirmingGroupDeletion));
|
||||
OnPropertyChanged(nameof(ShowsHostActions));
|
||||
OnPropertyChanged(nameof(ShowsHostPaneActions));
|
||||
OnPropertyChanged(nameof(ShowsGroupActions));
|
||||
OnPropertyChanged(nameof(ShowsItemActions));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user