Add an isolated single-task GUI fixture matching reported metadata
This commit is contained in:
@@ -24,10 +24,14 @@ import 'chat_question_fixture.dart';
|
||||
import 'chat_scroll_fixture.dart';
|
||||
|
||||
Map<String, String> _params = const {};
|
||||
DateTime? _exampleTaskStarted;
|
||||
|
||||
/// Reads the options from the page URL's query, before the app rewrites it.
|
||||
void configurePerfFixture(Map<String, String> 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<JsonMap> 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<JsonMap> 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<JsonMap> 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,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user