Merge branch 'worktree-agent-a9d87141c744e7733' into feat/instance-picker
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small">Instance</label>
|
||||
<InstancePicker Areas="_siteAreas" Instances="_siteInstances"
|
||||
ItemLabel="@(i => $"{i.UniqueName} ({i.State})")"
|
||||
ItemLabel="InstanceLabel"
|
||||
SelectedInstanceId="_selectedInstanceId" SelectedInstanceIdChanged="OnInstancePicked"
|
||||
Disabled="@_connected" DataTestPrefix="debug-instance" />
|
||||
</div>
|
||||
@@ -455,17 +455,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Handles a pick from the <c>InstancePicker</c> combobox.</summary>
|
||||
private void OnInstancePicked(int id)
|
||||
{
|
||||
_selectedInstanceId = id;
|
||||
OnInstanceSelectionChanged();
|
||||
}
|
||||
/// <summary>
|
||||
/// The label the <c>InstancePicker</c> renders on a row and in its field:
|
||||
/// the instance's unique name with its lifecycle state.
|
||||
/// </summary>
|
||||
/// <param name="instance">The instance to label.</param>
|
||||
/// <returns>The display label, e.g. <c>Line1.Mixer (Enabled)</c>.</returns>
|
||||
private static string InstanceLabel(Instance instance) =>
|
||||
$"{instance.UniqueName} ({instance.State})";
|
||||
|
||||
private void OnInstanceSelectionChanged()
|
||||
{
|
||||
// No-op; selection is tracked via _selectedInstanceId binding
|
||||
}
|
||||
/// <summary>
|
||||
/// Records the instance the operator picked in the <c>InstancePicker</c>.
|
||||
/// Everything downstream (the Connect button's enablement, <c>Connect()</c>
|
||||
/// itself) reads <c>_selectedInstanceId</c>, so there is nothing else to do.
|
||||
/// </summary>
|
||||
/// <param name="id">Id of the picked instance.</param>
|
||||
private void OnInstancePicked(int id) => _selectedInstanceId = id;
|
||||
|
||||
/// <summary>
|
||||
/// When the attribute filter changes, expand the tree so any branches holding
|
||||
|
||||
Reference in New Issue
Block a user