feat(draw): fold the d2 source into a "view source" disclosure (T-494)

The rendered diagram leads; the d2 source carries through the draw bus and
folds into a collapsed ClideCollapserCard beneath the card (D-78 display-
only). en+nl catalogs. Also switches the d2 test to a null-aware element.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-29 12:08:33 +02:00
co-authored by Claude Opus 4.8
parent 64d77ec5dc
commit 5f8fa6af10
9 changed files with 82 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import 'package:clide/src/draw/draw_doc.dart';
import 'package:test/test.dart';
void main() {
DrawingCardDoc d2doc(Object? source) => DrawingCardDoc(template: 'd2', fields: {'template': 'd2', if (source != null) 'source': source});
DrawingCardDoc d2doc(Object? source) => DrawingCardDoc(template: 'd2', fields: {'template': 'd2', 'source': ?source});
group('d2TemplateHandler', () {
test('compiles the source field via the injected compiler', () async {