feat(draw): data-lightbox tap-to-zoom on the drawing card (T-318)
A data-lightbox element gets a tap target (click cursor) over its region; DrawingCard exposes an onLightbox callback, which the conversation wires to open the whole drawing in a ClideLightbox (zoomable). Completes the per-object overlay — captions + lightbox — and T-318's defined scope. Widget-tested (the tap fires the callback). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,4 +43,21 @@ void main() {
|
||||
expect(find.text('Node A'), findsOneWidget);
|
||||
expect(find.text('the entry point'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('a data-lightbox element fires onLightbox when tapped (T-318)', (tester) async {
|
||||
var tapped = false;
|
||||
final doc = buildSvgDocument('<svg viewBox="0 0 100 50"><rect x="0" y="0" width="100" height="50" data-lightbox=""/></svg>');
|
||||
await tester.pumpWidget(
|
||||
anchoredHarness(
|
||||
f,
|
||||
SizedBox(
|
||||
width: 400,
|
||||
child: DrawingCard(document: doc, onLightbox: () => tapped = true),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.tap(find.byType(DrawingCard));
|
||||
expect(tapped, isTrue);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user