cdd54c113c
Floating chats were stuck on other destinations: the hidden Chat tab muted the window's hide animation, so the window stayed painted but took no input. The reveal now uses its own ticker, each floating pane's focus scope hangs from a FloatingFocusRoot above the destination stack, and the windows show over every destination like the terminal. Any number of chats can float; the shortcut, a window's X and the menu show or hide them together. Each pane keeps its own frame (also while docked), saved in record version 2; version 1 records still load. Drags read the live frame so fast pointer events no longer lose movement.
76 lines
2.3 KiB
Dart
76 lines
2.3 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/features/chat/ui/sessions/session_attention.dart';
|
|
|
|
void main() {
|
|
test('only final turn end clears working; a background shell cannot', () {
|
|
for (final status in ['started', 'streamed', 'running', 'streaming']) {
|
|
final effect = chatSessionFrameEffect({
|
|
'type': 'chat_event',
|
|
'chat_event': {
|
|
'session_id': 's',
|
|
'kind': 'step',
|
|
'step': {'status': status},
|
|
},
|
|
});
|
|
expect(effect!.running, isTrue);
|
|
expect(effect.attention, isFalse);
|
|
}
|
|
for (final kind in ['shell', 'compaction']) {
|
|
final effect = chatSessionFrameEffect({
|
|
'type': 'chat_event',
|
|
'chat_event': {
|
|
'session_id': 's',
|
|
'kind': kind,
|
|
kind: {'status': kind == 'shell' ? 'exited' : 'completed'},
|
|
},
|
|
});
|
|
expect(effect!.running, isNull);
|
|
expect(effect.attention, isFalse);
|
|
}
|
|
final intermediate = chatSessionFrameEffect({
|
|
'type': 'chat_event',
|
|
'chat_event': {
|
|
'session_id': 's',
|
|
'kind': 'step',
|
|
'step': {'status': 'ended', 'intermediate': true},
|
|
},
|
|
});
|
|
expect(intermediate!.running, isNull);
|
|
});
|
|
|
|
test('only visible assistant reply text is unread', () {
|
|
bool attention(Map<String, Object?> event) => chatSessionFrameEffect({
|
|
'type': 'chat_event',
|
|
'chat_event': {'session_id': 's', ...event},
|
|
})!.attention;
|
|
for (final status in ['running', 'completed', 'error']) {
|
|
expect(
|
|
attention({
|
|
'kind': 'tool',
|
|
'part': {
|
|
'type': 'tool',
|
|
'state': {
|
|
'status': status,
|
|
'content': [
|
|
{'type': 'text', 'text': 'out'},
|
|
],
|
|
'error': status == 'error' ? 'failed' : null,
|
|
},
|
|
},
|
|
}),
|
|
isFalse,
|
|
reason: 'tool $status',
|
|
);
|
|
}
|
|
expect(attention({'kind': 'user', 'delta': 'prompt'}), isFalse);
|
|
expect(attention({'kind': 'text', 'delta': ' \n'}), isFalse);
|
|
for (final messageKind in ['notice', 'agent_report']) {
|
|
expect(
|
|
attention({'kind': 'text', 'delta': 'x', 'message_kind': messageKind}),
|
|
isFalse,
|
|
);
|
|
}
|
|
expect(attention({'kind': 'text', 'delta': 'answer'}), isTrue);
|
|
});
|
|
}
|