From 6c4fa7b1a5d8c2a0dc82b66ac9621d13b53f1cc8 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Tue, 11 Aug 2026 16:46:21 +0200 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFchore(claude-do):=20Task-row=20visual?= =?UTF-8?q?=20fixes:=20chain=20step=20badge=20z-order=20+=20hide=20"#0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the 2026-08-11 unpushed-commit review (Low). Both in `src/ClaudeDo.Ui/Views/Islands/TaskRowView.axaml`. **Visual verification by the user is required — do not claim either is fixed without a screenshot; list both as open visual checks in the result.** ## A) Chain step badge is drawn under the task card Commit `eb66ae7` moved `Border.chain-step-badge` from column 0 into column 1 with `Margin ClaudeDo-Task: 9ec7d4ea-272b-4645-8da4-41ff3621f2f0 --- .../ViewModels/Islands/TaskRowViewModel.cs | 5 ++++ .../Views/Islands/TaskRowView.axaml | 20 +++++++++------- .../UiVm/TaskRowViewModelTests.cs | 24 +++++++++++++++++++ 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs b/src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs index 384e7d14..b5c16431 100644 --- a/src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs @@ -73,6 +73,10 @@ public sealed partial class TaskRowViewModel : ViewModelBase public int StepsCount { get; init; } public int StepsCompleted { get; init; } + // Number is 0 for rows created outside TaskNumberAllocator (test seeds, a future import + // path); a bare "#0" would be meaningless, so hide the badge entirely below 1. + public bool ShowNumberBadge => Number > 0; + public bool IsChild => !string.IsNullOrEmpty(ParentTaskId); public bool IsAgentSuggested => IsChild && !string.IsNullOrEmpty(CreatedBy) && CreatedBy == ParentTaskId; public bool IsPlanningParent => PlanningPhase != PlanningPhase.None @@ -318,6 +322,7 @@ public sealed partial class TaskRowViewModel : ViewModelBase OnPropertyChanged(nameof(CanQueuePlan)); } + partial void OnNumberChanged(int value) => OnPropertyChanged(nameof(ShowNumberBadge)); partial void OnBranchChanged(string? value) => OnPropertyChanged(nameof(HasBranch)); partial void OnWorktreeStateChanged(ClaudeDo.Data.Models.WorktreeState? value) { diff --git a/src/ClaudeDo.Ui/Views/Islands/TaskRowView.axaml b/src/ClaudeDo.Ui/Views/Islands/TaskRowView.axaml index 1f1ec0fa..07af2efa 100644 --- a/src/ClaudeDo.Ui/Views/Islands/TaskRowView.axaml +++ b/src/ClaudeDo.Ui/Views/Islands/TaskRowView.axaml @@ -34,15 +34,6 @@ HorizontalAlignment="Right" Margin="0,4"/> - - - - - + + + + + diff --git a/tests/ClaudeDo.Worker.Tests/UiVm/TaskRowViewModelTests.cs b/tests/ClaudeDo.Worker.Tests/UiVm/TaskRowViewModelTests.cs index 46c3eaa0..d25486e1 100644 --- a/tests/ClaudeDo.Worker.Tests/UiVm/TaskRowViewModelTests.cs +++ b/tests/ClaudeDo.Worker.Tests/UiVm/TaskRowViewModelTests.cs @@ -40,6 +40,30 @@ public class TaskRowViewModelTests Assert.Equal(123, vm.Number); } + [Theory] + [InlineData(-1, false)] + [InlineData(0, false)] + [InlineData(1, true)] + [InlineData(42, true)] + public void ShowNumberBadge_Hides_For_Zero_And_Negative(int number, bool expected) + { + var vm = new TaskRowViewModel { Id = "t" }; + vm.Number = number; + Assert.Equal(expected, vm.ShowNumberBadge); + } + + [Fact] + public void ShowNumberBadge_Raises_PropertyChanged_On_Number_Change() + { + var vm = new TaskRowViewModel { Id = "t" }; + var raised = new List(); + vm.PropertyChanged += (_, e) => raised.Add(e.PropertyName); + + vm.Number = 5; + + Assert.Contains(nameof(TaskRowViewModel.ShowNumberBadge), raised); + } + [Fact] public void IsDropTarget_Follows_Either_DropHint_And_Raises_PropertyChanged() {