Files
clide/test/goldens/holder_card_goldens_test.dart
T
jpmschweitzerandClaude Opus 4.8 75f7d1ca12 restyle activity card as a holder container; background-toggle collapse (T-266)
Extracts a shared ClideHolderCard primitive (consumed next by T-264) that
renders a folded run as one framed container wrapping its sub-cards:

- The whole holder background is the collapse toggle — a gesture target
  behind the children that only fires for hits the children don't consume.
  Each sub-card opaquely absorbs its own bounds, so a card tap (and its
  copy button) interacts with the card, never the holder; selection drags
  pass through. This ends the scroll race: while a run tail-follows, a
  click on whatever background is in view collapses it, no top header to
  reach.
- A focusable caret keeps the control keyboard/AT reachable (D-78); the
  collapsed ticker + step count are preserved.
- _ActivityCard becomes a thin stateless adopter of the primitive.

Tests: ticker/expand, background-toggle, child-tap-not-hijacked, copy
still works, keyboard Activate path; golden for collapsed + expanded.

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

67 lines
2.0 KiB
Dart

import 'package:alchemist/alchemist.dart';
import 'package:clide/builtin/claude/src/conversation_card.dart';
import 'package:clide/builtin/claude/src/holder_card.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import '../helpers/kernel_fixture.dart';
import '../helpers/widget_harness.dart';
void main() {
late KernelFixture f;
setUp(() async => f = await KernelFixture.create());
tearDown(() async => f.dispose());
goldenTest(
'ClideHolderCard (T-266): collapsed ticker + expanded container of sub-cards',
fileName: 'holder_card',
builder: () => GoldenTestGroup(
columns: 1,
children: [
GoldenTestScenario(
name: 'collapsed (ticker + step count)',
child: _wrap(
f,
const ClideHolderCard(
collapsedSummary: 'Bash ls -la',
stepLabel: '3 steps',
children: [],
),
),
),
GoldenTestScenario(
name: 'expanded (framed container wrapping sub-cards)',
child: _wrap(
f,
const ClideHolderCard(
collapsedSummary: 'Bash ls -la',
stepLabel: '3 steps',
initiallyExpanded: true,
children: [
ConversationCard(
variant: ConversationCardVariant.bordered,
accent: Color(0xFF4C9AFF),
label: 'Bash',
body: Text('ls -la', textDirection: TextDirection.ltr),
),
ConversationCard(
variant: ConversationCardVariant.bordered,
accent: Color(0xFF4C9AFF),
label: 'Read',
body: Text('/lib/main.dart', textDirection: TextDirection.ltr),
),
],
),
),
),
],
),
);
}
Widget _wrap(KernelFixture f, Widget child) => SizedBox(
width: 360,
child: harness(f, child),
);