Skip to content

Commit 65b6cd3

Browse files
committed
Redesign workflow task dialog; add tool registry & UX polish
- Overhauled WorkflowNodeProperties dialog with tabbed UI for task config (general, execution, AI agent, flow control, approval, error handling, retry) - Added dynamic editing for parameters, specs, branches; improved field help and validation - Made properties dialog async and prevented multiple opens - Introduced IToolRegistry/ToolRegistry for agent tool selection; registered as DI service - Improved model initialization to avoid null refs; updated enums and field types for MudSelect compatibility - Enhanced dialog headers, field variants, and layout across UI - Added CSS for fixed dialog footers and scrollable content - Improved search/filter UI in logs and plugin lists for consistency #94
1 parent 4d0b9d7 commit 65b6cd3

17 files changed

Lines changed: 868 additions & 159 deletions

src/Components/Pages/AllLogs/Logs.razor

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
IconColor="Color.Primary"
1919
IconSize="Size.Large" />
2020

21-
<MudPaper Class="px-4 pb-4 mb-4 filter-box">
21+
<MudPaper Class="px-5 py-5 pb-4 mb-4 filter-box">
2222
<MudForm>
2323
<MudGrid>
2424
<MudItem xs="12" sm="6" md="12">
2525
<MudTextField @bind-Value="LogsListRequest.Message"
2626
Label="Message contains..."
27-
Variant="Variant.Text"
28-
Margin="Margin.Dense"
27+
Variant="Variant.Filled"
2928
HelperText="Filter logs by message content" />
3029
</MudItem>
3130

@@ -34,8 +33,7 @@
3433
For="@(() => LogsListRequest.Level)"
3534
@bind-Value="LogsListRequest.Level"
3635
Label="Level"
37-
Variant="Variant.Text"
38-
Dense="true"
36+
Variant="Variant.Filled"
3937
OpenIcon="@Icons.Material.Filled.ArrowDropDown"
4038
CloseIcon="@Icons.Material.Filled.ArrowDropUp"
4139
HelperText="Select the log level to filter (e.g., Info, Warn)">
@@ -49,17 +47,15 @@
4947
<MudItem xs="12" sm="6" md="4">
5048
<MudDatePicker @bind-Date="LogsListRequest.FromDate"
5149
Label="From date"
52-
Variant="Variant.Text"
53-
HelperText="Show logs starting from this date"
54-
Margin="Margin.Dense" />
50+
Variant="Variant.Filled"
51+
HelperText="Show logs starting from this date" />
5552
</MudItem>
5653

5754
<MudItem xs="12" sm="6" md="4">
5855
<MudDatePicker @bind-Date="LogsListRequest.ToDate"
5956
Label="To date"
60-
Variant="Variant.Text"
61-
HelperText="Show logs up to this date"
62-
Margin="Margin.Dense" />
57+
Variant="Variant.Filled"
58+
HelperText="Show logs up to this date" />
6359
</MudItem>
6460

6561
<MudItem xs="12" sm="6" md="6">

src/Components/Pages/Plugins/InstallPluginDialog.razor

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
DisableBackdropClick="@IsProcessing"
1212
CloseOnEscapeKey="false">
1313

14+
<TitleContent>
15+
<MudText Typo="Typo.h6">Install Plugin</MudText>
16+
<MudText Typo="Typo.body2" Color="Color.Secondary">
17+
Install the plugin into the system
18+
</MudText>
19+
</TitleContent>
20+
1421
<DialogContent>
1522

1623
<MudCard Elevation="0" Class="rounded-xl">
@@ -29,7 +36,8 @@
2936
Margin="Margin.Dense"
3037
Required="true"
3138
Disabled="@IsProcessing"
32-
Clearable="true" />
39+
Clearable="true"
40+
HelperText="Plugin type to install in format 'PluginName:Version'" />
3341
</MudCardContent>
3442

3543
<!-- Footer -->

src/Components/Pages/Plugins/UninstallPluginDialog.razor

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
DisableBackdropClick="@IsProcessing"
1111
CloseOnEscapeKey="false">
1212

13+
<TitleContent>
14+
<MudText Typo="Typo.h6">Uninstall Plugin</MudText>
15+
<MudText Typo="Typo.body2" Color="Color.Secondary">
16+
Uninstall the plugin from the system
17+
</MudText>
18+
</TitleContent>
19+
1320
<DialogContent>
1421

1522
<MudCard Elevation="0" Class="rounded-xl">

src/Components/Pages/Plugins/UpdatePluginDialog.razor

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@
1111
DisableBackdropClick="@IsProcessing"
1212
CloseOnEscapeKey="false">
1313

14-
<DialogContent>
14+
<TitleContent>
15+
<MudText Typo="Typo.h6">Update Plugin</MudText>
16+
<MudText Typo="Typo.body2" Color="Color.Secondary">
17+
Update the plugin to a new version
18+
</MudText>
19+
</TitleContent>
1520

21+
<DialogContent>
1622
<MudCard Elevation="0" Class="rounded-xl">
1723

1824
<!-- Body -->
@@ -29,7 +35,8 @@
2935
StartIcon="@Icons.Material.Filled.Extension"
3036
ReadOnly="true"
3137
Disabled="true"
32-
Class="mb-4" />
38+
Class="mb-4"
39+
HelperText="Current installed version"/>
3340

3441
<!-- Target version -->
3542
<MudTextField @bind-Value="UpdateModel.TargetVersion"

src/Components/Pages/Triggers/AddTriggerDialog.razor

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
DisableBackdropClick="@IsProcessing"
1414
CloseOnEscapeKey="false">
1515

16+
<TitleContent>
17+
<MudText Typo="Typo.h6">Add Trigger</MudText>
18+
<MudText Typo="Typo.body2" Color="Color.Secondary">
19+
Configure the settings for this workflow trigger.
20+
</MudText>
21+
</TitleContent>
22+
1623
<DialogContent>
1724

1825
<MudCard Elevation="0" Class="rounded-xl">
@@ -23,12 +30,13 @@
2330
<!-- Trigger basics -->
2431
<MudGrid Spacing="3">
2532

26-
<MudItem xs="12" md="6">
33+
<MudItem xs="12">
2734
<MudSelect T="string"
2835
Label="Trigger Type"
2936
@bind-Value="AddWorkflowTriggerRequest.Type"
3037
Variant="Variant.Filled"
31-
StartIcon="@Icons.Material.Filled.Category"
38+
Placeholder="Select Trigger Type"
39+
HelperText="Select the type of trigger for this workflow."
3240
Disabled="@IsProcessing">
3341
@foreach (var triggerType in Enum.GetValues<WorkflowTriggerType>())
3442
{
@@ -39,7 +47,7 @@
3947
</MudSelect>
4048
</MudItem>
4149

42-
<MudItem xs="12" md="6" Class="d-flex align-center">
50+
<MudItem xs="12" Class="d-flex align-center">
4351
<MudSwitch @bind-Value="AddWorkflowTriggerRequest.Status"
4452
Converter="_statusConverter"
4553
Color="Color.Primary"

src/Components/Pages/Triggers/DeleteTriggerDialog.razor

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
DisableBackdropClick="@IsProcessing"
1212
CloseOnEscapeKey="false">
1313

14+
<TitleContent>
15+
<MudText Typo="Typo.h6">Delete Trigger</MudText>
16+
<MudText Typo="Typo.body2" Color="Color.Secondary">
17+
Confirm the deletion of this workflow trigger.
18+
</MudText>
19+
</TitleContent>
20+
1421
<DialogContent>
1522

1623
<MudCard Elevation="0" Class="rounded-xl">

src/Components/Pages/Triggers/UpdateTriggerDialog.razor

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
DisableBackdropClick="@IsProcessing"
1414
CloseOnEscapeKey="false">
1515

16+
<TitleContent>
17+
<MudText Typo="Typo.h6">Update Trigger</MudText>
18+
<MudText Typo="Typo.body2" Color="Color.Secondary">
19+
Modify the settings for this workflow trigger.
20+
</MudText>
21+
</TitleContent>
22+
1623
<DialogContent>
1724

1825
<MudCard Elevation="0" Class="rounded-xl">
@@ -23,12 +30,13 @@
2330
<!-- Trigger basics -->
2431
<MudGrid Spacing="3">
2532

26-
<MudItem xs="12" md="6">
33+
<MudItem xs="12">
2734
<MudSelect T="string"
2835
Label="Trigger Type"
2936
@bind-Value="UpdateWorkflowTriggerRequest.Type"
37+
Placeholder="Select Trigger Type"
38+
HelperText="Select the type of trigger for this workflow."
3039
Variant="Variant.Filled"
31-
StartIcon="@Icons.Material.Filled.Category"
3240
Disabled="@IsProcessing">
3341
@foreach (var triggerType in Enum.GetValues<WorkflowTriggerType>())
3442
{
@@ -39,7 +47,7 @@
3947
</MudSelect>
4048
</MudItem>
4149

42-
<MudItem xs="12" md="6" Class="d-flex align-center">
50+
<MudItem xs="12" Class="d-flex align-center">
4351
<MudSwitch @bind-Value="UpdateWorkflowTriggerRequest.Status"
4452
Converter="_statusConverter"
4553
Label="Trigger Active"

src/Components/Pages/Workflows/ConfigureWorkflowDialog.razor

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
<MudTextField T="string"
6363
@bind-Value="Config.Description"
6464
Label="Description"
65+
Placeholder="Enter task description"
66+
HelperText="Description of the workflow"
6567
Lines="3"
66-
Variant="Variant.Filled"
67-
Margin="Margin.Dense"
68-
HelperText="Description of the workflow" />
68+
Variant="Variant.Filled" />
6969
</MudItem>
7070
</MudGrid>
7171
</MudTabPanel>
@@ -97,21 +97,34 @@
9797
<!-- ERROR HANDLING -->
9898
<MudTabPanel Text="Error Handling" Icon="@Icons.Material.Filled.WarningAmber">
9999
<MudGrid Spacing="3">
100-
<MudItem xs="12" sm="6">
101-
<MudSelect T="string"
102-
@bind-Value="Config.Configuration.ErrorHandling!.Strategy"
103-
Label="Strategy"
104-
Variant="Variant.Filled"
105-
Margin="Margin.Dense"
106-
HelperText="Select the error handling strategy">
107-
@foreach (var strategy in Enum.GetValues<ErrorStrategy>())
108-
{
109-
<MudSelectItem Value="@strategy.ToString().ToLower()">
110-
@strategy
111-
</MudSelectItem>
112-
}
113-
</MudSelect>
114-
</MudItem>
100+
@if (Config?.Configuration.ErrorHandling != null)
101+
{
102+
<MudItem xs="6">
103+
<MudSelect @bind-Value="Config.Configuration.ErrorHandling.Strategy"
104+
Variant="Variant.Filled"
105+
Placeholder="Select error strategy"
106+
HelperText="Select the strategy to handle errors"
107+
Label="Error Strategy">
108+
@foreach (var strategy in Enum.GetValues<ErrorStrategy>())
109+
{
110+
<MudSelectItem Value="@strategy.ToString().ToLower()">
111+
@strategy
112+
</MudSelectItem>
113+
}
114+
</MudSelect>
115+
</MudItem>
116+
117+
@if (Config?.Configuration.ErrorHandling?.Strategy?.ToLower() == "triggertask")
118+
{
119+
<MudItem xs="6">
120+
<MudTextField @bind-Value="Config.Configuration?.ErrorHandling?.TriggerPolicy!.TaskName"
121+
Label="Trigger Task Name"
122+
Placeholder="Enter task name to trigger"
123+
HelperText="The name of the task to trigger on error"
124+
Variant="Variant.Filled" />
125+
</MudItem>
126+
}
127+
}
115128
</MudGrid>
116129
</MudTabPanel>
117130

@@ -223,6 +236,16 @@
223236
Config.Configuration.ErrorHandling ??= new ErrorHandling();
224237
Config.Configuration.ErrorHandling.RetryPolicy ??= new RetryPolicy();
225238

239+
Config.Configuration.ErrorHandling ??= new ErrorHandling()
240+
{
241+
Strategy = ErrorStrategy.Abort.ToString().ToLower()
242+
};
243+
244+
Config.Configuration.ErrorHandling.TriggerPolicy ??= new TriggerPolicy
245+
{
246+
TaskName = string.Empty
247+
};
248+
226249
if (!string.IsNullOrWhiteSpace(Config.Configuration.ErrorHandling.Strategy))
227250
{
228251
Config.Configuration.ErrorHandling.Strategy = Config.Configuration.ErrorHandling.Strategy.ToLower();
@@ -255,7 +278,8 @@
255278
{
256279
Retry,
257280
Skip,
258-
Abort
281+
Abort,
282+
TriggerTask
259283
}
260284

261285
public enum BackoffStrategy

src/Components/Pages/Workflows/SearchablePluginsList.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
<MudStack Spacing="2">
1111
<!-- Search -->
1212
<MudTextField @bind-Value="_search"
13+
Label="Search"
1314
Placeholder="Search by plugin or version"
1415
Adornment="Adornment.Start"
1516
AdornmentIcon="@Icons.Material.Filled.Search"
1617
Immediate="true"
1718
DebounceInterval="200"
1819
Clearable="true"
19-
Variant="Variant.Outlined"
20-
Class="rounded-xl" />
20+
Variant="Variant.Filled"
21+
Class="rounded-xl mb-4" />
2122

2223
<!-- Loading state -->
2324
@if (_loading)

src/Components/Pages/Workflows/WorkflowDesigner.razor

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
Variant="Variant.Outlined"
5757
Size="Size.Large"
5858
Icon="@Icons.Material.Filled.Info"
59-
OnClick="() => ShowPropertiesDialog(SelectedTask)">
59+
OnClick="async () => await ShowPropertiesDialog(SelectedTask)">
6060
Selected Task: <b>@SelectedTask.Name</b>
6161
</MudChip>
6262
</MudTooltip>
@@ -90,6 +90,7 @@
9090
private string _newValue;
9191
private DotNetObjectReference<WorkflowDesigner> _selfRef;
9292
private bool IsPaletteVisible = false;
93+
private bool _isPropertiesOpen;
9394

9495
private void TogglePalette()
9596
{
@@ -203,9 +204,19 @@
203204
private Task UpdateNodeTitle() =>
204205
SelectedTask != null ? JSRuntime.InvokeVoidAsync("fsDrawflow.updateNodeTitle", SelectedTask.NodeId, SelectedTask.Name, SelectedTask.Type).AsTask() : Task.CompletedTask;
205206

206-
private async void ShowPropertiesDialog(WorkflowTask task)
207+
private async Task ShowPropertiesDialog(WorkflowTask task)
207208
{
208-
var options = new DialogOptions
209+
if (task is null)
210+
return;
211+
212+
if (_isPropertiesOpen)
213+
return;
214+
215+
_isPropertiesOpen = true;
216+
217+
try
218+
{
219+
var options = new DialogOptions
209220
{
210221
CloseButton = false,
211222
MaxWidth = MaxWidth.Small,
@@ -214,7 +225,7 @@
214225
BackgroundClass = "blur-dialog-background"
215226
};
216227

217-
var parameters = new DialogParameters
228+
var parameters = new DialogParameters
218229
{
219230
["SelectedTask"] = task,
220231
["OnUpdated"] = EventCallback.Factory.Create(this, async () =>
@@ -224,7 +235,15 @@
224235
})
225236
};
226237

227-
await DialogService.ShowAsync<WorkflowNodeProperties>("Properties", parameters, options);
238+
var dialogRef = await DialogService.ShowAsync<WorkflowNodeProperties>("Properties", parameters, options);
239+
240+
// Await the dialog close before allowing another to open
241+
await dialogRef.Result;
242+
}
243+
finally
244+
{
245+
_isPropertiesOpen = false;
246+
}
228247
}
229248

230249
private void UpdateDepsFromText() =>
@@ -286,7 +305,7 @@
286305
if (task != null)
287306
{
288307
SelectedTask = task;
289-
ShowPropertiesDialog(task);
308+
return ShowPropertiesDialog(task);
290309
}
291310
return Task.CompletedTask;
292311
}
@@ -298,7 +317,7 @@
298317
if (task != null)
299318
{
300319
SelectedTask = task;
301-
ShowPropertiesDialog(task);
320+
return ShowPropertiesDialog(task);
302321
}
303322
return Task.CompletedTask;
304323
}

0 commit comments

Comments
 (0)