feat(canvas): open .canvas files in a workspace pane (T-322)

Makes the canvas foundation (parser/renderer/view) reachable. The
extension owns an app-scoped MultitabController (the diff/T-233
pattern) so open documents survive the pane being rebuilt; each
document is a real sub-tab per the refinement decision, kept alive
across switches. Routing goes through the existing seams instead of
the dead TabContribution.fileGlobs field: openWorkspaceFile gains a
.canvas branch mirroring .md, and ui.open gains a canvas reader for
D-6 parity (clide ui open canvas <path>). Also corrects the
json_canvas doc header that claimed SVG-lowering — the interactive
pane paints the model directly (D-103 live-widget exception).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 08:56:09 +02:00
co-authored by Claude Fable 5
parent 8d7d886bea
commit e2e305dea6
13 changed files with 538 additions and 14 deletions
+11 -1
View File
@@ -59,6 +59,16 @@ void main() {
expect(published.single.data, {'path': 'lib/main.dart'});
});
test('canvas keys on path and publishes a builtin.canvas selection (T-322)', () async {
wire();
final r = await open(['canvas', 'notes/board.canvas']);
expect(r.ok, isTrue, reason: r.error?.message);
expect(r.data['opened'], isTrue);
expect(published.single.publisher, 'builtin.canvas');
expect(published.single.channel, 'selection');
expect(published.single.data, {'path': 'notes/board.canvas'});
});
test('named args work too (reader/ref)', () async {
wire();
final r = await d.dispatch(IpcRequest(id: '1', cmd: 'ui.open', args: {'reader': 'tickets', 'ref': 'T-7'}));
@@ -68,7 +78,7 @@ void main() {
test('unknown reader → userError, nothing published', () async {
wire();
final r = await open(['canvas', 'foo']);
final r = await open(['bogus', 'foo']);
expect(r.ok, isFalse);
expect(r.error?.kind, IpcErrorKind.userError);
expect(published, isEmpty);