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:
@@ -221,8 +221,8 @@
|
||||
"rerun": "Erneut ausführen",
|
||||
"refineTip": "Aufgabe mit Claude verfeinern",
|
||||
"refiningTip": "Claude verfeinert diese Aufgabe…",
|
||||
"emptyHint": "Noch keine Aufgaben. Oben eine hinzufügen oder in die Warteschlange einreihen, wenn du bereit bist.",
|
||||
"emptyHintNoWorkingDir": "Verknüpfe ein Repo in den Listeneinstellungen, um Warteschlange, „Claude machen lassen" und die Schnell-Sitzung zu aktivieren."
|
||||
"emptyHint": "Noch keine Aufgaben. Lege eine an und wähle per Rechtsklick „In Warteschlange einreihen" — Claude bearbeitet sie in einem eigenen Worktree.",
|
||||
"emptyHintNoWorkingDir": "Diese Liste hat kein Repo — in den Listeneinstellungen verknüpfen, um die Warteschlange zu aktivieren."
|
||||
},
|
||||
"lists": {
|
||||
"heading": "Listen",
|
||||
@@ -237,7 +237,9 @@
|
||||
"contextOpenFindings": "Findings-Ordner öffnen",
|
||||
"contextSettings": "Einstellungen…",
|
||||
"newList": "Neue Liste",
|
||||
"addReposTip": "Repos als Listen hinzufügen"
|
||||
"addReposTip": "Repos als Listen hinzufügen",
|
||||
"noRepoBannerText": "Noch kein Repo verknüpft. ClaudeDo führt Tasks in einem Git-Repo aus.",
|
||||
"noRepoBannerButton": "Repo importieren"
|
||||
},
|
||||
"details": {
|
||||
"deleteTaskTip": "Aufgabe löschen",
|
||||
@@ -309,6 +311,7 @@
|
||||
"reviewContinueTip": "Dieses Feedback senden und die Aufgabe erneut ausführen",
|
||||
"reviewResetTip": "Alle Änderungen verwerfen und die Aufgabe auf Leerlauf zurücksetzen",
|
||||
"mergeDrainHint": "Merge zieht Subtasks ein — Abbrechen entsperrt sich danach",
|
||||
"approveMergesUnitHint": "Approve mergt das gleich in den Zielbranch — danach folgt kein separater Merge-Schritt.",
|
||||
"continueNoSessionTip": "Setzt den letzten Lauf fort — benötigt eine vorherige Session",
|
||||
"resetAndRetryInteractiveTip": "Interaktive Sitzung ist offen — erst schließen",
|
||||
"reviewFeedbackPlaceholder": "Feedback für nächsten Lauf"
|
||||
|
||||
@@ -221,8 +221,8 @@
|
||||
"rerun": "Re-run",
|
||||
"refineTip": "Refine this task with Claude",
|
||||
"refiningTip": "Claude is refining this task…",
|
||||
"emptyHint": "No tasks yet. Add one above, or send it to the queue once you're ready.",
|
||||
"emptyHintNoWorkingDir": "Link a repo in List Settings to enable the queue, Let Claude handle it, and Quick session."
|
||||
"emptyHint": "No tasks yet. Add one, then right-click it and choose \"Send to queue\" — Claude works it in its own worktree.",
|
||||
"emptyHintNoWorkingDir": "This list has no repo yet — link one in List Settings to enable the queue."
|
||||
},
|
||||
"lists": {
|
||||
"heading": "Lists",
|
||||
@@ -237,7 +237,9 @@
|
||||
"contextOpenFindings": "Open findings folder",
|
||||
"contextSettings": "Settings…",
|
||||
"newList": "New list",
|
||||
"addReposTip": "Add repos as lists"
|
||||
"addReposTip": "Add repos as lists",
|
||||
"noRepoBannerText": "No repo linked yet. ClaudeDo runs tasks in a git repo.",
|
||||
"noRepoBannerButton": "Import repo"
|
||||
},
|
||||
"details": {
|
||||
"deleteTaskTip": "Delete task",
|
||||
@@ -310,6 +312,7 @@
|
||||
"reviewResetTip": "Discard all changes and reset the task to Idle",
|
||||
"reviewFeedbackPlaceholder": "Feedback for next run",
|
||||
"mergeDrainHint": "Merge is draining subtasks — Cancel unlocks once it finishes",
|
||||
"approveMergesUnitHint": "Approve also merges this into the target branch right away — there's no separate merge step after it.",
|
||||
"continueNoSessionTip": "Resumes the last run — needs a previous session to continue",
|
||||
"resetAndRetryInteractiveTip": "Interactive session is open — close it first"
|
||||
},
|
||||
|
||||
@@ -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,14 +371,17 @@
|
||||
IsVisible="{Binding Merge.ShowMergeSection}" />
|
||||
|
||||
<!-- Gate: you must open the diff before Approve & Merge unlocks. -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6"
|
||||
IsVisible="{Binding ShowReviewDiffHint}">
|
||||
<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
|
||||
until it finishes (mirrors the worker-side guard). -->
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Localization;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.ViewModels.Islands;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ClaudeDo.Ui.Tests.ViewModels;
|
||||
|
||||
// UX-Struktur Paket C, C1: HasNoLinkedRepo drives the no-repo banner in ListsIslandView — true
|
||||
// whenever no User list has a WorkingDir, recomputed after list load and after list CRUD /
|
||||
// list-settings save (never persisted, no dismiss).
|
||||
public class ListsIslandHasNoLinkedRepoTests : IDisposable
|
||||
{
|
||||
private readonly string _dbPath;
|
||||
|
||||
public ListsIslandHasNoLinkedRepoTests()
|
||||
{
|
||||
_dbPath = Path.Combine(Path.GetTempPath(), $"claudedo_lists_norepo_test_{Guid.NewGuid():N}.db");
|
||||
using var ctx = NewContext();
|
||||
ctx.Database.EnsureCreated();
|
||||
|
||||
var dir = AppContext.BaseDirectory;
|
||||
while (dir is not null && !Directory.Exists(Path.Combine(dir, "src", "ClaudeDo.Localization", "locales")))
|
||||
dir = Path.GetDirectoryName(dir);
|
||||
Loc.Current = new Localizer(
|
||||
LocaleStore.Load(Path.Combine(dir!, "src", "ClaudeDo.Localization", "locales")), "en");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try { File.Delete(_dbPath); } catch { }
|
||||
try { File.Delete(_dbPath + "-wal"); } catch { }
|
||||
try { File.Delete(_dbPath + "-shm"); } catch { }
|
||||
}
|
||||
|
||||
private ClaudeDoDbContext NewContext()
|
||||
{
|
||||
var opts = new DbContextOptionsBuilder<ClaudeDoDbContext>()
|
||||
.UseSqlite($"Data Source={_dbPath}")
|
||||
.Options;
|
||||
return new ClaudeDoDbContext(opts);
|
||||
}
|
||||
|
||||
private sealed class TestDbFactory : IDbContextFactory<ClaudeDoDbContext>
|
||||
{
|
||||
private readonly Func<ClaudeDoDbContext> _create;
|
||||
public TestDbFactory(Func<ClaudeDoDbContext> create) => _create = create;
|
||||
public ClaudeDoDbContext CreateDbContext() => _create();
|
||||
}
|
||||
|
||||
private sealed class FakeWorker : StubWorkerClient
|
||||
{
|
||||
public override bool IsConnected => true;
|
||||
}
|
||||
|
||||
private async Task<ListEntity> SeedListAsync(string id, string name, string? workingDir = null)
|
||||
{
|
||||
await using var db = NewContext();
|
||||
var entity = new ListEntity { Id = id, Name = name, WorkingDir = workingDir, CreatedAt = DateTime.UtcNow };
|
||||
db.Lists.Add(entity);
|
||||
await db.SaveChangesAsync();
|
||||
return entity;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task NoLists_HasNoLinkedRepo_IsTrue()
|
||||
{
|
||||
var vm = new ListsIslandViewModel(new TestDbFactory(NewContext));
|
||||
await vm.LoadAsync();
|
||||
|
||||
Assert.True(vm.HasNoLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task OnlyNonUserSeedLists_HasNoLinkedRepo_IsTrue()
|
||||
{
|
||||
// "My Day"/"Important"/"Planned" are excluded from UserLists by name — they must not
|
||||
// count as a linked repo even if (hypothetically) one had a WorkingDir.
|
||||
await SeedListAsync("seed-my-day", "My Day", workingDir: @"C:\some\repo");
|
||||
|
||||
var vm = new ListsIslandViewModel(new TestDbFactory(NewContext));
|
||||
await vm.LoadAsync();
|
||||
|
||||
Assert.Empty(vm.UserLists);
|
||||
Assert.True(vm.HasNoLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UserListWithoutWorkingDir_HasNoLinkedRepo_IsTrue()
|
||||
{
|
||||
await SeedListAsync("no-dir", "No Dir");
|
||||
|
||||
var vm = new ListsIslandViewModel(new TestDbFactory(NewContext));
|
||||
await vm.LoadAsync();
|
||||
|
||||
Assert.True(vm.HasNoLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UserListWithWorkingDir_HasNoLinkedRepo_IsFalse()
|
||||
{
|
||||
await SeedListAsync("has-dir", "Has Dir", workingDir: @"C:\some\repo");
|
||||
|
||||
var vm = new ListsIslandViewModel(new TestDbFactory(NewContext));
|
||||
await vm.LoadAsync();
|
||||
|
||||
Assert.False(vm.HasNoLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CreateListAsync_OnEmptyBoard_KeepsHasNoLinkedRepoTrue()
|
||||
{
|
||||
var vm = new ListsIslandViewModel(new TestDbFactory(NewContext));
|
||||
await vm.LoadAsync();
|
||||
Assert.True(vm.HasNoLinkedRepo);
|
||||
|
||||
// No Dialogs/service provider wired — CreateListAsync must still recompute the flag from
|
||||
// the newly-added (working-dir-less) row, not leave it stale.
|
||||
await vm.CreateListCommand.ExecuteAsync(null);
|
||||
|
||||
Assert.True(vm.HasNoLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task DeletingTheOnlyLinkedRepoList_ThenReloading_RecomputesToTrue()
|
||||
{
|
||||
var entity = await SeedListAsync("has-dir", "Has Dir", workingDir: @"C:\some\repo");
|
||||
|
||||
var vm = new ListsIslandViewModel(new TestDbFactory(NewContext));
|
||||
await vm.LoadAsync();
|
||||
Assert.False(vm.HasNoLinkedRepo);
|
||||
|
||||
// List Settings' delete path removes the DB row, then the caller reloads (see
|
||||
// OpenListSettingsAsync/CreateListAsync: `if (vm.Deleted) await LoadAsync();`).
|
||||
await using (var db = NewContext())
|
||||
{
|
||||
db.Lists.Remove(db.Lists.Find(entity.Id)!);
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
await vm.LoadAsync();
|
||||
|
||||
Assert.True(vm.HasNoLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ListSettingsSave_LinkingWorkingDir_RecomputesToFalse()
|
||||
{
|
||||
var entity = await SeedListAsync("no-dir-yet", "No Dir Yet");
|
||||
|
||||
var worker = new FakeWorker();
|
||||
var vm = new ListsIslandViewModel(new TestDbFactory(NewContext), worker: worker);
|
||||
await vm.LoadAsync();
|
||||
Assert.True(vm.HasNoLinkedRepo);
|
||||
|
||||
// Simulate a List Settings save linking a working dir — the worker broadcasts the same
|
||||
// ListUpdated event a real save triggers, driving RefreshRowAsync.
|
||||
await using (var db = NewContext())
|
||||
{
|
||||
var row = await db.Lists.FindAsync(entity.Id);
|
||||
row!.WorkingDir = @"C:\some\repo";
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
worker.RaiseListUpdated(entity.Id);
|
||||
await Task.Delay(100);
|
||||
|
||||
Assert.False(vm.HasNoLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ListSettingsSave_RemovingLastWorkingDir_RecomputesToTrue()
|
||||
{
|
||||
var entity = await SeedListAsync("has-dir", "Has Dir", workingDir: @"C:\some\repo");
|
||||
|
||||
var worker = new FakeWorker();
|
||||
var vm = new ListsIslandViewModel(new TestDbFactory(NewContext), worker: worker);
|
||||
await vm.LoadAsync();
|
||||
Assert.False(vm.HasNoLinkedRepo);
|
||||
|
||||
await using (var db = NewContext())
|
||||
{
|
||||
var row = await db.Lists.FindAsync(entity.Id);
|
||||
row!.WorkingDir = null;
|
||||
await db.SaveChangesAsync();
|
||||
}
|
||||
worker.RaiseListUpdated(entity.Id);
|
||||
await Task.Delay(100);
|
||||
|
||||
Assert.True(vm.HasNoLinkedRepo);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user