feat(app): wire native cancel and track complete port acceptance
This commit is contained in:
@@ -114,12 +114,32 @@ class RunsController extends ChangeNotifier {
|
||||
if (id == null) return;
|
||||
var changed = false;
|
||||
if (detail?['id'] == id) {
|
||||
++_detailGeneration;
|
||||
_cancelDetailRefresh();
|
||||
detail = run;
|
||||
detailLoading = false;
|
||||
error = null;
|
||||
changed = true;
|
||||
}
|
||||
final index = runs.indexWhere((row) => row['id'] == id);
|
||||
if (index >= 0) {
|
||||
runs = [...runs]..[index] = {...runs[index], 'title': run['title'] ?? ''};
|
||||
// A cancel/decision reply changes lifecycle fields as well as title.
|
||||
// Keep sparse/unknown summary fields, without copying bulky detail-only
|
||||
// payloads into the held list or inventing missing values.
|
||||
const detailOnly = {
|
||||
'steps',
|
||||
'input',
|
||||
'output',
|
||||
'graph',
|
||||
'usage',
|
||||
'notifications',
|
||||
};
|
||||
runs = [...runs]
|
||||
..[index] = {
|
||||
...runs[index],
|
||||
for (final entry in run.entries)
|
||||
if (!detailOnly.contains(entry.key)) entry.key: entry.value,
|
||||
};
|
||||
changed = true;
|
||||
}
|
||||
if (changed) notifyListeners();
|
||||
|
||||
Reference in New Issue
Block a user