From d739166cf9c89c61b668a098404444e741dfc36f Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 6 Nov 2026 23:47:52 +0000 Subject: [PATCH] Add an isolated single-task GUI fixture matching reported metadata --- app/tool/perf/perf_fixture.dart | 92 +++++++++++++++++++++------------ 1 file changed, 60 insertions(+), 32 deletions(-) diff --git a/app/tool/perf/perf_fixture.dart b/app/tool/perf/perf_fixture.dart index 9c6bc1e3..db16c193 100644 --- a/app/tool/perf/perf_fixture.dart +++ b/app/tool/perf/perf_fixture.dart @@ -24,10 +24,14 @@ import 'chat_question_fixture.dart'; import 'chat_scroll_fixture.dart'; Map _params = const {}; +DateTime? _exampleTaskStarted; /// Reads the options from the page URL's query, before the app rewrites it. void configurePerfFixture(Map params) { _params = params; + _exampleTaskStarted = DateTime.now().toUtc().subtract( + const Duration(minutes: 4, seconds: 40), + ); configureChatScrollFixture(params); configureChatQuestionFixture(params); } @@ -259,14 +263,16 @@ JsonMap? perfChatReply(JsonMap request) { return { 'id': id, 'type': 'chat_shells', - 'chat_shells': _params['tasks'] == 'rich' + 'chat_shells': + (_params['tasks'] == 'rich' || _params['tasks'] == 'example') ? backgroundTaskFixture() : const [], }; case 'chat_shell_output': final outputQuery = request['chat_shell_output_query']; final outputId = outputQuery is Map ? outputQuery['shell_id'] : null; - final selectedTask = _params['tasks'] == 'rich' + final selectedTask = + (_params['tasks'] == 'rich' || _params['tasks'] == 'example') ? backgroundTaskFixture() .where((task) => task['id'] == outputId) .firstOrNull @@ -349,33 +355,55 @@ List perfChatRows() => [for (var i = 0; i < _chats; i++) _chatRow(i)]; String perfChatMessageText(int m) => m.isEven ? 'Question $m' : _answer(m); /// Opt-in recorded task facts for background-list captures; never contacts a backend. -List backgroundTaskFixture() => [ - { - 'id': 'task-review', - 'status': 'running', - 'command': 'Agent: Review the integration changes', - 'task_type': 'agent', - 'description': 'Review the integration changes', - 'started_at': DateTime.utc(2026, 11, 6, 9, 5).millisecondsSinceEpoch, - 'updated_at': DateTime.utc(2026, 11, 6, 9, 24).millisecondsSinceEpoch, - 'progress': 'Checking tests and reviewing the remaining findings', - 'last_tool': 'Read', - 'tool_count': 18, - 'token_count': 12450, - }, - { - 'id': 'task-checks', - 'status': 'running', - 'command': 'flutter analyze && integration checks', - 'task_type': 'shell', - 'started_at': DateTime.utc(2026, 11, 6, 9, 18).millisecondsSinceEpoch, - 'progress': 'Analyzing application sources', - 'tool_count': 0, - }, - { - 'id': 'task-legacy', - 'status': 'running', - 'command': 'Wait for upstream release', - 'duration_ms': 74000, - }, -]; +List backgroundTaskFixture() { + if (_params['tasks'] == 'example') { + const title = 'Reading screenshots/intake-ui-review-r2/23-more-menu.png'; + return [ + { + 'id': 'task-screenshot', + 'status': 'running', + 'command': title, + 'description': title, + 'progress': title, + 'task_type': 'local_agent', + 'started_at': _exampleTaskStarted!.millisecondsSinceEpoch, + 'updated_at': _exampleTaskStarted! + .add(const Duration(minutes: 4)) + .millisecondsSinceEpoch, + 'last_tool': 'Read', + 'tool_count': 37, + 'token_count': 120905, + }, + ]; + } + return [ + { + 'id': 'task-review', + 'status': 'running', + 'command': 'Agent: Review the integration changes', + 'task_type': 'agent', + 'description': 'Review the integration changes', + 'started_at': DateTime.utc(2026, 11, 6, 9, 5).millisecondsSinceEpoch, + 'updated_at': DateTime.utc(2026, 11, 6, 9, 24).millisecondsSinceEpoch, + 'progress': 'Checking tests and reviewing the remaining findings', + 'last_tool': 'Read', + 'tool_count': 18, + 'token_count': 12450, + }, + { + 'id': 'task-checks', + 'status': 'running', + 'command': 'flutter analyze && integration checks', + 'task_type': 'shell', + 'started_at': DateTime.utc(2026, 11, 6, 9, 18).millisecondsSinceEpoch, + 'progress': 'Analyzing application sources', + 'tool_count': 0, + }, + { + 'id': 'task-legacy', + 'status': 'running', + 'command': 'Wait for upstream release', + 'duration_ms': 74000, + }, + ]; +}