feat(ui): move list-settings access from lists pane to tasks header
The gear button on list rows became noisy and overlapped with row selection. Moves it into the tasks island header where it targets the currently selected list. Lists pane regains a cleaner row layout. Also: swallow GetListConfig errors on fresh lists that have no row yet.
This commit is contained in:
@@ -81,6 +81,9 @@
|
||||
<!-- Icon.ArrowOut — filled arrow for "open external" button -->
|
||||
<StreamGeometry x:Key="Icon.ArrowOut">M13 4 H20 V11 H18 V7.4 L11.4 14 L10 12.6 L16.6 6 H13 Z M4 6 H10 V8 H6 V18 H16 V14 H18 V20 H4 Z</StreamGeometry>
|
||||
|
||||
<!-- Icon.Settings (gear) -->
|
||||
<StreamGeometry x:Key="Icon.Settings">M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8z M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65a.5.5 0 0 0 .12-.64l-2-3.46a.5.5 0 0 0-.61-.22l-2.49 1a7.03 7.03 0 0 0-1.69-.98l-.38-2.65a.5.5 0 0 0-.5-.42h-4a.5.5 0 0 0-.5.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1a.5.5 0 0 0-.61.22l-2 3.46a.5.5 0 0 0 .12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65a.5.5 0 0 0-.12.64l2 3.46a.5.5 0 0 0 .61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65a.5.5 0 0 0 .5.42h4a.5.5 0 0 0 .5-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1a.5.5 0 0 0 .61-.22l2-3.46a.5.5 0 0 0-.12-.64l-2.11-1.65z</StreamGeometry>
|
||||
|
||||
</Styles.Resources>
|
||||
|
||||
<!-- ============================================================ -->
|
||||
|
||||
@@ -308,7 +308,14 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable
|
||||
|
||||
public async Task<ListConfigDto?> GetListConfigAsync(string listId)
|
||||
{
|
||||
return await _hub.InvokeAsync<ListConfigDto?>("GetListConfig", listId);
|
||||
try
|
||||
{
|
||||
return await _hub.InvokeAsync<ListConfigDto?>("GetListConfig", listId);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task UpdateTaskAgentSettingsAsync(UpdateTaskAgentSettingsDto dto)
|
||||
|
||||
@@ -351,8 +351,10 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
||||
[RelayCommand]
|
||||
private void Sort() { /* placeholder — UI-only */ }
|
||||
|
||||
public event EventHandler? OpenListSettingsRequested;
|
||||
|
||||
[RelayCommand]
|
||||
private void More() { /* placeholder — UI-only */ }
|
||||
private void OpenListSettings() => OpenListSettingsRequested?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
partial void OnSelectedTaskChanged(TaskRowViewModel? value)
|
||||
{
|
||||
|
||||
@@ -101,6 +101,11 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
Lists.SelectionChanged += (_, _) => Tasks.LoadForList(Lists.SelectedList);
|
||||
Tasks.SelectionChanged += (_, _) => Details.Bind(Tasks.SelectedTask);
|
||||
Tasks.TasksChanged += (_, _) => _ = Lists.RefreshCountsAsync();
|
||||
Tasks.OpenListSettingsRequested += (_, _) =>
|
||||
{
|
||||
if (Lists.SelectedList is { } row)
|
||||
Lists.OpenListSettingsCommand.Execute(row);
|
||||
};
|
||||
Details.CloseDetail = () => Tasks.SelectedTask = null;
|
||||
Details.DeleteFromList = row =>
|
||||
{
|
||||
|
||||
@@ -134,9 +134,9 @@
|
||||
CommandParameter="{Binding}"/>
|
||||
</ContextMenu>
|
||||
</Border.ContextMenu>
|
||||
<Grid ColumnDefinitions="20,*,Auto,Auto">
|
||||
<Grid ColumnDefinitions="20,*,Auto">
|
||||
<!-- Left accent bar for active state -->
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="4"
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Background="Transparent"
|
||||
CornerRadius="8" IsHitTestVisible="False"
|
||||
IsVisible="{Binding IsActive}">
|
||||
@@ -159,14 +159,6 @@
|
||||
<!-- Count -->
|
||||
<TextBlock Grid.Column="2" Classes="list-count"
|
||||
Text="{Binding Count}"/>
|
||||
<!-- Gear button -->
|
||||
<Button Grid.Column="3" Classes="icon-btn"
|
||||
Content="⚙"
|
||||
FontSize="12"
|
||||
ToolTip.Tip="Settings..."
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding $parent[UserControl].((vm:ListsIslandViewModel)DataContext).OpenListSettingsCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
ToolTip.Tip="Show completed">
|
||||
<PathIcon Width="15" Height="15" Data="{StaticResource Icon.Eye}"/>
|
||||
</Button>
|
||||
<Button Classes="icon-btn" Command="{Binding MoreCommand}" ToolTip.Tip="More">
|
||||
<PathIcon Width="15" Height="15" Data="{StaticResource Icon.MoreHorizontal}"/>
|
||||
<Button Classes="icon-btn" Command="{Binding OpenListSettingsCommand}" ToolTip.Tip="List settings">
|
||||
<PathIcon Width="15" Height="15" Data="{StaticResource Icon.Settings}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user