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>
98 lines
2.4 KiB
C#
98 lines
2.4 KiB
C#
using ClaudeDo.Data;
|
|
using ClaudeDo.Ui.Services;
|
|
using ClaudeDo.Ui.ViewModels.Islands;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace ClaudeDo.Ui.Tests.ViewModels;
|
|
|
|
public class DetailsIslandTabsTests : IDisposable
|
|
{
|
|
private readonly string _dbPath;
|
|
|
|
public DetailsIslandTabsTests()
|
|
{
|
|
_dbPath = Path.Combine(Path.GetTempPath(), $"claudedo_tabs_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 DetailsIslandViewModel NewVm()
|
|
{
|
|
var factory = new TestDbFactory(NewContext);
|
|
return new DetailsIslandViewModel(factory, new DefaultStub(), new NullServiceProvider(), new ClaudeDo.Ui.Services.MergeCoordinator());
|
|
}
|
|
|
|
[Fact]
|
|
public void SelectTab_git_sets_IsGitTab_and_clears_others()
|
|
{
|
|
var vm = NewVm();
|
|
|
|
vm.SelectTabCommand.Execute("git");
|
|
|
|
Assert.True(vm.IsGitTab);
|
|
Assert.False(vm.IsOutputTab);
|
|
Assert.False(vm.IsSessionTab);
|
|
}
|
|
|
|
[Fact]
|
|
public void Default_tab_is_output_not_git()
|
|
{
|
|
var vm = NewVm();
|
|
|
|
Assert.True(vm.IsOutputTab);
|
|
Assert.False(vm.IsGitTab);
|
|
}
|
|
|
|
[Fact]
|
|
public void Bind_manual_task_defaults_to_git_tab()
|
|
{
|
|
var vm = NewVm();
|
|
|
|
vm.Bind(new TaskRowViewModel { Id = Guid.NewGuid().ToString("N"), IsManual = true });
|
|
|
|
Assert.True(vm.IsGitTab);
|
|
Assert.False(vm.IsOutputTab);
|
|
}
|
|
|
|
[Fact]
|
|
public void Bind_interactive_task_defaults_to_git_tab()
|
|
{
|
|
var vm = NewVm();
|
|
|
|
vm.Bind(new TaskRowViewModel { Id = Guid.NewGuid().ToString("N"), HasInteractiveSession = true });
|
|
|
|
Assert.True(vm.IsGitTab);
|
|
}
|
|
|
|
[Fact]
|
|
public void Bind_autonomous_task_defaults_to_output_tab()
|
|
{
|
|
var vm = NewVm();
|
|
vm.SelectTabCommand.Execute("git");
|
|
|
|
vm.Bind(new TaskRowViewModel { Id = Guid.NewGuid().ToString("N") });
|
|
|
|
Assert.True(vm.IsOutputTab);
|
|
Assert.False(vm.IsGitTab);
|
|
}
|
|
}
|