feat(app): wire native cancel and track complete port acceptance

This commit is contained in:
2026-10-21 20:04:38 +01:00
parent 0eb3e23fc8
commit e20ac9f5a1
10 changed files with 295 additions and 13 deletions
+21 -1
View File
@@ -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();