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:
@@ -98,6 +98,12 @@ Future<IpcResponse> _draw(IpcRequest req, MessagePublisher? Function() publisher
|
||||
);
|
||||
}
|
||||
|
||||
publish('cli', drawShowChannel, {'svg': svg, if (doc.label != null) 'label': doc.label, if (doc.description != null) 'description': doc.description});
|
||||
publish('cli', drawShowChannel, {
|
||||
'svg': svg,
|
||||
if (doc.label != null) 'label': doc.label,
|
||||
if (doc.description != null) 'description': doc.description,
|
||||
// d2 cards carry their source so the card can offer a "view source" peek.
|
||||
if (doc.template == 'd2' && doc.fields['source'] is String) 'source': doc.fields['source'],
|
||||
});
|
||||
return IpcResponse.ok(id: req.id, data: {'shown': true, if (doc.template != null) 'template': doc.template});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user