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
+5 -1
View File
@@ -1,6 +1,7 @@
/// The single dispatch point for opening a workspace file the way
/// clide routes file activations (T-51 / T-187):
/// * `.md` paths → the markdown reader, via the kernel MessageBus;
/// * `.canvas` paths → the canvas pane, via the kernel MessageBus (T-322);
/// * every other path → the editor, via the `editor.open` IPC verb.
///
/// Records the open in [KernelServices.recentFiles] so the quick-open
@@ -15,8 +16,11 @@ import 'package:clide/kernel/src/facade.dart';
void openWorkspaceFile(KernelServices services, String path) {
if (path.isEmpty) return;
services.recentFiles.push(path);
if (path.toLowerCase().endsWith('.md')) {
final lower = path.toLowerCase();
if (lower.endsWith('.md')) {
services.messages.publish('builtin.markdown', 'selection', {'path': path});
} else if (lower.endsWith('.canvas')) {
services.messages.publish('builtin.canvas', 'selection', {'path': path});
} else {
unawaited(services.ipc.request('editor.open', args: {'path': path}));
}