feat(ui): make steps visible at a glance; lift details card off background

The single flip-icon hid that steps existed until toggled. Replace it with an
always-visible "STEPS" summary strip below the description (open/total count,
click to expand and manage). Description is now always the card body. Give the
card a Surface2 background + LineBrush border so it separates from the window.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-06-04 20:18:24 +02:00
parent 3e848710b8
commit 99c6bf4478
2 changed files with 79 additions and 64 deletions

View File

@@ -104,15 +104,28 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
[RelayCommand] [RelayCommand]
private void ToggleDescriptionExpanded() => IsDescriptionExpanded = !IsDescriptionExpanded; private void ToggleDescriptionExpanded() => IsDescriptionExpanded = !IsDescriptionExpanded;
// ── Description/Steps card (redesign) ───────────────────────────── // ── Description / Steps card (redesign) ─────────────────────────────
[ObservableProperty] // Description is always the card body; steps live in an expandable summary
[NotifyPropertyChangedFor(nameof(IsDescriptionView))] // strip below it so step presence is visible without switching views.
private bool _isStepsView; [ObservableProperty] private bool _isStepsExpanded;
public bool IsDescriptionView => !IsStepsView;
[RelayCommand] [RelayCommand]
private void ToggleCardView() => IsStepsView = !IsStepsView; private void ToggleStepsExpanded() => IsStepsExpanded = !IsStepsExpanded;
public int TotalStepCount => Subtasks.Count;
public int OpenStepCount => Subtasks.Count(s => !s.Done);
public string StepsSummary =>
TotalStepCount == 0 ? "no steps yet"
: OpenStepCount == 0 ? $"all done · {TotalStepCount} total"
: $"{OpenStepCount} open · {TotalStepCount} total";
private void NotifyStepsChanged()
{
OnPropertyChanged(nameof(TotalStepCount));
OnPropertyChanged(nameof(OpenStepCount));
OnPropertyChanged(nameof(StepsSummary));
OnPropertyChanged(nameof(ComposedPreview));
}
// The exact text handed to Claude: title + description + open steps only. // The exact text handed to Claude: title + description + open steps only.
public string ComposedPreview => public string ComposedPreview =>
@@ -375,7 +388,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
_services = services; _services = services;
_notesApi = notesApi; _notesApi = notesApi;
Notes = new NotesEditorViewModel(_notesApi); Notes = new NotesEditorViewModel(_notesApi);
Subtasks.CollectionChanged += (_, _) => OnPropertyChanged(nameof(ComposedPreview)); Subtasks.CollectionChanged += (_, _) => NotifyStepsChanged();
Loc.LanguageChanged += (_, _) => Loc.LanguageChanged += (_, _) =>
{ {
OnPropertyChanged(nameof(AgentStatusLabel)); OnPropertyChanged(nameof(AgentStatusLabel));
@@ -1140,7 +1153,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
{ {
if (row is null) return; if (row is null) return;
row.Done = !row.Done; row.Done = !row.Done;
OnPropertyChanged(nameof(ComposedPreview)); NotifyStepsChanged();
await using var ctx = _dbFactory.CreateDbContext(); await using var ctx = _dbFactory.CreateDbContext();
var repo = new SubtaskRepository(ctx); var repo = new SubtaskRepository(ctx);
var subs = await repo.GetByTaskIdAsync(Task?.Id ?? ""); var subs = await repo.GetByTaskIdAsync(Task?.Id ?? "");

View File

@@ -5,69 +5,46 @@
x:Class="ClaudeDo.Ui.Views.Islands.Detail.DescriptionStepsCard" x:Class="ClaudeDo.Ui.Views.Islands.Detail.DescriptionStepsCard"
x:DataType="vm:DetailsIslandViewModel"> x:DataType="vm:DetailsIslandViewModel">
<Border Classes="island"> <Border Classes="island"
Background="{DynamicResource Surface2Brush}"
BorderBrush="{DynamicResource LineBrush}">
<DockPanel> <DockPanel>
<!-- Header --> <!-- Header: DETAILS · copy · preview/edit -->
<Border DockPanel.Dock="Top" Classes="island-header"> <Border DockPanel.Dock="Top" Classes="island-header">
<Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto" VerticalAlignment="Center"> <Grid ColumnDefinitions="Auto,*,Auto,Auto" VerticalAlignment="Center">
<!-- Col 0: section label --> <TextBlock Grid.Column="0" Classes="section-label" Text="DETAILS"
<Panel Grid.Column="0" VerticalAlignment="Center"> VerticalAlignment="Center"/>
<TextBlock Classes="section-label" Text="DETAILS" IsVisible="{Binding IsDescriptionView}"/>
<TextBlock Classes="section-label" Text="STEPS" IsVisible="{Binding IsStepsView}"/>
</Panel>
<!-- Col 1: spacer (auto from *) --> <!-- Copy formatted -->
<!-- Col 2: Copy button — Description view only -->
<Button Grid.Column="2" <Button Grid.Column="2"
Classes="icon-btn" Classes="icon-btn"
Margin="0,0,4,0" Margin="0,0,4,0"
ToolTip.Tip="Copy formatted (title + description + open steps)" ToolTip.Tip="Copy formatted (title + description + open steps)"
IsVisible="{Binding IsDescriptionView}"
Click="OnCopyClick"> Click="OnCopyClick">
<PathIcon Data="{StaticResource Icon.Copy}" Width="11" Height="11"/> <PathIcon Data="{StaticResource Icon.Copy}" Width="11" Height="11"/>
</Button> </Button>
<!-- Col 3: Preview/Edit toggle — Description view only --> <!-- Preview/Edit toggle -->
<Button Grid.Column="3" <Button Grid.Column="3"
Classes="btn" Classes="btn"
Padding="8,3" Padding="8,3"
Margin="0,0,4,0" Command="{Binding ToggleEditDescriptionCommand}">
Command="{Binding ToggleEditDescriptionCommand}"
IsVisible="{Binding IsDescriptionView}">
<Panel> <Panel>
<TextBlock Text="Preview" IsVisible="{Binding IsEditingDescription}"/> <TextBlock Text="Preview" IsVisible="{Binding IsEditingDescription}"/>
<TextBlock Text="Edit" IsVisible="{Binding !IsEditingDescription}"/> <TextBlock Text="Edit" IsVisible="{Binding !IsEditingDescription}"/>
</Panel> </Panel>
</Button> </Button>
<!-- Col 4: Card toggle icon -->
<Button Grid.Column="4"
Classes="icon-btn"
Command="{Binding ToggleCardViewCommand}"
ToolTip.Tip="Switch Description / Steps">
<Panel>
<!-- In Description view: show steps/list glyph -->
<PathIcon Data="{StaticResource Icon.MoreHorizontal}"
Width="11" Height="11"
IsVisible="{Binding IsDescriptionView}"/>
<!-- In Steps view: show text/document glyph -->
<PathIcon Data="{StaticResource Icon.Text}"
Width="11" Height="11"
IsVisible="{Binding IsStepsView}"/>
</Panel>
</Button>
</Grid> </Grid>
</Border> </Border>
<!-- Body --> <!-- Body -->
<StackPanel Margin="14" Spacing="6"> <StackPanel Margin="14" Spacing="10">
<!-- Description view --> <!-- Description (always visible) -->
<Panel IsVisible="{Binding IsDescriptionView}"> <Panel>
<!-- Edit mode: raw TextBox --> <!-- Edit mode: raw TextBox -->
<TextBox Text="{Binding EditableDescription, Mode=TwoWay}" <TextBox Text="{Binding EditableDescription, Mode=TwoWay}"
AcceptsReturn="True" AcceptsReturn="True"
@@ -77,7 +54,7 @@
Padding="8" Padding="8"
FontFamily="{DynamicResource MonoFont}" FontFamily="{DynamicResource MonoFont}"
FontSize="{StaticResource FontSizeBody}" FontSize="{StaticResource FontSizeBody}"
Background="{DynamicResource Surface2Brush}" Background="{DynamicResource Surface3Brush}"
BorderBrush="{DynamicResource LineBrush}" BorderBrush="{DynamicResource LineBrush}"
BorderThickness="1" BorderThickness="1"
CornerRadius="8" CornerRadius="8"
@@ -87,13 +64,36 @@
IsVisible="{Binding !IsEditingDescription}"/> IsVisible="{Binding !IsEditingDescription}"/>
</Panel> </Panel>
<!-- Steps view --> <!-- Steps: always-visible summary strip; expand to manage -->
<StackPanel IsVisible="{Binding IsStepsView}" Spacing="6"> <Border BorderBrush="{DynamicResource LineBrush}"
<!-- Add-step input --> BorderThickness="0,1,0,0"
Padding="0,8,0,0">
<StackPanel Spacing="6">
<!-- Summary header (click to expand/collapse) -->
<Button Classes="flat" Cursor="Hand"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Command="{Binding ToggleStepsExpandedCommand}">
<Grid ColumnDefinitions="Auto,Auto,*,Auto">
<Panel Grid.Column="0" Width="12" Margin="0,0,6,0" VerticalAlignment="Center">
<TextBlock Classes="meta" Text="▸" IsVisible="{Binding !IsStepsExpanded}"/>
<TextBlock Classes="meta" Text="▾" IsVisible="{Binding IsStepsExpanded}"/>
</Panel>
<TextBlock Grid.Column="1" Classes="section-label" Text="STEPS"
VerticalAlignment="Center"/>
<TextBlock Grid.Column="3" Classes="meta" Text="{Binding StepsSummary}"
Foreground="{DynamicResource TextMuteBrush}"
VerticalAlignment="Center"/>
</Grid>
</Button>
<!-- Expanded: add-step input + step rows -->
<StackPanel IsVisible="{Binding IsStepsExpanded}" Spacing="6">
<TextBox Text="{Binding NewSubtaskTitle, Mode=TwoWay}" <TextBox Text="{Binding NewSubtaskTitle, Mode=TwoWay}"
PlaceholderText="Add step…" PlaceholderText="Add step…"
Padding="8" Padding="8"
Background="{DynamicResource Surface2Brush}" Background="{DynamicResource Surface3Brush}"
BorderBrush="{DynamicResource LineBrush}" BorderBrush="{DynamicResource LineBrush}"
BorderThickness="1" BorderThickness="1"
CornerRadius="8"> CornerRadius="8">
@@ -155,6 +155,8 @@
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</StackPanel> </StackPanel>
</StackPanel>
</Border>
</StackPanel> </StackPanel>
</DockPanel> </DockPanel>