App: run tabs under the header on wide layouts, stable Artifacts tab, spelled-out pipeline status, shared list selection, code block header and edge fades

- Run detail: on a wide window (>= 840, pane >= 600) the tabs are Material
  segments under the run header; phones keep the floating bottom bar.
  Artifacts is always a tab, badged with its count and disabled with 0 (its
  tooltip says why), so Changes never moves.
- Pipelines list: 'Failed · last run 19 Oct' beside the status dot; facts on
  the next line; compact rows keep 'Failed · 19 Oct'.
- Settings: Disconnect is outlined beside a tonal Reconnect.
- Lists: one selection style (tonal fill plus one leading accent bar) for
  runs, pipelines and chats; chat's border, fill and pointer removed.
- Transcript: overflowing blocks fade at the edge with a chevron instead of
  a 'Scroll horizontally' line (semantics hint kept); code blocks get a
  header strip with language and Copy; lighter light-mode code fill.
- Runs list: rows under a day heading show only the time of day.
- Artifact search reveal re-centres once the lazy list's extent settles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 00:55:50 +00:00
parent accb9970b6
commit a6db4ba20e
37 changed files with 848 additions and 399 deletions
@@ -48,31 +48,36 @@ void main() {
.setMockMethodCallHandler(SystemChannels.platform, null),
);
testWidgets(
'fenced code reveals Copy without shifting and copies exact whitespace',
(tester) async {
const code = ' final x = 1;\n\tkeep spaces ';
await tester.pumpWidget(_host('```dart\n$code\n```'));
await tester.pumpAndSettle();
final before = tester.getTopLeft(find.text(code));
expect(find.text('Copy').hitTestable(), findsNothing);
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
await mouse.addPointer(location: const Offset(1, 1));
await mouse.moveTo(tester.getCenter(find.text(code)));
await tester.pump();
expect(find.text('Copy').hitTestable(), findsOneWidget);
expect(tester.getTopLeft(find.text(code)), before);
await tester.tap(find.text('Copy').hitTestable());
await tester.pump();
expect(copied, code);
expect(find.text('Copied').hitTestable(), findsOneWidget);
await mouse.moveTo(const Offset(1, 1));
await tester.pump();
expect(find.text('Copied').hitTestable(), findsNothing);
await mouse.removePointer();
await tester.pumpWidget(const SizedBox());
},
);
testWidgets('fenced code has a header strip with its language and Copy', (
tester,
) async {
const code = ' final x = 1;\n\tkeep spaces ';
await tester.pumpWidget(_host('```dart\n$code\n```'));
await tester.pumpAndSettle();
// One framed block: the header strip (label and Copy) sits on top of
// the code, inside the block, and Copy needs no hover (touch has none).
final header = tester.getRect(find.byKey(const Key('chat-code-header')));
final block = tester.getRect(find.byKey(const Key('chat-code-body')));
final label = tester.getRect(find.text('dart'));
final copy = tester.getRect(find.text('Copy').hitTestable());
expect(header.top, block.top);
expect(header.contains(label.center), isTrue);
expect(header.contains(copy.center), isTrue);
expect(tester.getTopLeft(find.text(code)).dy, greaterThan(header.bottom));
expect(block.contains(tester.getCenter(find.text(code))), isTrue);
final before = tester.getTopLeft(find.text(code));
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
await mouse.addPointer(location: const Offset(1, 1));
await mouse.moveTo(tester.getCenter(find.text(code)));
await tester.pump();
expect(tester.getTopLeft(find.text(code)), before);
await tester.tap(find.text('Copy').hitTestable());
await tester.pump();
expect(copied, code);
expect(find.text('Copied').hitTestable(), findsOneWidget);
await mouse.removePointer();
await tester.pumpWidget(const SizedBox());
});
testWidgets(
'inline spans retain selection, hover transfer and copy the right raw snippet',
@@ -168,11 +173,11 @@ void main() {
await tester.pumpWidget(const SizedBox());
});
testWidgets('keyboard focus exposes the reserved block action', (
testWidgets('the block action is reachable from the keyboard', (
tester,
) async {
await tester.pumpWidget(_host('```text\nraw\n```'));
expect(find.text('Copy').hitTestable(), findsNothing);
expect(find.text('Copy').hitTestable(), findsOneWidget);
// The selectable transcript itself is the first focus stop.
await tester.sendKeyEvent(LogicalKeyboardKey.tab);
await tester.pump();
@@ -45,6 +45,9 @@ Widget _host({
);
}
/// The chevron over the faded side with more content.
Finder _more(String side) => find.byKey(Key('chat-horizontal-more-$side'));
ScrollController _controller(WidgetTester tester) =>
tester.widget<Scrollbar>(find.byType(Scrollbar)).controller!;
@@ -55,14 +58,16 @@ void main() {
(tester) async {
await tester.pumpWidget(_host(brightness: brightness));
await tester.pumpAndSettle();
expect(find.text('Scroll horizontally'), findsOneWidget);
expect(find.byKey(const Key('chat-horizontal-fade')), findsOneWidget);
final controller = _controller(tester);
expect(controller.position.maxScrollExtent, 640);
expect(
tester.widget<Scrollbar>(find.byType(Scrollbar)).thumbVisibility,
isTrue,
);
expect(find.byIcon(Icons.arrow_forward), findsOneWidget);
// More content to the right: that side fades under a chevron.
expect(_more('right'), findsOneWidget);
expect(_more('left'), findsNothing);
final focus = tester
.widgetList<Focus>(find.byType(Focus))
.firstWhere(
@@ -73,15 +78,17 @@ void main() {
await tester.sendKeyEvent(LogicalKeyboardKey.arrowRight);
await tester.pumpAndSettle();
expect(controller.offset, 80);
expect(find.byIcon(Icons.swap_horiz), findsOneWidget);
expect(_more('left'), findsOneWidget);
expect(_more('right'), findsOneWidget);
controller.jumpTo(controller.position.maxScrollExtent);
await tester.pumpAndSettle();
expect(find.byIcon(Icons.arrow_back), findsOneWidget);
expect(_more('left'), findsOneWidget);
expect(_more('right'), findsNothing);
await tester.pumpWidget(
_host(brightness: brightness, contentWidth: 120),
);
await tester.pumpAndSettle();
expect(find.text('Scroll horizontally'), findsNothing);
expect(find.byKey(const Key('chat-horizontal-fade')), findsNothing);
expect(tester.takeException(), isNull);
},
);
@@ -92,9 +99,10 @@ void main() {
(tester) async {
await tester.pumpWidget(_host(direction: TextDirection.rtl));
await tester.pumpAndSettle();
expect(find.byIcon(Icons.arrow_back), findsOneWidget);
expect(_more('left'), findsOneWidget);
expect(_more('right'), findsNothing);
expect(
tester.widget<Icon>(find.byIcon(Icons.arrow_back)).textDirection,
tester.widget<Icon>(_more('left')).textDirection,
TextDirection.ltr,
);
final controller = _controller(tester);
@@ -169,7 +177,7 @@ void main() {
find.bySemanticsLabel('Horizontally scrollable table'),
findsNothing,
);
expect(find.text('Scroll horizontally'), findsOneWidget);
expect(find.byKey(const Key('chat-horizontal-fade')), findsOneWidget);
final viewport = tester.getRect(find.byType(ChatMarkdownView));
expect(
tester.getRect(find.byType(Table)).right,
@@ -27,7 +27,7 @@ void main() {
'| No | Text | Ok |\n| --- | --- | --- |\n'
'| one | ${List.filled(30, 'word').join(' ')} | done |',
);
expect(find.text('Scroll horizontally'), findsNothing);
expect(find.byKey(const Key('chat-horizontal-fade')), findsNothing);
expect(tableRect(tester).right, lessThanOrEqualTo(screenRight));
final description = tester.getSize(find.textContaining('word word'));
final status = tester.getSize(find.text('done'));
@@ -55,7 +55,7 @@ void main() {
'| --- | --- | --- | --- | --- | --- | --- |\n'
'| a b | c d | e f | g h | i j | k l | m n |',
);
expect(find.text('Scroll horizontally'), findsOneWidget);
expect(find.byKey(const Key('chat-horizontal-fade')), findsOneWidget);
expect(
find.bySemanticsLabel('Horizontally scrollable table'),
findsOneWidget,
@@ -76,7 +76,7 @@ void main() {
'| Column | Notes |\n| --- | --- |\n'
'| x | ${List.filled(40, 'note').join(' ')} |',
);
expect(find.text('Scroll horizontally'), findsNothing);
expect(find.byKey(const Key('chat-horizontal-fade')), findsNothing);
expect(tableRect(tester).right, lessThanOrEqualTo(screenRight));
final header = tester.getSize(find.text('Column')).height;
expect(header, tester.getSize(find.text('x')).height);