feat(ui): Erststart-Banner und Textkette Repo→Task→Queue→Review (UX-Struktur C)
HasNoLinkedRepo on ListsIslandViewModel drives a dismiss-less banner under the Lists-Island header when no User list has a linked repo; recomputed on load and after list CRUD / list-settings save. Sharpens the #192 empty-state texts into one readable chain (banner → no-repo list → repo-linked list) and adds a line to the WorkConsole review gate spelling out that Approve also merges the whole unit.
This commit is contained in:
@@ -186,6 +186,14 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
[ObservableProperty] private string _searchText = "";
|
||||
[ObservableProperty] private ListNavItemViewModel? _selectedList;
|
||||
|
||||
/// <summary>True whenever no User list has a linked <c>WorkingDir</c> — drives the no-repo
|
||||
/// banner. Smart/Virtual lists never count. Recomputed after every load and every
|
||||
/// list CRUD / list-settings save; never persisted, no dismiss state.</summary>
|
||||
[ObservableProperty] private bool _hasNoLinkedRepo = true;
|
||||
|
||||
private void RecomputeHasNoLinkedRepo() =>
|
||||
HasNoLinkedRepo = UserLists.All(r => string.IsNullOrWhiteSpace(r.WorkingDir));
|
||||
|
||||
public string UserName { get; } = Environment.UserName;
|
||||
public string MachineName { get; } = Environment.MachineName;
|
||||
public string MachineNameLocal => Loc.T("vm.lists.localSuffix", MachineName);
|
||||
@@ -291,6 +299,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
}
|
||||
finally { OperationTiming.Shared.Record("db", "ListsIsland.LoadAsync", sw.Elapsed, ok); }
|
||||
|
||||
RecomputeHasNoLinkedRepo();
|
||||
await RefreshCountsAsync(ct);
|
||||
SelectedList = Items.FirstOrDefault();
|
||||
}
|
||||
@@ -372,6 +381,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
Items.Add(item);
|
||||
UserLists.Add(item);
|
||||
SelectedList = item;
|
||||
RecomputeHasNoLinkedRepo();
|
||||
|
||||
if (Dialogs is not null && _services is not null)
|
||||
{
|
||||
@@ -474,6 +484,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
row.DefaultCommitType = entity.DefaultCommitType;
|
||||
row.IsManual = entity.IsManual;
|
||||
row.FindingsTracked = entity.FindingsTracked;
|
||||
RecomputeHasNoLinkedRepo();
|
||||
}
|
||||
catch { /* best-effort refresh */ }
|
||||
}
|
||||
@@ -505,5 +516,6 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
|
||||
UserLists.Insert(insertAt, item);
|
||||
Items.Insert(SmartLists.Count + insertAt, item);
|
||||
RecomputeHasNoLinkedRepo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,13 +371,16 @@
|
||||
IsVisible="{Binding Merge.ShowMergeSection}" />
|
||||
|
||||
<!-- Gate: you must open the diff before Approve & Merge unlocks. -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6"
|
||||
IsVisible="{Binding ShowReviewDiffHint}">
|
||||
<PathIcon Data="{StaticResource Icon.ArrowOut}" Width="11" Height="11"
|
||||
Foreground="{DynamicResource AmberBrush}" VerticalAlignment="Center" />
|
||||
<TextBlock Classes="meta" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource AmberBrush}"
|
||||
Text="Open the diff to enable merge" />
|
||||
<StackPanel Spacing="2" IsVisible="{Binding ShowReviewDiffHint}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<PathIcon Data="{StaticResource Icon.ArrowOut}" Width="11" Height="11"
|
||||
Foreground="{DynamicResource AmberBrush}" VerticalAlignment="Center" />
|
||||
<TextBlock Classes="meta" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource AmberBrush}"
|
||||
Text="Open the diff to enable merge" />
|
||||
</StackPanel>
|
||||
<TextBlock Classes="meta" Margin="17,0,0,0"
|
||||
Text="{loc:Tr session.approveMergesUnitHint}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Gate: a unit merge is draining this task's subtasks, so Cancel is locked
|
||||
|
||||
@@ -30,6 +30,24 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ── No-repo banner — visible until any User list has a linked working dir; no
|
||||
dismiss, no persisted state, comes back if the last repo link is removed. ── -->
|
||||
<Border DockPanel.Dock="Top"
|
||||
IsVisible="{Binding HasNoLinkedRepo}"
|
||||
Margin="12,0,12,12"
|
||||
Background="{DynamicResource DeepBrush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6"
|
||||
Padding="14,10">
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Classes="body" Text="{loc:Tr lists.noRepoBannerText}" TextWrapping="Wrap"/>
|
||||
<Button Classes="btn" HorizontalAlignment="Right"
|
||||
Content="{loc:Tr lists.noRepoBannerButton}"
|
||||
Command="{Binding OpenRepoImportCommand}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ── Footer ── -->
|
||||
<Border DockPanel.Dock="Bottom"
|
||||
BorderBrush="{DynamicResource LineBrush}" BorderThickness="0,1,0,0"
|
||||
|
||||
Reference in New Issue
Block a user