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:
2026-06-28 22:40:26 +02:00
co-authored by Claude Opus 4.8
parent 3e43746c17
commit b1ec4afe15
3 changed files with 72 additions and 24 deletions
+17
View File
@@ -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);
});
}