chore(claude-do): Task-row visual fixes: chain step badge z-order + hide "#0"

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
This commit is contained in:
mika kuns
2026-08-11 16:46:21 +02:00
parent 79b35801ae
commit 6c4fa7b1a5
3 changed files with 40 additions and 9 deletions
@@ -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)
{
@@ -34,15 +34,6 @@
HorizontalAlignment="Right" Margin="0,4"/>
</Border>
<!-- Chain step badge: centered on the rail line, half laid over the card's left edge.
Lives in col 1 with a negative margin so it never widens the Auto indent column. -->
<Border Grid.Column="1" Classes="chain-step-badge"
IsVisible="{Binding ShowAsChainMember}"
HorizontalAlignment="Left" VerticalAlignment="Center"
Margin="-8,0,0,0">
<TextBlock Text="{Binding ChainStep}"/>
</Border>
<!-- Main task card -->
<Border Grid.Column="1" Classes="task-row"
Margin="0,2"
@@ -84,6 +75,7 @@
<Grid ColumnDefinitions="*,Auto" VerticalAlignment="Center">
<Grid Grid.Column="0" ColumnDefinitions="Auto,*" VerticalAlignment="Center">
<TextBlock Grid.Column="0" Classes="meta" Text="{Binding Number, StringFormat='#{0}'}"
IsVisible="{Binding ShowNumberBadge}"
VerticalAlignment="Center" Margin="0,0,6,0"/>
<TextBlock Grid.Column="1"
Classes="task-title"
@@ -232,6 +224,16 @@
</Grid>
</Border>
<!-- Chain step badge: centered on the rail line, half laid over the card's left edge.
Lives in col 1 with a negative margin so it never widens the Auto indent column.
Declared after the card so it paints on top instead of underneath it. -->
<Border Grid.Column="1" Classes="chain-step-badge"
IsVisible="{Binding ShowAsChainMember}"
HorizontalAlignment="Left" VerticalAlignment="Center"
Margin="-8,0,0,0">
<TextBlock Text="{Binding ChainStep}"/>
</Border>
</Grid>
<!-- Below-row indicator: only expands when visible (used for the last row of a section) -->
@@ -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<string?>();
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()
{