Files
clide/test/goldens/tool_collapser_goldens_test.dart
T
jpmschweitzerandClaude Opus 4.8 6d0ebab721 chore: adopt Dart 3.9 toolchain — honest floor + tall-style reformat (T-353)
Raise the declared minimums in pubspec.yaml to what our deps already
require: Flutter >=3.35.0 / Dart >=3.9.0 (was 3.19.0 / 3.5.0). alchemist
0.12 needs Flutter 3.32; Dart 3.9 first ships in Flutter 3.35, so 3.35 is
the binding floor. Pin the exact build toolchain in .fvmrc (Flutter
3.44.1).

Moving to the Dart 3.9 language level switches `dart format` to the new
"tall" style and enables two new lints. This commit is the resulting
mechanical churn, isolated from any behaviour change:
  - whole-tree `dart format` reformat (tall style)
  - `dart fix` for unnecessary_underscores + use_null_aware_elements

No runtime behaviour change; `make test` green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 12:11:53 +02:00

85 lines
2.5 KiB
Dart

import 'package:alchemist/alchemist.dart';
import 'package:clide/builtin/claude/src/conversation_card.dart';
import 'package:clide/widgets/widgets.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import '../helpers/kernel_fixture.dart';
import '../helpers/widget_harness.dart';
/// Visualises the T-305 single-tool rendering: every tool use is a collapser
/// over a one-item list. Collapsed → ticker (label + echoed line + 1 step +
/// status). Expanded → the inner content card (body + folded result + its own
/// per-item mark; the collapser carries the aggregate).
void main() {
late KernelFixture f;
setUp(() async => f = await KernelFixture.create());
tearDown(() async => f.dispose());
Widget bashContent() => const ConversationCard(
variant: ConversationCardVariant.bordered,
accent: Color(0xFF4C9AFF),
label: 'Bash',
status: ConversationCardStatus.success,
body: Text(
'npm test',
style: TextStyle(fontSize: 12, color: Color(0xFF9DA5B4)),
textDirection: TextDirection.ltr,
),
extraSegments: [
CardSegment(
label: 'result',
child: Text(
'All 42 tests passed',
style: TextStyle(fontSize: 12, color: Color(0xFF9DA5B4)),
textDirection: TextDirection.ltr,
),
),
],
);
goldenTest(
'single tool collapser (T-305): collapsed ticker + expanded inner card',
fileName: 'tool_collapser',
builder: () => GoldenTestGroup(
columns: 1,
children: [
GoldenTestScenario(
name: 'collapsed — Bash, 1 step',
child: SizedBox(
width: 420,
child: harness(
f,
ClideCollapserCard(
label: 'Bash',
color: const Color(0xFF4C9AFF),
collapsedSummary: 'npm test',
counter: '1 step',
status: ClideRunStatus.success,
children: [bashContent()],
),
),
),
),
GoldenTestScenario(
name: 'expanded — inner content card',
child: SizedBox(
width: 420,
child: harness(
f,
ClideCollapserCard(
label: 'Bash',
color: const Color(0xFF4C9AFF),
counter: '1 step',
status: ClideRunStatus.success,
initiallyExpanded: true,
children: [bashContent()],
),
),
),
),
],
),
);
}