The editor was reachable from one button that only appeared in My Day, which is how it got forgotten. It is now a permanent sidebar entry next to My Day and Planned, and it fills the tasks island rather than the details pane, because a note list is content. Inside, the date picker is gone: today sits at the top with the capture box, older days follow as dated groups. Enter in a note saves it and opens the next one, Shift+Enter breaks the line so notes can be several, Backspace on an empty note deletes it and steps back up. Deleting also has a visible hover button instead of only "clear the text and hope". Agent-written notes carry a marker. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
81 lines
2.5 KiB
C#
81 lines
2.5 KiB
C#
using System.Collections.ObjectModel;
|
|
using ClaudeDo.Data;
|
|
using ClaudeDo.Data.Models;
|
|
using ClaudeDo.Data.Repositories;
|
|
using ClaudeDo.Ui.Services;
|
|
using ClaudeDo.Ui.ViewModels.Islands;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
|
|
|
|
namespace ClaudeDo.Ui.Tests.ViewModels;
|
|
|
|
public class DetailsIslandConflictSeamTests : IDisposable
|
|
{
|
|
private readonly string _dbPath;
|
|
|
|
public DetailsIslandConflictSeamTests()
|
|
{
|
|
_dbPath = Path.Combine(Path.GetTempPath(), $"claudedo_conflict_seam_test_{Guid.NewGuid():N}.db");
|
|
using var ctx = NewContext();
|
|
ctx.Database.EnsureCreated();
|
|
}
|
|
|
|
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 ConflictApproveWorkerClient : StubWorkerClient
|
|
{
|
|
public override bool IsConnected => true;
|
|
public override Task<MergeResultDto?> ApproveReviewAsync(string taskId, string targetBranch) =>
|
|
Task.FromResult<MergeResultDto?>(new MergeResultDto("conflict", new[] { "a.cs" }, null));
|
|
}
|
|
|
|
private DetailsIslandViewModel BuildVm(StubWorkerClient worker, MergeCoordinator merge)
|
|
{
|
|
var factory = new TestDbFactory(NewContext);
|
|
return new DetailsIslandViewModel(factory, worker, new NullServiceProvider(), merge);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task ApproveReview_OnConflict_InvokesConflictResolutionSeam()
|
|
{
|
|
const string taskId = "task-conflict-1";
|
|
|
|
string? capturedTaskId = null;
|
|
string? capturedTarget = null;
|
|
var coordinator = new MergeCoordinator
|
|
{
|
|
Handler = (tid, target) =>
|
|
{
|
|
capturedTaskId = tid;
|
|
capturedTarget = target;
|
|
return Task.CompletedTask;
|
|
},
|
|
};
|
|
|
|
var vm = BuildVm(new ConflictApproveWorkerClient(), coordinator);
|
|
vm.Bind(new TaskRowViewModel { Id = taskId, Status = TaskStatus.WaitingForReview });
|
|
vm.Merge.SelectedMergeTarget = "main";
|
|
|
|
await vm.ApproveReviewCommand.ExecuteAsync(null);
|
|
|
|
Assert.Equal(taskId, capturedTaskId);
|
|
Assert.Equal("main", capturedTarget);
|
|
}
|
|
}
|