feat(app): wire run rename from the native run detail

Expose the existing RunTitleAction from the real run detail under both native hosts and fold the server's accepted run_detail into the open detail and the matching list row through RunsController, mirroring the web applyRunTitle path. Adds focused wiring/controller tests, a real-composition browser probe and an evidence note. Mobile remains unverified.
This commit is contained in:
2026-10-21 19:16:49 +01:00
parent fadeaff1cc
commit 3d3ee3a3ab
11 changed files with 973 additions and 8 deletions
@@ -341,4 +341,43 @@ void main() {
await Future<void>.delayed(Duration.zero);
expect(controller.detail?['id'], 1);
});
test(
'an accepted rename folds into the selected detail and its list row',
() async {
final load = controller.load();
gateway.listReply(0, [
{'id': 1, 'title': 'Old title', 'status': 'running', 'name': 'one'},
{'id': 2, 'title': 'Other run', 'status': 'running'},
]);
await load;
final first = controller.select(1);
gateway.detailReply(1, 0, {
'id': 1,
'title': 'Old title',
'input': {'prompt': 'stored'},
});
await first;
controller.acceptRunDetail({
'id': 1,
'title': 'Renamed',
'status': 'succeeded',
});
expect(controller.detail?['title'], 'Renamed');
expect(controller.runs.first['title'], 'Renamed');
expect(controller.runs.first['name'], 'one');
expect(controller.runs[1]['title'], 'Other run');
final second = controller.select(2);
gateway.detailReply(2, 0, {'id': 2, 'title': 'Other run'});
await second;
controller.acceptRunDetail({'id': 1, 'title': 'Late rename'});
expect(controller.detail?['id'], 2);
expect(controller.detail?['title'], 'Other run');
expect(controller.runs.first['title'], 'Late rename');
},
);
}